State dependency of behavioural traits is a function of the life stage in a holometabolous insect

State variables, such as body condition, are important predictors of behavioural traits. An individual's state could affect its average behavioural response, the costs and bene ﬁ ts associated with exhibiting the behaviour and the behavioural repeatability. However, how the state dependency of behavioural traits changes across life stages within the same individual is less well studied. Here, we manipulated the body condition, by starvation, in larvae and adults of a holometabolous insect, Athalia rosae . We assessed the effects of starvation on the behavioural traits of postcontact immobility (PCI) and activity levels and tested their repeatability. Our results show state dependency of behaviour, although the effect varied by life stage. Starved larvae exhibited shorter PCI duration and higher activity levels, whereas starved adults were less active than nonstarved individuals. Moreover, although most behavioural repeatability estimates were signi ﬁ cant in both life stages, we did not ﬁ nd any signi ﬁ cant effect of starvation on the estimates. Next, we calculated standardized effect sizes to compare starvation effects across life stages. We found that starvation had a larger and opposite effect in the larval stage than during the adult stage for all behavioural traits. Finally, we conducted microcosm and no-choice bioassay experiments to examine the bene ﬁ ts and costs, respectively, of the behaviour elicited by starvation in the larval stage. We observed that starved larvae located food faster than nonstarved larvae but were also attacked sooner by a predator, possibly due to their higher activity levels. Together, our results demonstrate that

State variables, such as body condition or nutritional status, are often important predictors of individual-specific behaviour (Sih et al., 2015). Depending on the state of an individual, the costs and benefits associated with different behavioural decisions can vary (Dingemanse & Wolf, 2010;Houston & McNamara, 1999;Luttbeg & Sih, 2010). This variation in state between individuals can then translate into between-individual differences in behavioural traits (Edmunds et al., 2021;Niemel€ a & Dingemanse, 2018). Moreover, the life stage at which an individual experiences a state could be an important determining factor for the expressed behaviour (Moran et al., 2021;R adai et al., 2022;Sherratt & Morand-Ferron, 2018). Even for the same state, different behavioural strategies may be adaptive depending on the life stage at which the state is experienced by an individual. This is particularly important for organisms that have complex life cycles or experience ontogenetic niche shifts (Cabrera et al., 2021;English & Barreaux, 2020;Stamps & Krishnan, 2017;Wilson & Krause, 2012).
Several models have been proposed regarding state-dependent behaviour. Some theoretical models predict that individuals in poorer body conditions (e.g. with lower energy reserves) will exhibit more aggression, boldness or higher activity levels because they have a greater 'need' of food and have relatively less to lose (Dall et al., 2004;Rands et al., 2003), while individuals in good condition may be more cautious, that is, shyer and less active, to protect what they have (the 'asset protection principle', Clark, 1994;Ludwig & Rowe, 1990). These are considered 'needs-based' explanations (Barclay et al., 2018). In contrast, individuals in good body condition (e.g. with higher energy reserves) may also be more active and bolder if their better nutritional state provides them with a higher survival chance even in risky situations, for example by being better at escaping predators, as postulated in the 'statedependent safety hypothesis' (Luttbeg & Sih, 2010;Moran et al., 2021). This offers an 'ability-based' explanation (Barclay et al., 2018). How valid these different models are may depend on the life stage, because selection pressures vary across ontogeny and can lead to life stage-specific behavioural strategies. For example, growth is important during the early phases of the juvenile stage in insects while during the later phases (preadult stage) trade-offs between investment in reproduction and growth can occur. In contrast, the adult stage in insects is primarily related to maintenance and reproduction but not growth. While an individual's state could affect its average behavioural response, it could also impact the behavioural repeatability or consistency (Luttbeg & Sih, 2010;MacGregor et al., 2021;Sih et al., 2015), even if effects overall may be weak (Niemel€ a & Dingemanse, 2018). Furthermore, there can be state-dependent feedback loops that can affect individual behavioural differences (Luttbeg & Sih, 2010;Sih et al., 2015), which in turn can impact ecological processes (Sih et al., 2012).
Usually, stressful conditions increase phenotypic variation and plasticity; thus, we may expect a decrease in behavioural repeatability under stress. One way of manipulating an individual's body condition or state is by exposing it to starvation, which usually depletes energy reserves (Arrese & Soulages, 2010). Starvation or food limitation is a ubiquitous stress faced by organisms in the wild with food availability varying temporally or/and spatially, and leading to effects on behaviour (Müller & Müller, 2017;Scharf, 2016), life history traits (Paul et al., 2022;Singh et al., 2020) or metabolism (Zhang et al., 2019). For example, the behavioural activity level can change in response to starvation, with some species showing increased activity, while others show a decrease and a few also show a hump-shaped response (i.e. an increase followed by a decrease; Scharf, 2016). However, how the response to starvation in activity levels changes across life stages within the same organism is less well studied.
Here, we investigated the effect of starvation on behavioural traits across ontogeny in the turnip sawfly, Athalia rosae (Hymenoptera: Tenthredinidae). Sawfly larvae feed on various Brassicaceae plants and pupate in the soil. The adults feed on floral nectar, usually from Apiaceae plants. During the larval stage, individuals can rapidly defoliate their host plants and hence experience periods of starvation (Riggert, 1939). Likewise, enclosing adults may not immediately have access to nectar, leading to periods of starvation. In the present study, we investigated postcontact immobility (PCI; Sendova-Franks et al., 2020) and activity levels in larvae and adults. PCI is a behavioural strategy following physical contact with the predator, in which the individual is immobile for some time. PCI is also known as postpredation immobility, tonic immobility, thanatosis or 'death-feigning' behaviour. PCI is proposed to function as an antipredator strategy by increasing survival chances (Farji-Brener et al., 2022;Humphreys & Ruxton, 2018;Rogers & Simpson, 2014;Skelhorn, 2018), and has often been used as a proxy for boldness or risk-taking behaviour in animals (Edelaar et al., 2012;Segovia et al., 2019;Tremmel & Müller, 2013). We also examined general activity during a defined observation period. The chosen behavioural traits of PCI and activity reveal ecologically relevant information about individuals regardless of their ontogenetic life stage and niche (Wilson & Krause, 2012).
We first investigated whether (1) the PCI duration and (2) activity levels varied in response to starvation duration (proxy for body condition, where longer periods of starvation are predicted to reduce body condition) in the larval or adult stage and assessed the effect of starvation on behavioural repeatability within these stages. Since calculated effect sizes demonstrated that the starvation effect was larger in the larval than in the adult stage, we next examined the potential benefits, that is, in food location, and costs, that is, in responses to predator attacks, of the behavioural strategy induced by larval starvation. We hypothesized that if the 'asset protection principle' holds in our study system, starvation would lead to increased activity levels and reduced PCI duration, while we would expect the reverse if the 'state-dependent safety hypothesis' holds. Moreover, we expected that larvae would be affected more acutely by starvation than adults, as foraging and food consumption is the major activity in larvae. We also expected starved individuals to show lower repeatability than control individuals as stressful conditions usually increase phenotypic variation (Scharf, 2016). Lastly, we expected increased activity levels due to larval starvation to lead to increased foraging success, but also to have costs in terms of increased predation.

Experimental Sawflies
Sawflies for this study were derived from a laboratory stock population, which has been established from A. rosae adults collected in the surroundings of Bielefeld, Germany. The stock is supplemented annually with field-caught insects. The sawflies were maintained in mesh cages (60 Â 60 Â 60 cm) in a laboratory with a 16:8 h light:dark cycle, approximately 60% relative humidity and at room temperature (15e25 C). Several adult females and males were released in a cage with plants of Sinapis alba (Brassicaceae) for oviposition, leading to both unfertilized and fertilized eggs, resulting in male and female offspring, respectively, as A. rosae is haplodiploid. After 6e7 days, the emerging larvae were reared on nonflowering plants of Brassica rapa var. pekinensis (Brassicaceae). The S. alba and B. rapa plants were grown from seeds in a climate chamber (20 C, 16:8 h light:dark, 70%relative humidity) and greenhouse (!20 C, 16:8 h light:dark, 70% relative humidity), respectively. There were minor variations in cage set-up for different experiments as detailed below.

PCI assay
Approximately 40 unmated females were put in a single cage for 24 h for oviposition. Females were then transferred to another cage and allowed to oviposit for another 24 h. Only unmated females were used in this experiment, as PCI may differ between the sexes (Miyatake, 2001) and virginity ensured that all eggs laid were unfertilized and resulted in male larvae. Twenty days after cage setup, larvae (fourth to fifth instar) were collected from each cage and put individually into petri dishes (5.5 cm diameter) lined with moist filter paper (moistened with tap water). Each larva was weighed (Sartorius ME36S balance) initially (pretreatment body mass) and randomly assigned to one treatment, control or starved, and again weighed at the end of the treatment after 4 h (posttreatment body mass) to confirm that starved larvae lost more body mass than control larvae using a Welch t test (t 44.12 ¼ 8.80, P < 0.001; Appendix Fig. A1). We used larval mass as a measure of size since accurate linear measurements are difficult in larvae (as they curl up on handling and are stretched to a variable degree when feeding). Consequently, we also did not calculate body massto-size ratios as a measure of body condition, but rather used our starvation treatment for manipulating body condition, where longer periods of starvation are predicted to reduce body condition. Preliminary studies had shown that a 4 h starvation period affects behaviour without causing larval mortality. It also allowed us to take multiple behavioural measurements at regular intervals of 1 h to calculate repeatability within a larval instar. In the starvation treatment, the larvae had no access to B. rapa, while the control treatment larvae received B. rapa leaf discs ad libitum over the 4 h period. To induce PCI, a larva was grasped from the middle of the body using forceps and dropped from a height of 2 cm onto a petri dish. This handling with forceps was used to mimic a predation attack and induce PCI. If in the first trial the larva did not show PCI, the forceps stimulation was repeated once or twice until a PCI was recorded. A larva was considered as exhibiting PCI if it curled up its body tightly and stayed immobile in this posture for at least 1 s. The PCI duration was measured from the time the larva entered the PCI posture until it uncurled its body and moved at least 1 mm. Each larva was observed for a maximum of 10 min. The PCI duration was measured repeatedly once every hour over 4 h. The sample sizes for larvae of the starvation and control treatment were 25 and 24, respectively.

Activity Levels Assay
Adult female and male sawflies were set up in a single cage for 24 h for oviposition. Twenty days later, we collected 30 larvae (fourth to fifth instar) and randomly assigned them to a starvation or control treatment (N ¼ 15 for each treatment). Larvae were weighed before the experiment (pretreatment body mass) and put in individual petri dishes lined with moist filter paper. Similar to above, larvae in the starvation treatment had no access to B. rapa, while the control treatment larvae received B. rapa leaf discs ad libitum. The activity level of each larva was measured after 2 h and 4 h of initiating the treatment. To measure their activity levels, larvae were moved individually to empty petri dishes, and their behaviour was recorded and tracked for 10 min using Noldus Ethovision V7 (Wageningen, Netherlands; centre-point tracked at 1.92 samples/s). We recorded distance moved and immobility duration (time spent immobile) for each individual. Six individuals were recorded simultaneously in one trial using a single overhead camera. We limited the observation period to 10 min as a longer duration could have led to starvation effects in larvae of the control treatment.

Adult Behavioural Traits: PCI and Activity Levels Assay
Freshly enclosed adults were collected from the laboratory stock population daily over several days. We determined the sex of the adults and randomly assigned them to a starvation or control treatment, after which each individual was weighed (Sartorius CPA224S-OCE balance; pretreatment body mass) and then put in an individual petri dish lined with moist filter paper. Starved and control individuals received water only or a 2% (v/v) honeyewater solution, respectively, on tissue paper, which was replenished every second day. Two and 4 days after eclosion, we measured the PCI duration and activity levels of each individual. To measure the PCI duration, an individual was grasped from the middle of the body using forceps, held for 5 s and then placed in the petri dish head first. An adult was considered as exhibiting PCI if it curled up and remained immobile for at least 1 s. Each adult was observed for a maximum of 8 min. The PCI duration was counted until the adult stood upright on its legs. Thirty minutes after the start of the PCI assay, individuals were put in empty petri dishes and their behaviour was recorded and tracked using Noldus Ethovision V7 (settings similar to above) for 1 h. We recorded distance moved and immobility duration (time spent immobile) for each individual. For females, the sample size was 30 for each treatment for PCI and activity parameters. For males, the PCI sample sizes for starvation and control treatments were 29 and 27, respectively. For the activity parameters, the sample size was 27 males for each treatment as we lost two individuals that escaped after the second PCI measurement.

Microcosm Experiment to Examine Effect of Larval Starvation on Locating Food
Larvae (ca. 14 days old, fourth to fifth instar) were collected from the cage set-up for the larval activity levels assay and randomly assigned to the starvation or control treatment, performed as described above (PCI assay). Each larva was kept individually in a petri dish lined with moist filter paper for the treatment duration of 4 h. A cage (50 Â 50 Â 50 cm) was set up with eight petri dishes placed at equidistant locations from the centre. Each petri dish had a B. rapa leaf disc (2.5 cm in diameter) and was covered with white paper to prevent visual detection. To decrease directionality of olfactory cues that larvae may use to locate leaves, we placed four B. rapa plants around the cage. We aimed to remove/reduce visual and olfactory cues of the leaves in petri dishes, which may lead to the larvae moving towards a leaf directly rather than coming across the leaf due to their higher activity levels. Eight larvae of the same treatment were put in a petri dish without filter paper or leaves, and placed in the centre of the cage, and this was considered as one trial. Each trial lasted for 15 min. The time to reach a leaf for a larva (if it did) and the number of leaves occupied by larva/larvae at the end of each trial were recorded. Eight trials were conducted, with the larval treatment alternated with every trial (four trials per treatment). New leaf discs were placed in the petri dishes after every trial.

No-Choice Bioassays to Assess Effect of Larval Starvation on Predation
We used 11 fourth-instar individuals (length ca. 4 cm) of Hierodula membranacea (Mantidae) as potential predators (purchased from www.mantidenundmehr.de). The mantids were reared in individual cages (8 Â 8 cm and 6 cm high) in a climate chamber (approximately 25 C) on a diet of Drosophila melanogaster and/or Drosophila hydei; they had not been exposed to A. rosae before the experiment. All mantids were starved for 48 h before the experiment. For the experiment, we collected similar-sized larvae of A. rosae from a laboratory culture cage (set-up with male and female adults), and randomly assigned them to either starvation or control treatment, performed as described above (PCI assay). Each larva was kept individually in a petri dish lined with moist filter paper for the treatment duration. After 4 h of treatment, we weighed each larva (post-treatment body mass, range 41.1e75.5 mg). Then, the no-choice bioassay was performed in a container (20 Â 20 Â 20 cm) that was covered with white paper on all sides to avoid any visual distractions to the mantid and larva. First the larva and then the mantid were added to the container at fixed positions facing each other. The larva was added to the container in a clean petri dish without a lid, while the mantid was added on a meshed lid to the container. This allowed us to position the mantid ensuring that it faced the A. rosae larva without touching it. If the larva showed PCI behaviour and curled up after being put in the container, we waited until the larva had uncurled before we added the mantid. We recorded the latency to attack by the mantid. We expected that the mantids would attack the starved larvae more rapidly than control larvae, because starved larvae show higher activity levels making them more readily detectable by the mantids. During mantid attacks, we noticed that larvae showed 'easy bleeding' (Müller & Brakefield, 2003), exuding haemolymph under mechanical stress, which acts as a potential antipredator mechanism (Boev e & Müller, 2005). We noted down whether the larva showed 'easy bleeding', although we did not have any specific a priori hypothesis regarding this behaviour. After the attack, we gently removed the larva from the mantid's grasp using forceps (if it had not dropped the larva itself) to ensure that the mantid remained hungry and to avoid any repercussions of consuming larvae, which contain glucosinolates sequestered from their host plants in their haemolymph (Müller et al., 2001). As the mantid would often wipe its mouth to remove the haemolymph (similar behaviour has been described for lizards after attacking A. rosae larvae, Vlieger et al., 2004), it was easy to remove the larva. All assayed mantids were exposed to both treatment larvae, but in different treatment order of either starvation or control treatment larvae first. Data from one mantid, which had recently moulted, was excluded as it did not attack any larva.

Statistical Analyses
All analyses were done in R version 4.0.4 (R Core Team, 2021). We included body mass for each analysis because body mass or size may have an effect on behavioural traits (Farkas, 2016;Hozumi & Miyatake, 2005). In our experiments, we assumed that starvation would lead to changes in state or body condition of an individual, such as changes in the fat reserves resulting in body mass loss, and thus impact the behaviour. Variables were appropriately transformed to improve the distribution of model residuals. For the larval PCI assay, the effect of the treatment (Starvation or Control), time (1, 2, 3 or 4 h) and their interaction on log-transformed PCI duration were assessed using linear mixed models (LMM; package 'lme4' version 1.1-30, package 'lmerTest' version 3.1-3; Bates et al., 2015;Kuznetsova et al., 2017), with pretreatment body mass as covariate and individual identity as a random effect. As some PCI duration data points were zero, that is, for individuals that did not show PCI, we added 1 to all data points before log transformation to avoid nonfinite values. Note that all conclusions remained unchanged if cage was included as a factor (data not shown). For the larval activity assay, we examined the effect of treatment, time (2 or 4 h) and their interaction on distance moved and immobility duration using LMM, with pretreatment body mass as covariate and individual identity as well as trial identity as random effects. For adult behavioural traits, we examined the effects of sex, treatment, time (day 2 or 4) and the interaction between treatment and time on PCI duration, distance moved and immobility duration using LMM, with pretreatment body mass as covariate and individual identity as a random effect. Trial identity was also included as a random effect for distance moved and immobility duration. For the larval microcosm experiment, we examined whether treatment had an effect on whether any leaf was reached using a binomial generalized linear mixed-effects model (GLMM), with trial identity as a random effect. We did not analyse the timing to reach a leaf or number of leaves occupied as very few control larvae had reached any leaf at the end of the trial (see below and Appendix Fig. A2). For the larval no-choice predation bioassay, we examined the effect of treatment on latency to attack (log-transformed) using an LMM, with standardized larval post-treatment body mass (measured at 4 h) as covariate and mantid identity as well as treatment order as random effects. As we expected treatment to influence the posttreatment body mass of larvae (with starved larvae being lighter, see Appendix Fig. A1), we standardized the larval body mass by subtracting the mean treatment body mass and dividing by the standard deviation for that treatment body mass (i.e. [larval body massÀ mean treatment body mass]/standard deviation of treatment body mass). When interaction terms were nonsignificant, we dropped them to test the significance of the lower-order terms. The post hoc analyses were conducted using the package 'multcomp' version 1.4-17 (Hothorn et al., 2008).

Effect of starvation on behavioural consistency of individuals
We calculated the adjusted repeatability estimates (with time as fixed effect; Nakagawa & Schielzeth, 2010) and associated confidence intervals (95% using parametric bootstrapping, N ¼ 1000) for the behavioural traits (PCI duration, distance moved and immobility duration) separately for control and starved individuals for larvae, adult males and adult females ('rptR' package version 0.9.22, Stoffel et al., 2017). Likelihood ratio tests were used for significance testing of repeatability estimates. The traits were transformed as in the statistical analysis described above. The repeatability estimates allow us to quantify consistency in individual behaviour using individual identity for partitioning observed variance. The parametric bootstrapping of the 'rptR' package simulates new data using the estimates from the original model and experimental design, and then calculates the repeatability of the simulated data. In that way, we obtained 1000 repeatability estimates for both starved and control treatments for each behavioural trait. To test whether the repeatability estimates differed significantly between starved and control treatments for each trait, we calculated the difference between the repeatability estimates of starved and control treatments (subtracting the smaller from the larger estimate) based on parametric bootstrapping samples. We then examined what proportion of these differences was lower than zero and calculated the asymptotic two-tailed P value as twice this proportion.

Effects sizes
To facilitate life stage comparisons of any starvation effect, we calculated the standardized effect size Glass's delta and its confidence intervals using the 'effectsize' package v. 0.4.5 (Ben-Shachar et al., 2020). The Glass's delta effect size is calculated as the standardized difference between the means of the control and treatment groups, over the standard deviation of the control group. We calculated the effect size for each behavioural trait for larvae, adult females and adult males.

Ethical Note
This study complies with the current laws of Germany on the use of invertebrates in research and adheres to the ASAB/ABS Guidelines for the Use of Animals in Research.

PCI Duration and Activity in Larvae
There was a significant interaction effect of treatment and the time point on PCI duration (c 1 2 ¼ 10.78, P ¼ 0.001; Fig. 1a), such that PCI duration decreased with time for starved larvae: they had a much shorter PCI duration than control larvae at 3 h and 4 h of treatment. There was no significant effect of pretreatment body mass (c 1 2 ¼ 1.63, P ¼ 0.201).
There was a significant interaction effect of treatment and the time point on distance moved (c 1 2 ¼ 4.71, P ¼ 0.029; Fig. 1b), but no significant effect of pretreatment body mass (c 1 2 ¼ 2.31, P ¼ 0.127).
Starved larvae moved significantly longer distances than control larvae. Additionally, the distance larvae moved increased with time in the starvation treatment but not in the control (Appendix Table A1). Similar to the distance moved, there was a significant interaction effect of treatment and the time point on immobility duration (c 1 2 ¼ 9.77, P ¼ 0.001; Fig. 1c), but also a significantly positive effect of pretreatment body mass (c 1 2 ¼ 4.03, P ¼ 0.044).
Control larvae were immobile for a significantly longer duration than starved larvae. Moreover, the immobility duration decreased with time for larvae in the starvation treatment but not for control larvae (Appendix Table A1).

PCI Duration and Activity in Adults
There was no significant effect of pretreatment body mass, sex, treatment, time or the interaction between treatment and time on PCI duration in adults (Fig. 2a, d, Appendix Table A2). For distance moved, there was a significant effect of treatment (c 1 2 ¼ 9.43, P ¼ 0.002) and sex (c 1 2 ¼ 5.98, P ¼ 0.014), with starved individuals and males moving a shorter distance (Fig. 2b, e; Appendix Table A2). Similarly, there was a significant effect of treatment (c 1 2 ¼ 9.51, P ¼ 0.002) and sex (c 1 2 ¼ 10.15, P ¼ 0.001) on immobility duration, with starved individuals and males being immobile for longer durations (Fig. 2c, f, Appendix Table A2).

Effect of Starvation on Repeatability Estimates
Significant repeatability estimates were found for nearly all behavioural traits except for PCI duration in adult females and control treatment larvae (Table 1). While there was a non trend for higher repeatability estimates for individuals in the starvation treatment for all behavioural traits of larvae and for PCI in adult males and females, this was not statistically significant (P > 0.05; Table 1). In contrast, for distance moved and immobility duration, control treatment individuals had a higher repeatability in adults for both sexes, but this was not statistically different from adults in the starvation treatment (P > 0.05; Table 1).

Effect Sizes in Relation to Life Stage
For all behavioural traits, starvation had a larger effect during the larval stage than during the adult stage in our experiments as evident by the larger Glass's delta effect size (Fig. 3a). Moreover, the direction of effect changed, as starvation during the larval stage led to more active individuals, while starvation during the adult stage generally led to less active individuals.

Effect of Larval State on Foraging Success and Risk of Predation
Treatment had a significant effect on the probability of larvae reaching leaves (c 1 2 ¼ 11.71, P < 0.001), i.e. foraging success, with 18 (56%) starved larvae reaching leaves at the end of the trials compared to only one (3%) control larva (Fig. 3b, also see Appendix Fig. A2). Besides one mantid that refrained from launching any attack, all larvae were attacked by mantid predators and showed 'easy bleeding' (see Supplementary material). The latency to attack by a mantid was significantly affected by larval treatment (c 1 2 ¼ 8.45, P ¼ 0.003) but not by larval post-treatment body mass (c 1 2 ¼ 0.07, P ¼ 0.788), with starved larvae being attacked sooner than control larvae (Fig. 3c).

DISCUSSION
An effect of state variables, such as body condition, on behavioural traits of an individual has been widely documented (R adai et al., 2022;Scharf, 2016), but empirical evidence for how such effects may vary with life stage is sparse. Our study increases our understanding of ontogenetic effects on state dependency of behaviour, and the adaptive value of different behavioural strategies across life stages in a holometabolous insect. In our study we used starvation to manipulate the body condition of larvae and adults in A. rosae. Starved larvae showed a shorter PCI duration and higher activity levels than control larvae. This is in line with the 'asset protection principle', which predicts that individuals in poor condition exhibit higher risk-taking behaviour and/or activity than individuals in good condition (Catano et al., 2016;Kuczynski et al., 2016;Naman et al., 2019), based on their need to reach a better state (Barclay et al., 2018). A short PCI duration and higher activity levels may be adaptive and allow starved larvae to disperse and locate food more rapidly. In line with this assumption, our microcosm experiment showed that starved larvae dispersed more and located food more rapidly than control larvae (also see Appendix Fig. A2). Starvation usually leads to an increase in dispersal, when the benefits of foraging are higher than potential costs of exploring (Scharf, 2016). For example, a recent study with multiple nematode species and a natural nematode community showed that availability of food is an important driver of dispersal, with dispersal of nematodes increasing when food availability was limited (Kreuzinger-Janik et al., 2022).
However, rapid food location and increased foraging can also impose costs, such as higher predation risk (Scharf, 2016). A faster attack could occur if the starved larvae either came in close contact with the mantid more often and/or were noticed sooner by the mantid, potentially due to their higher activity, than the control larvae. In line with this, mantids had a shorter latency to attack starved larvae than control larvae. Similarly, in the Texas rat snake, Elaphe obsoleta, increased activity and movement have been found to be associated with higher mortality in both sexes (Sperry & Weatherhead, 2009). While we did not allow the mantid to consume the larvae, mantids may have also rejected larvae in the long term due to the 'easy bleeding' that the larvae showed in our study in response to the initial attack (see Supplementary material). As with other species, such as the ladybird Harmonia axyridis that display comparable reflex bleeding in response to predation events regardless of their starvation state (Knapp et al., 2020), all larvae (starved or control) in our study responded similarly to predation suggesting this is an important defence mechanism.
In contrast to larvae, starved A. rosae adults exhibited lower activity levels than control treatment adults. Lower activity in  starved individuals is in agreement with the 'state dependent safety hypothesis', which assumes that food-deprived individuals may be less active and less prone to take risks as the costs of risky behaviour are higher than for individuals in good condition (Moran et al., 2021). Given their state, lower activity levels may allow starved individuals to conserve energy for other behaviours, such as mating. Such decreased activity levels in response to starvation have been shown in some insects like the European earwig, Forficula auricularia (Weiß et al., 2014), two-spotted spider mite, Tetranychus urticae (Le Goff et al., 2012) and speckled cockroach, Nauphoeta cinerea (Reynierse et al., 1972), although such patterns do not seem to be particularly widespread (Scharf, 2016). Moreover, females were significantly more active than males. An equivalent sex-specific activity pattern has been found in the leaf beetle Phaedon cochleariae (Müller & Müller, 2015). Such higher activity in females has been suggested to be related to the need to find oviposition sites (Müller & Müller, 2015). Sex-specific differences in behaviour have been shown in multiple species (Tarka et al., 2018), although the direction can vary between species and also depends on the behaviour in consideration. While some A. rosae adults exhibited PCI (Fig. 2a, d), there was no significant effect of any variable on PCI duration. It is possible that adults may rely on other antipredator strategies, such as chemical defences using clerodanoids , rather than exclusively on PCI. Moreover, adults can also simply fly away, while larvae are less mobile. To our knowledge, thanatosis behaviour has previously been described in adults of only one other sawfly species, Perreyia flavipes (Neves & Pie, 2018). While most repeatability estimates were significant for the behavioural traits in both life stages of A. rosae in the present study, we did not find any significant effect of starvation on repeatability estimates. In the harvestman Mischonyx cuspidatus, individuals that were sated showed a higher repeatability in boldness levels compared to individuals from food-deprived conditions, when death-feigning duration was used as a proxy for boldness (Segovia et al., 2019). In contrast, in the black widow spider, Latrodectus hesperus, individuals reared on a restricted diet showed repeatability for all behavioural traits examined, while individuals on an ad libitum diet exhibited repeatability only for aggression (DiRienzo & Montiglio, 2016). Thus, food deprivation can alter the repeatability of behavioural traits, although the effect can depend on the trait and species under consideration. We saw contrasting trends of higher repeatability for starved individuals compared to control individuals during the larval stage, and vice versa in the adult stage, although these differences in repeatability estimates between treatments were not significant. Future studies should examine whether behavioural repeatability is impacted differently by stress depending on the life stage at which it is experienced.
Our results showed a large and opposite effect of starvation on behavioural traits of larvae compared to adults, with starved larvae showing a decreased PCI duration and increased activity levels while starved adults showed decreased activity levels. In contrast, in two hemimetabolous tick species the duration of PCI decreased with starvation across life stages (Oyen et al., 2021). Similar to our results, a recent meta-analysis revealed that the effect of poor nutrition on risk-taking behaviour could depend on life stage, with juveniles showing stronger responses and higher risk-taking behaviour in low-nutrition conditions while the effect on adults was less unequivocal (Moran et al., 2021). Life stage-specific effects on behaviour have been documented in previous studies (Polverino et al., 2016;R adai et al., 2022), although few studies have documented such effects in holometabolous insects which occupy distinct niches in the juvenile and adult stages. The need to adjust to conditions of lower food availability may lead to individualized niche conformance (as defined in Müller et al., 2020).
In holometabolous insects, the uptake of food during the early phases of the larval stage primarily determines adult body mass and may also determine the energy reserves available, while adults usually do not grow (Hanna et al., 2022). In the butterfly Speyeria mormonia, larval rather than adult food restriction has been shown to impact adult survivorship (Boggs & Freeman, 2005). Thus, feeding during the larval stage is critical and this may explain why starvation had a much larger effect on behaviours, such as activity levels, in the larval rather than the adult stage in our study. Intensive foraging allows larvae to gain body mass and reach the adult stage rapidly, while starvation can lead to a prolonged development (Paul et al., 2022). For starved larvae, increasing activity levels may allow them to forage successfully and locate food even though it may be risky (Scharf, 2016). In contrast, for starved adults, higher activity levels may deplete their already limited energy reserves and, hence, reduce their opportunities for energycostly tasks like mating and oviposition. Moreover, individuals in larval or juvenile stages may need to invest more in foraging as their mass-specific metabolic requirements may be higher (Brown & Braithwaite, 2004). In our experiment, activity levels of larvae may have been measured under more realistic conditions than those of the adults which can fly, although we compared control and starved treatments within each life stage and not across life stages. Our results demonstrate that, depending on the life stage of an individual, the state dependency of behaviour can vary and even show contrasting effects. Moreover, the adaptive value of behavioural strategies appears to be life stage specific for foraging but can also be costly in terms of predation risk.

Declaration of Interest
None. Change in mass (mg) t 44.12 = 8.80, P < 0.001 Figure A1. Effect of starvation on change in body mass for larvae of Athalia rosae. The box plots show the median and 25th and 75th percentiles; the whiskers indicate the values within 1.5 times the interquartile range and the circles are individual data points.

Table A1
Results of post hoc analyses (Tukey's HSD, a ¼ 0.05), obtained using the package 'multcomp', for distance moved and immobility duration of Athalia rosae larvae