Early-life experience reorganizes neuromodulatory regulation of stage-specific behavioral responses and individuality types during development

Early-life experiences may promote stereotyped behavioral alterations that are dynamic across development time, but also behavioral responses that are variable among individuals, even when initially exposed to the same stimulus. Here, by utilizing longitudinal monitoring of C. elegans individuals throughout development we show that behavioral effects of early-life starvation are exposed during early and late developmental stages and buffered during intermediate stages of development. We further found that both dopamine and serotonin shape the discontinuous behavioral responses by opposite and temporally segregated functions across development time. While dopamine buffers behavioral responses during intermediate developmental stages, serotonin promotes behavioral sensitivity to stress during early and late stages. Interestingly, unsupervised analysis of individual biases across development uncovered multiple individuality types that coexist within stressed and unstressed populations and further identified experience-dependent effects on their composition. These results provide insight into the complex temporal regulation of behavioral plasticity across developmental timescales, structuring shared and unique individual responses to early-life experiences.


Introduction
Long-term behavioral patterns across development are highly dynamic across and within developmental stages and are temporally synchronized with the individual's developmental clock. For instance, flies show differences in foraging behavior that depend on their larval stage (Sokolowski et al., 1984), fish internally modify their startle response across life (Kimmel et al., 1974) and stomatogastric motor patterns are regulated across development (Rehm et al., 2008). In addition, fear-extinction learning is inhibited during adolescence compared to other life-stages in humans and mice (Pattwell et al., 2012). Long-term behavioral outputs are influenced by the changes in the internal state of individuals, as well as by their past and current environmental exposures. In particular, animals may be transiently exposed to environmental perturbations at different stages of life, but experiences during early developmental windows, which are usually referred to as critical or sensitive periods, were shown to generate long-lasting effects (Lorenz, 1935;Korosi et al., 2012;Jin et al., 2016;Nevitt et al., 1994;Remy and Hobert, 2005). This stable imprinting of early memories has the potential to increase survival and reproduction during later life-stages of the organism (Immelmann, 1975). However, a complete temporal view of the long-term effects of early experiences on behavior throughout development, across and within all stages, is still lacking.
While long-lasting effects on behavior may be shared by many individuals, reflected by stereotypic behavioral responses following an early-life experience, individuals within the same population may also show unique patterns of long-term behavior that distinguish them from each other. This inter-individual variation in behavioral responses may be exposed even when animals are initially experiencing the same early conditions. Here we study how early-life experiences shape stagespecific behavioral patterns across development and how they affect the diversity in long-term behavioral responses among individuals. Consistent behavioral individuality within isogenic populations that were raised in the same environment has been previously described in various species, including in the pea aphid (Schuett et al., 2011), D. melanogaster (Buchanan et al., 2015;Kain et al., 2012;Linneweber et al., 2020), clonal fish (Bierbach et al., 2017) and mice (Freund et al., 2013). The nematode C. elegans in an ideal system to study how early-life experiences shape long-term behavior and inter-individual variation across developmental timescales due to their short development time of 2.5 days and the homogeneous populations generated by the self-fertilizing reproduction mode of the hermaphrodite. It was previously shown that under normal growth conditions, C. elegans shows both stereotypic patterns of long-term behavior and consistent individual biases within the isogenic population (Stern et al., 2017).

Early-life stress generates discontinuous and distinct behavioral effects at different stages of development
To study how stressful environments early in life influence long-term behavioral patterns across and within all developmental stages we continuously tracked the behavior of individual animals following a transient period of starvation early in development. Imaging was performed using a custom-made multi-camera imaging system across the full developmental trajectory of C. elegans individuals (55 hours), at high spatiotemporal resolution (3fps, ~10um) and in a tightly controlled environment (Stern et al., 2017). First larval stage (L1) animals that hatch into an environment that completely lacks a food source do not grow and their development is arrested (Greenwald and Horvitz, 1982;Johnson et al., 1984;Baugh, 2013).
Following L1 arrest, when animals encounter food, they resume their normal developmental trajectory to reach adulthood. This early-stress paradigm allows us to maintain a homogeneous stress environment across individuals at their earliest stage of development, immediately after hatching.
We continuously monitored single N2 wild-type individuals grown in isolation from their first larval stage to 16 hours of adulthood (n=456) on defined concentrations of UV-killed OP50 bacteria, following periods of stress ranging from 1 to 4 days of early starvation (Fig. 1A,B). In parallel, we tracked the behavior of individuals grown continuously on food, without experiencing starvation (Fig.   1A,B). Animals exposed to early starvation required more time to complete their development (Fig. S1A). To align developmental trajectories of different individuals in time, we age-normalized individuals by dividing each developmental stage, detected by the lethargus period during molting (Cassada and Russell, 1975), into 75 time windows ( Fig. S1C) (Stern et al., 2017). Whilst growing in a food environment, C. elegans shifts between two behavioral states called roaming and dwelling that last seconds to minutes (Arous et al., 2009;Flavell et al., 2013;Fujiwara et al., 2002;Stern et al., 2017). During a roaming episode animals explore a large area by highspeed forward movements, while in the dwelling episode they show dramatically less exploration due to low-speed movements coupled with frequent reorientations (Fig.   S1B). We quantified long-term patterns of locomotory behavior shown by individuals throughout development by measuring two behavioral parameters: fraction of time spent roaming, and speed during roaming episodes.
Unstressed individuals hatching in a food environment show dynamic behavioral structures of roaming activity across development, as was previously shown (Stern et al., 2017) (Fig. 1B-D). We found that a transient exposure to earlylife starvation generates alterations in long-term behavioral patterns throughout development that were distinct and discontinuous across and within developmental stages. A short early-starvation period of 1 day strongly decreased average roaming activity levels during the L1 and adult stages compared to unstressed individuals ( Fig. 1C,E; S1D). In contrast, while 1 day of early starvation modified the temporal structure of activity peaks within the L2 stage, overall roaming activity was not decreased during this stage. Similarly, we found that roaming activity levels were also maintained during the L3 and L4 stages, following 1-day starvation (Fig. 1C,E; S1D). Interestingly, animals exposed to longer starvation periods of 3 and 4 days further showed strong roaming decrease during L1 and adulthood ( Figure 1D, Similar to the stage-specific effects of early starvation on the fraction of time spent roaming, instantaneous speed during roaming episodes in individuals exposed to early starvation was affected more strongly at the L1 and adult stages, compared to the intermediate stages ( Figure S1E). In summary, transient early-life starvation discontinuously reshapes long-term behavioral patterns across development time by exposing strong behavioral alterations at early and late developmental stages and buffered effects during intermediate stages.

Unsupervised analysis uncovers multiple individuality types within stressed and unstressed populations
The longitudinal measurements in single animals across development allow us to further quantify long-term inter-individual diversity within stressed and unstressed populations. Following early starvation, different individuals show substantial variation in long-term behavioral responses. For instance, during L1 and adulthood, a fraction of wild-type individuals that were exposed to early stress show 8 to 10-fold decrease in roaming activity relative to the average roaming level of the unstressed population, while other stressed individuals show roaming activity which is indistinguishable from unstressed animals (Fig. S1D). Behavioral individuality is usually defined as a consistent tendency of an individual to show the same behavioral bias relative to the population across long time-periods (Bierbach et al., 2017;Buchanan et al., 2015;Kain et al., 2012;Stern et al., 2017;Schuett et al., 2011). However, individuals may also show alternative patterns of temporal behavioral biases relative to the population that are not random and represent more complex structures of individual biases over time. Here we extend the 'classic' analysis of individuality and ask if alternative individuality types coexist within C. elegans populations across development.
To analyze long-term individual biases in behavior we first systematically rank individuals based on their roaming activity compared to all other individuals within the same experiment across developmental windows (50 time-bins) ( Fig. 2A,B). The rank approach allows us to homogeneously compare between individuals at each developmental window. To take an unsupervised approach for detecting temporal patterns of individual biases that are dominant within stressed and unstressed populations we performed principal component analysis (PCA) of the temporal behavioral ranks of all wild-type individuals (n=456). We then identified statistically significant PC dimensions by comparing them to PCs obtained from a randomly shuffled rank dataset ( Fig. 2C-F; Fig. S2A).
We found that among the significant PC dimensions, the three major PCs (PC1-PC3) captured three distinct types of temporal individuality patterns within stressed and unstressed populations ( Fig. 2D-F). PC1, which explained the majority of temporal variation in individual biases over time had eigenvector components of the same sign, indicating an individuality type of animals that consistently roam more or less than the population homogeneously across all developmental stages (Fig.   2D). The individuality type identified by PC1 unbiasedly recaptured a known mode of consistent individuality that was previously identified using a pre-defined index of long-term behavioral consistency across development (Stern et al., 2017) (Fig. S2B-C). This was further verified by the high correlation between the pre-defined consistency-index and scores of PC1 across individuals (R=0.9) (Fig. S2D).
Interestingly, in contrast to PC1, PC2 and PC3 identified uncharacterized individuality types. PC2, which had opposite signs of eigenvector components before and after mid-development captured an individuality type that includes individuals that switch their behavioral bias once, during the L3 stage, from roaming more to roaming less than the population and vice versa (Fig. 2E). In addition, PC3, which had signs of eigenvector components that switch twice during development (at the end of L1 and L4), identified individuals that show the same behavioral bias during L1 and adulthood, which is opposite to their behavioral bias during intermediate stages (Fig. 2F). Both PC2 and PC3 scores of individuals did not correlate with the pre-defined consistency index (R=0.04 and 0.09, respectively) ( Fig. S2D), further indicating that they indeed represent uncharacterized modes of temporal individuality types.
Inter-individual variation in a specific individuality type reflects how extreme individuals are within a population towards the identified individuality dimension. We

Dopamine buffers behavioral responses to early stress during intermediate developmental stages
Neuromodulatory pathways are known to establish internal behavioral states and modify them based on the environmental context (Harris-Warrick and Marder, 1991;Bargmann, 2012;Marder, 2012;Kennedy et al., 2014;Taghert and Nitabach, 2012;Nusbaum and Blitz, 2012). In particular, the bioamine dopamine was implicated in controlling a wide array of behavioral outputs at various timescales, ranging from minutes and hours, to long-term behavioral patterns that are regulated across life-stages (Marella et al., 2012;Omura et al., 2012;Sawin et al., 2000;Cermak et al., 2020;Stern et al., 2017). In C. elegans, dopamine is produced in a specific set of neuronal sites and its effects are known to be mediated by dopamine receptors that are localized to responding neurons (Sulston et al., 1975;Lints and Emmons, 1999;Chase et al., 2004;Tsalik et al., 2003).
To ask if dopamine acts across different developmental stages to shape the discontinuous pattern of long-term behavioral responses to early stress and to dissect its temporal requirement, we tracked the behavior of dopamine deficient cat-2 animals following exposure to L1 starvation ( Fig. 3A; Fig. S3A). When continuously grown in a food environment, cat-2 individuals show a long-term roaming activity pattern that is similar to the wild-type population (Stern et al., 2017) (Fig. 1,3).
However, we found that in contrast to stressed wild-type individuals that show buffering of behavioral responses during the L2, L3 and L4 intermediate stages, cat-2 individuals that were exposed to early-starvation show reduction in overall roaming activity across all developmental stages, including during the intermediate stages ( Fig. 3B,C). The behavioral effects of early starvation during mid-development in cat-2 individuals were not only restricted to animals that were exposed to long starvation periods, as 1 day of early starvation was sufficient to induce a strong reduction in roaming activity during the L2-L4 intermediate stages ( Fig. 3D; Fig. S3B).
Interestingly, during the intermediate stages the effects on roaming activity were more pronounced during the first half of the stage, indicating within-stage regulation of behavioral response by dopamine (Fig. 3B,C). However, behavioral effects during L1 and adulthood following early stress were similar in cat-2 and wild-type ( It was previously shown that during L2 to adulthood, cat-2 individuals have higher instantaneous speed during roaming episodes (Stern et al., 2017;Sawin et al., 2000). We found that unlike stressed wild-type individuals in which roaming speed was decreased mainly during L1 and adulthood (Fig. S1E), cat-2 mutants show lower speed also across the L2 and L3 stages following stress ( Figure S3C).
To further ask if dopamine supplementation can restore the buffering of behavioral responses to stress during intermediate developmental stages, we exposed cat-2 individuals to exogenous dopamine via their food after experiencing early starvation (Fig. 4A,B; Fig. S4A,B). We found that supplementing dopamine post-starvation was sufficient to recapitulate the buffering of only the roaming responses to stress in cat-2 individuals during the L2,L3 and L4 stages (

Specific dopamine receptors function during mid-development to mediate buffering of long-term behavioral responses
The buffering of behavioral effects during the L2, L3 and L4 intermediate developmental stages by dopamine led us to explore the temporal contribution of specific dopamine receptors during these development times. The C. elegans dopamine receptor DOP-1 is a D1-like receptor which signal through Gαs/olf to activate adenylyl cyclase and DOP-2 and DOP-3 receptors are D2-like receptors which signal via Gαi to suppress adenylyl cyclase (Chase et al., 2004;Sanyal et al., 2004;Sugiura et al., 2005;Suo et al., 2003).
To study the independent function of dopamine receptors we analyzed the long-term behavioral effects of early starvation in animals mutant for each of the Previously, DOP-2 and DOP-3 were shown to cooperatively function to mediate behavioral effects of dopamine (Cermak et al., 2020;Suo et al., 2009). Therefore, we sought to test if simultaneous alteration of both dopamine receptors will recapitulate the full long-term behavioral effect during intermediate developmental stages, as shown in cat-2 mutants. We found that following early starvation, dop-2;dop-3 double mutants showed a decreased roaming activity across all intermediate stages (

Serotonin promotes behavioral responses to early stress during early and late developmental stages
To ask if the stage-specific effects of early-life stress on developmental patterns of behavior are an integration of multiple temporal responses that are mediated by different neuromodulators, we also examined serotonin function in shaping long-term behavior following early starvation ( Fig. 5A; Fig. S7A). Under normal growth conditions, serotonin-deficient tph-1 individuals roam more than wild-type across all developmental stages (Flavell et al., 2013;Stern et al., 2017). We found that contrary to the effects of dopamine on the buffering of behavioral responses during intermediate stages, tph-1 individuals that were exposed to 1 day of early starvation maintained their roaming activity during L1 and adulthood ( To test if longer starvation periods early in life will establish behavioral effects during L1 and adulthood we further exposed tph-1 animals to 3-and 4-days of earlystarvation. We found that long starvation periods led to a reduction in roaming activity in the L1 stage of tph-1 animals. However, during the adult stage, tph-1 individuals were still less responsive to early stress, compared to the strong decrease in roaming in the wild-type (

Early-life experiences and neuromodulation shape variation in individuality types within populations
To ask if neuromodulatory pathways affect specific individuality types to reshape inter-individual variation within stressed and unstressed populations, we performed the PCA on pooled data across the wild-type, cat-2 and tph-1 populations  (Stern et al., 2017). Similarly, we found that inter-individual variation in PC1 individuality type which reflects an individuality mode of consistent homogeneous bias across all developmental stages ( Fig. S8B-D) was reduced within the unstressed and 1-day starved tph-1 populations, compared to wild-type (Fig. 6D).
However, we found that following long starvation periods (3 and 4 days), interindividual variation in PC1 type was not significantly different in tph-1 individuals, compared to the wild-type population (Fig. 6D). The increase in PC1 inter-individual variation in tph-1 individuals following stress indicates that early starvation experiences may generate extreme behavioral consistency in a specific neuromodulatory context where consistency levels are initially low. In contrast to tph-1 mutants, dopamine-deficient cat-2 individuals did not show a significant difference in PC1 inter-individual variation across all conditions, compared to wild-type ( Fig.   6D).
In addition, we found that serotonin also alters the effects of stress on interindividual variation in PC3 type (double bias switching across development). In particular, while the wild-type population showed an increased inter-individual variation in PC3 type following 3 days of early starvation, tph-1 mutants had significantly lower PC3 inter-individual variation (Fig. 6E) following the same stressful experience. The effect of serotonin on PC3 inter-individual variation was specific, as dopamine-deficient cat-2 individuals showed similar increase in PC3 inter-individual variation following 3 days of starvation when compared to wild type (Fig. 6E).
Interestingly, neuromodulation affected only a fraction of the identified individuality types. Inter-individual variation in PC2 type (single bias switching during middevelopment) was not significantly different in tph-1 and cat-2 mutants when compared to wild type populations ( Fig S8E). Overall, these results imply that interindividual variation in a spectrum of individuality types may be dynamically structured by the integration of the population's neuromodulatory state and its early lifeexperience.

Discussion
Spontaneous behavioral patterns across development are structured in time and shaped by the integration of the individual's internal state and its past and current environments. In this work we studied how developmental patterns of behavior and inter-individual variation are dynamically affected by early-life starvation and the neuromodulatory pathways that organize these long-term behavioral responses. The effects of transient early experiences on neuronal and behavioral states during specific developmental stages were studied across species (Horn, 1998;Kimmel et al., 1974;Nakamori et al., 2013;Pradhan et al., 2019;Remy and Hobert, 2005;Wilson and Sullivan, 1994). However, how transient environmental experiences early in development continuously reshape behavior throughout the full developmental trajectory of the organism is unknown.
Here, we utilized long-term behavioral tracking systems at high spatiotemporal resolution (Stern et al., 2017) to analyze and compare long-term alterations of behavioral patterns across and within all developmental stages of C. elegans, following transient periods of starvation early in life. Our results show that early starvation generates stage-specific behavioral responses that are discontinuous across development, manifested by stronger decrease in roaming activity during early and late stages, compared to intermediate developmental stages. These variable influences of early starvation across development time suggest that while the memory of early experiences is maintained to adulthood, behavioral changes are buffered during mid-development.
As imprinting of early memories was shown to have an adaptive value for later stages of life (Immelmann, 1975), we hypothesized that neuronal mechanisms actively buffer behavioral alterations at specific development times so as to support the exploratory activity of individuals during critical developmental windows. Building on this idea, we further analyzed the contribution of neuromodulatory pathways for shaping the stage-specific patterns of behavioral responses across development.
Neurotransmitters and hormones were shown to regulate behavioral patterns across development (Sisk and Foster, 2004;Truman, 2005;Wigglesworth, 1936;Aton et al., 2005;Park and Hall, 1998;Rehm et al., 2008). In C. elegans populations grown continuously on food, neuromodulators show both consistent and time-dependent behavioral effects at specific developmental windows (Stern et al., 2017). We found that following early transient stress, dopamine and serotonin control of long-term behavioral responses is opposite and temporally segregated over development time.
Dopamine was required for behavioral buffering during intermediate developmental stages and serotonin established behavioral responses to early stress during early and late developmental stages. In C. elegans, dopamine is produced in four pairs of neurons: CEPV, CEPD, ADE, and PDE (Sulston et al., 1975;Lints and Emmons, 1999) and was shown to be required for controlling locomotory patterns (Omura et al., 2012) and coupling of behavioral programs (Cermak et al., 2020). In particular, dopamine was shown to decrease the instantaneous speed of worms grown on food, compared to non-food environment (Sawin et al., 2000). We found that following early-life starvation, dopamine is required for buffering roaming decrease during receptors within the C. elegans nervous system are partially overlapping (Tsalik et al., 2003;Chase et al., 2004;Sanyal et al., 2004;Suo et al., 2003), raising the possibility that different subnetworks within the nervous system function to temporally regulate behavioral buffering across development. Similarly, the function of serotonin receptors in maintaining patterns of roaming activity in unstressed individuals was also shown to be modular across developmental stages (Stern et al., 2017), suggesting a common principle of temporal regulation of behavior by neuromodulatory receptors.
In contrast to dopamine function during intermediate developmental stages, we showed that serotonin promotes roaming responses to early stress during L1 and adulthood. Under normal growth conditions, serotonin is known to regulate roaming behavior in C. elegans across all developmental stages, (Flavell et al., 2013;Stern et al., 2017) and is required for long-and short-term associative olfactory memory (Jin et al., 2016;Zhang et al., 2005). In rodents, serotonin and dopamine interact to establish motor patterns (Sasaki-Adams, 2001). It is plausible that the complexity of long-term behavioral responses to early-stress reflects a time-integration of the function of multiple neuromodulators, each of them acting at different development times and with different intensity.
However, the effects of early stressful experiences on patterns of individual biases within isogenic populations are less explored. The long-term behavioral tracking of single animals allowed us to ask how early-life stress modifies patterns of interindividual behavioral variation and whether neuromodulation control the structure of individuality under stress. Individuality is classically defined as the tendency of an individual to show the same behavioral bias relative to the population over long timescales. We hypothesized that within isogenic populations, individuals may show alternative modes of temporal behavioral biases across development that are not random and represent alternative individuality types.
By using an unbiased approach of dimensionality reduction, we found multiple individuality types that coexist within stressed and unstressed populations. While the main PC1 individuality type recaptured a known individuality type of consistent individual biases over time (Stern et al., 2017), PC2 and PC3 identified alternative individuality types that are significant within populations and represent individuals that show switching of behavioral bias, relative to the population, at specific developmental times. These results further extend the view of long-term behavioral individuality, implying a wide spectrum of alternative individual biases within populations (Tang et al., 2012). A plausible explanation for the coexistence of multiple individuality types is that, upon stress or another unpredictable environment, it will be beneficial for the population to dynamically reshape the composition of individuality types so as to modify individual strategies and increase the population's chance of survival (Cooper and Kaplan, 1982;Honegger and de Bivort, 2018).
Neuromodulation was previously shown to affect levels of consistent individual biases (Honegger et al., 2020;Kain et al., 2012;Pantoja et al., 2016;Stern et al., 2017). We tested how early-life experiences and neuromodulation shape the identified individuality types across development. Interestingly, we found that interindividual variation in specific types depends on both the neuromodulatory state of the population and its early experience. An open question is what are the sources of variation within the nervous system that give rise to different individuality types?
Underlying differences among individuals may include diversity in gene-expression patterns (Casanueva et al., 2012), nervous system structure (Witvliet et al., 2021;Brittin et al., 2021;Linneweber et al., 2020;Churgin et al., 2021), and underlying persistent differences in neruomodulatory parameters that have phenotypic effects under extreme conditions (Marder et al., 2022). It is plausible that some of this variation, which is partially stochastic by nature, may generate different behavioral biases of individuals within isogenic populations.
The behavioral patterns explored in this study represent only a small fraction of the behavioral space available to the organism (Ahamed et al., 2021;Anderson and Perona, 2014;Brown and de Bivort, 2018;Schwarz et al., 2015). We anticipate that an extended supervised and unsupervised behavioral classification across

Growth conditions and starvation protocol
C. elegans worms were maintained on NGM agar plates, supplemented with E. coli OP50 bacteria as a food source. For behavioral tracking, we imaged single individuals grown in custom-made laser-cut multi-well plates. Each well (10mm diameter) was seeded with a specified amount of OP50 bacteria (10 uL of 1.5 OD) that was UV-killed before the experiment to prevent bacterial growth. For the starvation experiments, eggs were collected from isogenic populations using a standard bleaching protocol, into an agar plate without OP50 bacteria. Newly hatched L1 larvae were starved for a specified time-window (L1 arrest of 1, 3 or 4 days) before being transferred to the imaging multi-well plates. For tracking behavior without early L1 starvation, animals were monitored immediately after hatching in the multi-well plates. For post-starvation dopamine supplementation, 1000ug dopamine (Sigma) was added to 1 ml of OP50 solution.

C. elegans strains
Strains used in this study:

Imaging system
Longitudinal behavioral imaging was performed using custom-made imaging systems. Each imaging system consists of an array of six 12 MP USB3 cameras (Pointgrey, Flea3) and 35 mm high-resolution objectives (Edmund optics) mounted on optical construction rails (Thorlabs). Each camera images up to six wells, each containing an individual grown in isolation. Movies are captured at 3 fps with a spatial resolution of ∼9.5 um. For uniform illumination of the imaging plates we used identical LED backlights (Metaphase Technologies) and polarization sheets. To tightly control the environmental parameters during the experiment, imaging was conducted inside a custom-made environmental chamber in which temperature was controlled using a Peltier element (TE technologies, temperature fluctuations in the range of 22.5 ± 0.1°C). Humidity was held in the range of 50% +/− 5% with a sterile water reservoir and outside illumination was blocked, keeping the internal LED backlights as the only illumination source. Movies from the cameras were captured using commercial software (FlyCapture, Pointgrey) and saved on two computers (3 cameras per computer; each computer has at least 8-core Intel i7/i9 processor and 64 GB RAM).

Imaging data processing for extracting locomotion trajectory
To extract behavioral trajectories of animals across the experiment, captured movies were analyzed by custom-made script programmed in MATLAB (Mathworks, version 2019b) (Stern et al., 2017) . In each frame of the movie and for each behavioral arena, the worm is automatically detected as a moving object by background subtraction, and its XY position is logged (center of mass). In each experiment, 600,000-1,000,000 frames per individual are analyzed using

Behavioral parameters quantification
For each individual, we differentiate between roaming and dwelling states by averaging speed (μm/s) and angular velocity (absolute deg/s) over 10 seconds using a rolling time window, and generating a 2D probability distribution of these two behavioral parameters for all intervals in each time-bin along the experiment (50 X 50 bins distribution, speed bin size: 7.59 um/s, angular velocity bin size: 3.6 deg/s) (Stern et al., 2017). Drawing a diagonal through the probability distribution separated roaming and dwelling states, such that intervals in the distribution bins below the diagonal were classified as roaming intervals and intervals in bins above the diagonal were classified as dwelling intervals (Arous et al., 2009;Flavell et al., 2013;Stern et al., 2017). The behavior of each animal over time could be quantified as a sequence of roaming and dwelling intervals. The fraction of time spent roaming of the individual in a time bin represents the fraction of these intervals classified as roaming states within a given time bin. For each developmental stage, we examined the two-dimensional probability distribution of the whole population and changed the slope of the diagonal to classify roaming and dwelling appropriately (slopes: 5,2.5,2.3,2,1.5 for the L1,L2,L3,L4 and adult stages, respectively). Based on these roaming and dwelling classifications we further quantified the average instantaneous speed of the animal during roaming episodes (μm/s).

Ranking and behavioral bias
Individuals within the population were ranked based on their roaming behavior in 50 time bins (10 per stage), relative to the population measured within the same experiment. More explicitly, within each experiment, individuals were ranked in each time bin by the fraction of time within the bin spent roaming. Ties were resolved as fractional ranks ("1 2.5 2.5 4 ranking"). This produces a rank !,# for the th individual in the th time bin, between 1 and ! , where ! is the number of individuals Specifically, the variance which is maximized by the PCs is the weighted variance of the bias vectors, where ! is assigned the weight 1/ ! . In practice, this is achieved by computing the PCs as eigenvectors of the weighted covariance matrix.
Early principal components thus represent the temporal patterns of individual biases ! which account for the most variance in the rank sequences. Statistical significance of PCs was assessed by comparing the variances of PC scores generated from the real individual rank dataset to variances calculated from a randomly shuffled rank dataset (500 repetitions). This test identifies which PCs account for a higher fraction of variance than would be expected by chance in a population whose behavior has no underlying temporal correlations. Inter-individual variance in each PC score was calculated as a dispersal parameter of the population for each PC individuality type.
To quantify significant differences in PC score inter-individual variance between conditions, we used a permutation test where individuals in each pair of conditions were randomly reassigned to two populations of the same size. Significance values were computed from 1000 such reassignments for each pair of conditions. The test was repeated multiple times to verify the robustness of the analysis.

Quantification of individual consistency index
Individuals within the population were ranked based on their behavior in 50 time bins (10 per stage). We then quantified the homogeneous consistent bias in the individual's behavior relative to the population (Stern et al., 2017)