Adaptive foraging behaviour increases vulnerability to climate change

: 16 Adaptative foraging behavior should promote species coexistence and biodiversity under climate 17 change as predators are expected to maximize their energy intake, according to principles of optimal 18 foraging theory. We test these assumptions using a dataset comprising 22,185 stomach contents of 19 fish species across functional groups, feeding strategies, and prey availability in the environment over 20 12 years. Our results show that foraging shifts from trait-dependent prey selectivity to density 21 dependence in warmer and more productive environments. This behavioral change leads to lower 22 consumption efficiency as species shift away from their optimal trophic niche, undermining species 23 persistence and biodiversity. By integrating this adaptive foraging behavior into dynamic models, our 24 study reveals higher risk profiles for ecosystems under global warming.


Introduction
Our ecosystems are experiencing abrupt changes in climatic conditions, making it evermore important to predict and understand how they will respond to future changes. It is now well documented that global warming will affect various levels of biological organisation; from physiological processes occurring at the individual level (Dell et al. 2011, Seebacher et al. 2015 to patterns at macroecological scales (Yvon-Durocher et al. 2010, Free et al. 2019. In ecosystems, the effects of an increase in temperature will cascade through these different levels, resulting in a change in species composition (Lenoir et al. 2020) as well as community and food web structures (Weinbach et al. 2017, O'Gorman et al. 2019, Gibert 2019. By scaling up temperature effects from species physiology to food web structure (Petchey et al. 2010), trophic interactions play a key role in the response of ecosystems to global warming (ref). Thus, we need accurate descriptions of how warming changes species' interactions to predict how ecosystems will respond to rising temperatures (Binzer et al. 2016, Gauzens et al. 2020 To assess the future of ecological communities, mechanistic models that build on biological processes observed at the level of individual organisms can be used to translate mechanisms and predictions to the ecosystem level. Allometric trophic networks (Martinez 2020, Brose et al 2006 or size spectra models (Law et al. 2009, Blanchard et al. 2017) use the allometric theory that describes the biological rates of species using body mass and temperature to quantify interspecific interaction strength in food webs and describe species biomass changes over time and environmental conditions (Binzer et al. 2016, Martinez 2020. Allometric trophic network models were able to successfully predict the population dynamics of communities (Boit et al. 2012, Curtsdotter et al. 2019. Predictive models have also provided a better understanding of how physiological responses to temperature translate into structuring rules for species coexistence and community persistence (Binzer et al. 2016). Paradoxically, however, their ability to derive sound predictions for large communities under changing environmental conditionssupposed to be their main advantage over phenomenological forecasting models -has recently been challenged, stressing the need for more biological realism (Gauzens et al. 2020, Sauve and Barraquand 2020).
Indeed, a strong limitation of these models is that species are abstracted based on a set of biological rates that respond to temperature, such as metabolic or attack rates (Rall et al. 2012, Gilbert et al. 2014, Bideault et al. 2021. Therefore, species responses to temperature are limited to the physiological part, whereas the behavioural component is ignored. However, species do respond to changes in their environment (Sentis et al. 2017, Abram et al. 2017. Over more than two decades, it has been shown that species adaptive behaviour is a key variable in supporting species coexistence (Abrams and Matsuda 1993, Abrams 1996, Valdovinos et al. 2010. At the community level, adaptive behaviour of consumers can reverse the classical negative complexitystability relationships into a positive one (Kondoh 2003(Kondoh , 2006. These findings strongly suggest that species' behavioural responses should be incorporated into food web models.
At high temperature, the energetic demand of organisms increases, and various strategies can allow species to cope with this stress and increase their energetic intake. For example, species can actively forage on energetically more rewarding resources to balance the increased energy demand (Lemoine et al. 2013, Sentis et al. 2014). These prey are typically close to the maximum body mass that consumers can feed on (Portalier et al. 2019), and therefore we would expect that a temperature increase would increase a predator's consumption of larger prey (i.e. trait-based selectivity), leading to a decrease in predator-prey body-mas ratios (hypothesis 1). However, a strategy that maximizes energetic gain from each consumption event by a strong selection of prey traits likely implies an increase in foraging time, increasing a consumer's vulnerability to predators (Ho et al. 2019), and increased energetic costs due to a higher search time (Pyke et al. 1977). An alternative hypothesis would be that individuals under high energetic stress will be less likely to forsake less rewarding prey upon encounter (hypothesis 2). This strategy would lead to a lower trait-based selectivity, and a trophic niche driven more by neutral processes (i.e. random encounter probability), leading consumers to more heavily forage on smaller prey that are usually more abundant (ref). Moreover, the effect of temperature on prey selection by consumer species could be mediated by ecosystem productivity. When resources are plentiful, species should experience a reduced energetic stress (Binzer et al. 2012(Binzer et al. , 2016, decreasing their need to adapt their behaviour. The two proposed hypotheses would lead to contrasting effects on communities. Trait-based selectivity (hypothesis 1) may increase the strength of consumer interactions with a limited set of prey, depleting their biomass. Alternatively, if neutral processes are driving selectivity (hypothesis 2), consumers will mostly forage on more abundant species, leading to a stronger control of their biomass that could prevent competitive exclusion and therefore enhance species coexistence (Kondoh 2006, Gauzens et al. 2016).
Here, we document how consumer foraging behaviour responds to changes in temperature and productivity using an allometric approach that can be integrated into mechanistic ecological models. To this end, we have compiled a database containing stomach content analyses of 22,185 individuals of 6 fish species from the western Baltic Sea. These 6 fish species belong to two functional groups differing in body shape and foraging behaviour (flat, sit-and-wait predators and fusiform active hunters). The dataset contains information on the body mass and species identity of each predator individual and the prey found in its stomach contents, as well as abundance and body mass estimates of prey from the environment. The sampling occurred over 11 years (1968)(1969)(1970)(1971)(1972)(1973)(1974)(1975)(1976)(1977)(1978) and spans a temperature gradient from 3 °C to 15 °C. We fit diet adaptation models to the data in order to test our hypotheses. Subsequently, we integrated this adaptive behaviour into a mechanistic model predicting the dynamics and coexistence of species depending on temperature and ecosystem productivity. We show that integrating species behavioural responses to temperature into a predictive model alters classical predictions made without them and predicts that more species will go extinct with temperature rise than previously thought.

Response of fish to temperature and productivity gradients
To assess how fish respond to temperature and productivity, we used a subset of the database for which we (i) could relate information on the body-mass distribution of prey in fish stomachs to that in the fish's environment and (ii) had a good estimate of the body mass of prey found in the fish stomachs (see Methods). The first filter reduced the number of fish individuals to 2487. As our approach is based on allometry (i.e. the relationship between body size, physiology and behaviour), we aggregated all fish of the same species with similar body masses that were occurring at the same point in space and time into size groups (see Methods), which resulted in a dataset of 290 size-group data points. We then used skew normal distributions to fit the prey body mass distributions observed in fish stomachs (hereafter called the realised distribution) and in the corresponding environment (hereafter called the environmental distribution) (Fig. 1). The environmental distribution defines the neutral processes involved in fish diet: it represents the expected body mass distribution of prey in fish stomachs if consumption was driven by densitybased encounter rates only. However, these two distributions are usually not identical, because consumers actively select prey with specific body masses. We used the ratio of realised and environmental distributions to calculate fish selectivity with respect to these different prey body masses to obtain a preference distribution (see fig. 1, Methods). This preference distribution describes consumer selectivity based on traits (i.e. the prey body masses that allow an interaction) and consumer behavioural decisions. representing the distribution of prey body mass in the ecosystem, realised distribution (dashed red) representing the body mass of the prey in a consumer stomach, and preference distribution (blue) that represents the selectivity of a consumer towards a specific body mass. a) All of the log prey body mass classes are equally represented. In that case, the distribution of prey body masses observed in a consumer's gut represents the body masses on which it actively foraged (its preference distribution). In that case, predation is driven by trait selectivity only (hypothesis 1). b) The body mass distribution of the prey observed in the gut and in the environment are equivalent. This means that the prey consumed by the predator were entirely driven by encounter probabilities (i.e. a neutral process), implying no active selectivity over specific size classes (hypothesis 2). Panels a) and b) represent extreme scenarios while real world data are more likely to be described by two different distributions, as in c). In c), the body mass distribution of prey observed in the stomach and in the environment differs. This means that the consumer specifically forages on some prey body masses that are represented by the preference distribution. High values in the preference distribution represent body masses that are over-represented in fish's stomachs in comparison to what is available in the environment.
We first considered how the body mass distributions in consumer stomachs were changing with environmental conditions (temperature and productivity) using a linear model to predict the median of the realised distribution. Predator body mass, ecosystem productivity, and temperature were used as predictor variables along with all possible interactions. Ecosystem productivity was estimated through the total biomass of prey in the environment (log10-transformed). Further, we ran two series of models where fish species or fish shape (flat fish versus fusiforms) were used as covariates. In both cases, all the possible interactions with the other covariates were investigated.
We then selected the most parsimonious model based on AIC. In cases of a significant interaction between temperature and productivity, we presented the effect of temperature at two different levels of productivity that correspond to the two modes of the distribution of environmental productivity (SI II). In all cases, the models including fish shape instead of fish species were more parsimonious, supporting the relevance of grouping species by shape. As expected (Tsai et al. 2016, Brose et al. 2019, we observed that the median of prey body mass increased with predator body mass (Fig. 2a, b, Table 1). Fig. 2: Response of the median body mass of the realised prey body mass distribution to predator body mass (a, b), temperature (c, d) at different productivity levels for the two fish shape. Points represent data and lines present model predictions. The shaded areas show the 95% confidence interval on the predicted values. Colors represent the fish functional groups (flat versus fusiforms).
The effect of temperature depended on environmental productivity: the body mass of prey consumed increased with temperature at low environmental productivity, but tended to decrease at higher productivity (Fig 2c, d , Table 1). Interestingly, the response of prey body mass was the same for the two different predator body shapes and foraging strategies.
These effects alone are insufficient to describe a change in fish behaviour as the distribution of prey body mass also changes along environmental gradients (SI II). To disentangle the effect of prey availability (neutral processes) from the fish behavioural response, we estimated the niche distribution as the ratio between the realised distribution and the environment distribution (see Methods).
We analysed the response of this fish preference distribution in the same way as for the realised distribution. Our results confirm the importance of species traits for structuring trophic interactions, as larger fishes are foraging on larger prey (Fig. 3a). They also emphasize that ecosystem productivity alters the temperaturedependence of fish foraging behaviour ( Fig. 3b. We did not detect any interaction between fish shape and other covariates, suggesting that the behavioural responses to temperature and productivity are similar for fish species with different body shape and foraging strategies. We observed a significant interaction between temperature and productivity ( Table 2). The temperature effect was significant only above a productivity >10 2.52 (SI III). It means that we were able to detect an adaptation of fish behaviour only above this threshold of productivity, indicating that fish tend to adapt their behaviour and forage on smaller prey only when there are enough resources to do so. However, when more resources are available, these consumers have the ability to respond to temperature as their behaviour was potentially less constrained in comparison to low productive environments. Therefore, our results support our hypothesis 2 posing that when the energetic stress increases, fish tend to become less selective in order to not miss a foraging opportunity. This strategy of opportunistic feeding comes with several drawbacks for consumers, who may miss larger and more rewarding resources while handling smaller prey. If consumers did not miss these prey, we would observe an increase in the width of their trophic niche with warming, as they would still consume large prey while also foraging more on smaller ones. However, we observed a very weak and negative temperature effect on the width of consumers, trophic niches (SI IV). This suggests that the increased consumption of smaller prey happens at the cost of missing larger prey that can be of utmost importance to satisfy the energetic balance of consumer species (Brose 2010). Moreover, consuming outside of the most efficient predator-prey body mass ratio is, in general, associated with a lower energy flux through food webs, which may limit the coexistence of consumer species (Brose 2010, Guzman andSrivastava 2019). This indirect effect of temperature on predator-prey body mass ratios is likely to strengthen the direct physiological effects, such as metabolic rates increasing faster than feeding rates with temperature. This combination of direct and indirect effects of warming could increase the likelihood of extinction for top predators in food webs (Petchey et al. 1999, Vucic-Pestic et al. 2011, Binzer et al. 2012, which are usually considered as key species for the maintenance of biodiversity and ecosystem functionality (Birkeland and Dayton 2005).

Consequences for species coexistence under global warming
The adaptation of consumer foraging strategy to local conditions is often considered to foster species coexistence (Kondoh 2003, Stump and Chesson 2017. The general assumption behind this conclusion is that consumer species will adapt their foraging strategies in order to maximise their energetic gains (Pyke et al. 1977). This optimal diet is reached by foraging on prey that are close to a body mass optimum (i.e. higher prey body masses, Petchey et al. 2008) and of high abundance (Pyke et al. 1977, O'Gorman et al. 2019). Together, these two selectivity criteria are supposed to increase the coexistence of resource species by controlling the growth of abundant species and preventing competitive exclusion and the coexistence of consumers by ensuring a good efficiency in their prey consumption (Kondoh 2003). Our results, based on an allometric framework, suggest that consumers tend to depart from this optimal behaviour under stressful conditions. We explored the consequences of this behaviour using a dynamic model that predicts the temporal dynamics and coexistence of species in food webs. The model was parameterized with species body masses and temperature (see Methods). We ran two versions of this model: one including the adaptation of species diet to local temperature and productivity conditions as informed by our dataset, and one without this adaptation, corresponding to the classic modelling approach (Schneider et al. 2016). We simulated the dynamics for synthetic food webs of 50 species (30 consumers and 20 basal species) over a temperature gradient spanning from 1°C to 25°C to predict the number of extinctions at different temperatures. Overall, we observed that models incorporating species behavioural adaptation to temperature and productivity were more sensitive to the increase in temperature (Fig. 4), as the proportion of extinct species remained stable over a larger temperature gradient for models without behavioral adaptation.

Caveats and limitations:
One limitation of our approach is that we used variations in temperature that arise due to seasonality or specific local conditions to derive predictions about climate change occurring over longer time scales. It is not clear how our observations made at smaller time scales would transpose to a change such as global warming. However, behaviour is a short-term response to temperature conditions (Abram et al. 2017, Mandl et al. 2018, and, at the scale used for our study, we can argue that species can benefit by building an energy reserve when conditions are favourable which would not be the case at larger time scales, so our results might underestimate the magnitude of the issue under realistic global-change scenarios. The use of median and standard deviation to characterise the different distributions limited the amount of information used in our study. Quantifying the neutral versus trait-based processes would benefit from the comparison between the environmental and realised distributions using metrics like the Kullback-Leibler divergence (Kullback and Leibler 1951). With such an approach, one could argue that the more divergent the distributions are, the more predation events are driven by traits. However, this would be limited by the impossibility of disentangling the part of the divergences explained by changes in the environmental distribution and what relates to a change in fish behaviour. However, we believe that a more controlled approach in micro-or mesocosms where the body mass distribution of prey species available could be standardised could elegantly solve this issue.
Different factors affect prey retention time in consumer guts. Temperature is certainly important but we assume for our study that its impact was the same for all species introducing a constant bias with no effect on the trends observed here. However, a more species-specific factor relating to species morphology, like the presence of shells or skeletons potentially could impact our results. We thus compared two sets of results, one for which we incorporated in the model a lower detection probability for species with hard bodies (presented here), and one for which we did not.
Overall, the trends and effects observed when we included this correction were similar to the one observed without correction suggesting an absence of systematic biases.

Future directions
While the similarity of response between the two foraging modes of our consumer species tend to argue for some generality of our results, an important step would be to address our results with other types of species. For instance, metabolic type has an important effect on the response of species to temperature (ref) and we can imagine that the response of endotherms could be different than what we observed for fish species. We revealed here a strong interaction between temperature and ecosystem productivity, however these two factors are both documented as being part of global changes. An important point here is that Kiel bay is not a very productive ecosystem, therefore, an increase of productivity here is different from the classical problem of eutrophication when resources tend to become too abundant and uncontrolled by consumers.

Conclusion
It is generally assumed that consumers respond to their environmental conditions by making optimal choices to maximise their energetic income (Kondoh 2003, Beckerman et al. 2006, Petchey et al. 2008. This assumption was used to derive several predictions in ecology about community structure and species coexistence. For instance, it is often considered as a solution to May's paradox (May 1973) based on the discrepancy between the prediction of a mathematical model posing that complex communities should not persist in nature and empirical observation of ecosystem complexity. It is therefore usually assumed that species' optimal behaviour is a strong driver of community organisation and supports species coexistence.
We challenge this optimistic view of nature by stressing that under stressful conditions, when resources are scarce in comparison to species energetic needs -for instance when they face energetic stress caused by temperature increase, consumer species tend to depart from what would be their optimal behaviour under ambient-stress conditions. Therefore, the ecological conclusions built on this hypothesis might remain highly uncertain in the context of global warming. We tested the consequences of our observations by integrating this new ecological response in a mechanistic model. We show that the number of species extinctions in response to an increase in temperature is higher than what is observed without. This means that the consequences of global warming on species coexistence might be more severe than what is classically predicted by ecological models, and more generally that optimal foraging theory should be used with caution in the context of global change.

The Kiel Bay database
The Kiel Bay is located in the Baltic Sea, which is a marginal sea belonging to the North Atlantic and considered the largest brackish sea in the world. It is a rather low productivity ecosystem with low biodiversity due to its glazial history and the strong salinity gradients that only few species . This shape characteristic also corresponds to specific foraging behaviour (Russo et al. 2007).
The fish individuals were sampled using systematic and standardised bottom trawls. The trawls were carried out year-round between 1968 and 1978. The body length of fish was measured and rounded to the nearest integer (in cm). Species-specific regressions were used to estimate fish body masses. Stomach contents were identified to the highest taxonomic resolution possible and wet mass determined when possible. Hence, the database includes body size data for all fishes (i.e. predators) but also for prey items from the stomach contents (Arntz 1974). In addition, we were able to add independently-sampled abundance and body mass information on the benthic invertebrate (i.e. prey) fauna to the database. These data on prey abundances and body masses were sampled independently at the trawling locations using classical 0.1 m² van Veen grabs (Lie and Pamatmat 1965), see (Gröger and Rumohr 2006) for detailed procedure. We have enriched the database with climatic (i.e. temperature) and oceanographic (i.e. salinity) data and geographical information on the distances between the sampling (trawling) sites. So far, the stomach content data have been published only partially and in German language (Arntz 1974) while parts of the invertebrate abundance data were treated and published separately (Gröger and Rumohr 2006). The food web mainly consists of six demersal fish species and more than a dozen benthic invertebrate species from different groups.

Filtering data
To make comparisons between the distributions of prey observed in fish guts and the ones observed in the environments, we only used a subset of the database for which we were able to (i) associate information about a fish to information about its environment and (ii) have a body mass estimate of prey found in the stomach. We considered this an association possible between fish and environment when they were sampled in the same sampling area and within less than 31 days. This first filter reduced the number of fish used in our analysis to 2487.
On this subset, we considered a unique statistical individual (hereafter called statistical fish) all the individuals from the same functional group, occurring at the same place, on the same date with the same body mass. This choice is led by the allometric approach used in our analysis, where all individuals from the same species and the same body mass are considered identical.
This aggregation increases the quality of the estimation of the prey body mass distribution in stomachs at the cost of a lower statistical power for the analyses done on the shape of these distributions. For instance, with a high aggregation level, fewer data points are available to consider the effect of temperature on the average body mass of prey. This approach is therefore conservative as it reduces the probability of type 1 error. Lastly, we found that few fishes were mostly feeding on species that were not detected in the environment, suggesting that the information on the environment was not a good descriptor of available resources. When less than 90% of the prey biomass found in guts was explained by what was found in the environment, the fish were discarded (26 cases) Finally, we obtained a final dataset of 290 statistical fishes.

Fitting of gut content and environmental distributions
We used a Bayesian approach to fit realised and environmental distributions. For the environment distributions, we fitted skew normal distributions to the observed body masses y, with environment ID as a random effect. A skew normal distribution is defined by parameters for location ξ, scale ω and shape α. Its probability density function reads

Determining allometric species' preferences
The preference distributions of each statistical fish were estimated as the departure of the realised niche from the environmental distribution. We removed the effect of species environmental availability from the realised to define the preference distribution as: where P, R and E represent the preference, realised and environmental distributions, respectively.

Dynamic model
To simulate the population dynamics, we used a previously published model (Schneider et al. 2016), based on the Yodzis and Innes framework (Yodzis and Innes 1992). The growth of consumer species Bi is determined by the balance between its energetic income (predation) and its energetic losses (predation metabolism) where ep = 0.545 and ea = 0.906 represents the assimilation efficiency of a consumer foraging on plants and animals, respectively (Lang et al. 2017). Xi defines the metabolic rate of species i, which scale allometrically with body mass: where x0 = 0.314 is the scaling constant (Schneider et al. 2016), Ex = -0.69 is the activation energy of metabolic rate (Binzer et al. 2015), k the Boltzmann constant, T0 = 293.15 the reference temperature in Kelvin and T the temperature at which the simulation is performed. The trophic interactions are determined using a functional response Fij that describes the feeding rate of consumer i over resource j: bij represent the species-specific capture and is determined by predator and prey body masses: = .
It corresponds to the product of encounter probabilities Pij by the probability that an encounter leads to a realised predation event Lij. Both quantities are determined by species body masses.
We assume that encounter probability is more likely for species with higher movement speeds of both consumer and resource species: Since movement speed scales allometrically and based on feeding type (Hirt et al. 2017), we drew βx and βz from according normal distributions (carnivore: μβ = 0.42, σβ = 0.05, omnivore: μβ = 0.19, σβ = 0.04, herbivore: μβ = 0.19, σβ = 0.04, primary producer: μβ = 0, σβ = 0). Activation energy Ep is equal to -0.38 (Binzer et al. 2015). Lij is assumed to follow a Ricker curve (Schneider et al. 2016), defined as: where the optimal consumer-resource body mass ratio Ropt = 47.9 was calculated from the observed realised interactions in our dataset. We used a threshold Lij < 0.01 under which values were set to 0, assuming that too small or too large prey are not considered by consumers. The handling time hij of i on j is defined as: Where D = 0.25 determines the nutrients turnover rate and Sl = 5 determines the maximal nutrient level. The loss of a specific nutrient l is limited by its relative content in the plant species' biomass (v1=1, v2=0.5).
We ran our model on food webs of 50 species, composed of 30 consumers and 20 basal species.
A link was drawn between two species I and j when Lij > 0. For each temperature we ran 50 replicates of the two model's versions (with and without adaptive behaviour). The number of extinctions were calculated out of the 30 consumer species (we did not observe extinctions of basal species). We fitted a GAM model on this number of extinctions

Supplementary information II: Environmental characteristics
Overall, the different environments considered were characterised by two contrasted levels of productivity, leading to a bimodal distribution.

Supplementary information III: response of the preferred distribution to temperature at different levels of productivity
As we observed a strong interaction effect between temperature and productivity when explaining the response of the median of the body mass distributions in our different environments, we estimated for which levels of productivity the relationship between temperature and median was significant. At low productivity, we observed a positive slope between the median and temperature albeit not significant. The slope of the regression linearly decreased with productivity value, and became significantly lower than 0 for productivity levels larger than 10 2.52 .

Supplementary information IV: response of the width of the preferred trophic niche to local conditions
To assess how the width of the preferred niche responded to environmental conditions we fitted the same models as for the median on the standard deviation of the body mass of the preferred distribution. We observed that the standard deviation was decreasing with the predator body mass and with temperature. We however detected an interaction between fish shape and productivity.
At low productivity levels the width of the trophic niche of fusiform fish tended to be larger than the one of flat fish while the opposite is observed at higher productivity levels.