Linking ecology and cognition: does ecological specialisation predict cognitive test performance?

Variation in cognitive abilities is thought to be linked to variation in brain size, which varies across species with either social factors (Social Intelligence Hypothesis) or ecological challenges (Ecological Intelligence Hypothesis). However, the nature of the ecological processes invoked by the Ecological Intelligence Hypothesis, like adaptations to certain habitat characteristics or dietary requirements, remains relatively poorly known. Here, we review comparative studies that experimentally investigated interspecific variation in cognitive performance in relation to a species’ degree of ecological specialisation. Overall, the relevant literature was biased towards studies of mammals and birds as well as studies focusing on ecological challenges related to diet. We separated ecological challenges into those related to searching for food, accessing a food item and memorising food locations. We found interspecific variation in cognitive performance that can be explained by adaptations to different foraging styles. Species-specific adaptations to certain ecological conditions, like food patch distribution, characteristics of food items or seasonality also broadly predicted variation in cognitive abilities. A species’ innovative problem-solving and spatial processing ability, for example, could be explained by its use of specific foraging techniques or search strategies, respectively. Further, habitat generalists were more likely to outperform habitat specialists. Hence, we found evidence that ecological adaptations and cognitive performance are linked and that the classification concept of ecological specialisation can explain variation in cognitive performance only with regard to habitat, but not dietary specialisation.


Introduction
Cognition can be defined as the ability to perceive, memorise and process information from an individual's social as well as ecological environment (Shettleworth 2009), and variation in this ability is thought to be positively correlated with brain size. Relative brain size varies considerably among species (e.g. Mace et al. 1981;Sol et al. 2008) and is indeed associated with variation in average speciestypical cognitive performance (Deaner et al. 2006;Reader et al. 2011). Several hypotheses have been proposed to explain this link between interspecific variation in brain size and the associated cognitive abilities. The most prominent hypotheses are the Social Intelligence Hypothesis (SIH, Humphrey 1976) and the Ecological Intelligence Hypothesis (EIH, Parker and Gibson 1977;Milton 1988), which have been subsequently refined as the Domain-General Hypothesis (Deaner et al. 2006), Domain-Specific Hypothesis (Whiten and Byrne 1988), Adaptive Intelligence Hypothesis (Tooby and Cosmides 2003), Machiavellian Intelligence Hypothesis (Whiten and Byrne 1988), Cultural Intelligence Hypothesis (Herrmann et al. 2007;van Schaik and Burkart 2011), Social Brain Hypothesis Communicated by F. Trillmich (Dunbar 1998;Dunbar and Shultz 2007) and Cognitive Buffer Hypothesis (CBH, Deaner et al. 2003)) (see Fig. 1).
The SIH suggests that bigger brains co-evolved with increasing social complexity, i.e. cognitive challenges to manage social relationships, which, in turn, have evolved as means of solving ecological problems (Jolly 1966;Humphrey 1976; Whiten and Byrne 1988;Barton 1996;Dunbar 1998;Kudo and Dunbar 2001;Dunbar and Shultz 2007;Byrne and Bates 2010). In contrast, the EIH posits that ecological challenges in food acquisition, including spatial or spatiotemporal processes to memorise seasonally available food or manipulative skills for extractive foraging, have ultimately selected for larger brains (e.g. Clutton-Brock and Harvey 1980;Heldstab et al. 2016;DeCasien et al. 2017;Powell et al. 2017). At the end of the day, the brains evolve within species, where environmentally induced changes in physiological traits, such as glucose concentrations and hormone levels, impact cognitive performance (Roth et al. 2010; Thornton and Lukas 2012;Maille and Schradin 2016).
Comparative studies investigating the link between measures of brain size and socioecological factors revealed inconsistent results, finding either a positive relationship between measures of brain size and sociality in primates and ungulates (Dunbar 1998;Pérez-Barbería et al. 2007;Dunbar and Bever 2010) or equivocal support in carnivores (Holekamp et al. 2007; Pérez- Barbería et al. 2007;Finarelli and Flynn 2009), for instance. Among primates, the most recent comparative analyses indicated that brain size is better predicted by ecological than social factors (DeCasien et al. 2017;Powell et al. 2017). However, compared to social factors (Ashton et al. 2018b), less is known about the extent to which variation in specific ecological factors predicts cognitive performance (Fig. 1). Here, we therefore explore the question whether ecological adaptations can explain interspecific variation in cognitive abilities by first briefly summarising hypotheses about the evolution of cognitive abilities addressing potential links between cognition and brain size and sociality, as well as ecology, respectively. Second, we provide a summary of comparative studies relating interspecific variation in cognitive performance with ecology, specifically the degree of ecological specialisation. Using these studies, we also explore the relative impact of sociality and brain size on variation in cognitive performance. Finally, we discuss the effects of the degree of ecological specialisation, potentially confounding factors in experimental studies, and limitations of this review that may inform future research on this topic.

The link between cognition and brain size
Some comparative studies have suggested that measures of brain size covary positively with performance in cognitive tests (see Appendix 1 Table 3 for explanations of cognitive Fig. 1 Relationships between ecology, sociality, brain size measures and cognitive abilities. Main hypotheses related to particular links are represented with coloured thick lines: red for the Social Intelligence Hypothesis (challenges related to sociality drive brain development; Humphrey 1976), green for the Ecological Intelligence Hypothesis (challenges related to ecology drive brain evolution; Parker and Gibson 1977), blue for the Social Brain Hypothesis (ecological challenges predict sociality which drives brain size ;Dunbar 1998;Dunbar and Shultz 2017) and yellow for the Cognitive Buffer Hypothesis (environmental variation drives brain size which favours adaptive behavioural flexibility; Deaner et al. 2003). Thinner black lines represent previously reported relationships between cognitive abilities and sociality, behavioural flexibility and brain size. The dashed line represents the relationship between cognitive abilities and ecology discussed in this article terms), such as performance in inhibitory control across vertebrates (MacLean et al. 2012), a general intelligence (g)factor extracted from performance in innovation, social learning, tool use, extractive foraging and tactical deception (Reader and Laland 2002;Reader et al. 2011), a g-factor extracted from performance in tests on spatial and causal understanding, reversal learning and delayed response (Deaner et al. 2006(Deaner et al. , 2007 or performance in problem-solving (Benson-Amram et al. 2016). In addition, guppies (Poecilia reticulata) selected for larger brains outperformed those with smaller brains in a numerical learning assay (Kotrschal et al. 2013), demonstrating this link also at the intraspecific level.
However, it is questionable whether simple measures of brain size can be used to infer its impact on the solution of a specific problem (Healy and Rowe 2007). In addition, different neuroanatomical measures of brain size have been combined with inconsistently labelled methods and various cognitive response measures (Healy and Rowe 2007). To circumvent these problems, some studies extracted a general intelligence factor, which is a statistical value derived from correlating performance in several cognitive tasks (Spearman 1904;Jensen 1985). In primates (Reader and Laland 2002;Deaner et al. 2006;Deaner et al. 2007;Reader et al. 2011), the g-factor covaried positively with brain size. Although some other studies provided evidence for a g-factor in humans (Jensen 1985), non-human primates (Fernandes et al. 2014;Damerius et al. 2019), rodents, rabbits, cats, dogs (Galsworthy et al. 2014) and birds (Sol et al. 2005;Ducatez et al. 2014a), we lack validation that this correlation factor represents general intelligence (Burkart et al. 2017). In fact, it can simply reflect the selection of cognitive tasks that tap into similar cognitive domains, which would not necessarily validate the notion of general intelligence (Shaw and Schmelz 2017;Bräuer et al. 2020).
Alternatively, domain-specific cognition might support the notion of mosaic brain evolution (Barton and Harvey 2000). The vertebrate brain consists of several functionally different structures, of which many vary in size within and between clades (Striedter 2006). Differences in the relative size of different brain regions are thought to reflect both neurodevelopmental/functional size changes and selection for ecologically relevant cognitive and sensory specialisation (Barton 1996). For example, food-caching birds have relatively, but not absolutely, larger hippocampi (Krebs 1990), and brain regions associated with spatial processing are enlarged in species with better spatial abilities (Sherry et al. 1992;Clayton 1998). Moreover, group-living primates with highquality diets have larger brain regions for olfactory or visual processing, whereas solitary species or those with low-quality diets have larger brain regions for processing spatial memory (DeCasien and Higham 2019). Finally, the number of neurons in the mammalian cerebral cortex, or in the bird pallium, appears to be good predictors of inhibitory control (Herculano-Houzel 2017). Hence, specific neuroanatomical measures can be broadly associated with variation in cognitive performance.

The link between cognition and sociality
Cognitive abilities have been linked to traits associated with variation in social factors. Variation in sociality is often operationalised in terms of group size (Lukas and Clutton-Brock 2013;Kappeler 2019), which varies from solitary individuals and small pair-bonded units to large aggregations. The need for several social skills, like effective communication or coordination with other group members, requires specific neural structures Peckre et al. 2019). Thus, group size or group dynamics are contributing to the complex social challenges an animal faces (Kappeler 2019).
Accordingly, primates living in dynamic fission-fusion systems ) performed better in inhibitory control tasks than those living in more stable groups, suggesting that the former exhibit greater behavioural flexibility (Amici et al. 2008;Amici et al. 2018). In lemurs and birds, species organised into more complex social groups outperformed others in transitive inference tasks (Bond et al. 2003;MacLean et al. 2008). A similar interspecific difference was found in birds subjected to a reversal learning task (Bond et al. 2007). Moreover, within species, Australian magpies (Gymnorhina tibicen dorsalis) living in larger groups performed better in several cognitive tests (inhibitory control, associative and reversal learning abilities, spatial memory and innovation) than those living in smaller groups (Ashton et al. 2018a(Ashton et al. , 2019. Since traits such as inhibitory control and (reversal) learning abilities reflect behavioural flexibility, the underlying variation in cognition can be related to variation in sociality.

The link between cognition and ecology
Ecological challenges, such as variable schedules of resource availability, habitat complexity, predation risk or parasite exposure, may have contributed to cognitive evolution (Garamszegi et al. 2007;Lefebvre and Sol 2008;Shumway 2008;Soler et al. 2012;Morand-Ferron et al. 2016;Sayol et al. 2016). With respect to resource variation, the CBH posits that larger brains evolved to allow species to adjust their behaviour adaptively in response to variable environmental conditions (Deaner et al. 2003). For instance, frugivorous species, which have on average larger brains than folivorous species, rely more on resources that vary in their spatiotemporal distribution than folivorous species (Clutton-Brock and Harvey 1980;Mace et al. 2009). Moreover, birds and Old World primates exposed to seasonal changes in food availability tend to have larger brains than species living in non-seasonal habitats (van Woerden et al. 2012;Sayol et al. 2016). Innovativeness, which is adaptive in variable environmental conditions, correlates positively with brain size in primates and birds (Reader and Laland 2002;Lefebvre et al. 2004;Overington et al. 2009), but it also correlates positively with parasitism and immunocompetence in birds (Møller et al. 2005;Garamszegi et al. 2007;Vas et al. 2011), though the link between innovation and the transmission mode of parasite types is not obvious (Ducatez et al. 2020a). Finally, in line with the EIH, brain size was best predicted by diet or home range size in primates (DeCasien et al. 2017;Powell et al. 2017).
Comparisons within species also revealed evidence that variation in cognitive abilities is associated with parasitism (Dunn et al. 2011;Bókony et al. 2014), predation (Brown and Braithwaite 2005;Park et al. 2008;Ferrari 2014), habitat complexity (Roth et al. 2010;Tebbich and Teschke 2014;Croston et al. 2017;Morand-Ferron et al. 2019) or foraging behaviour (Mazza et al. 2019;Sonnenberg et al. 2019). However, only a few comparative studies explicitly explored which cognitive skills might be associated with which species-specific ecological challenges. In birds, innovation was positively correlated with parasitism (Garamszegi et al. 2007;Vas et al. 2011;Soler et al. 2012) or habitat breadth (Overington et al. 2011), but not with predation (Overington et al. 2011). In primates, abundance of socially transmitted parasites was positively associated with rates of social learning, and environmentally transmitted parasites were positively associated with rates of exploration (McCabe et al. 2015). Habitat complexity was positively correlated with spatial cognition and brain size in rodents (Mackay and Pillay 2018) and fish (White and Brown 2015a, b). Hence, some results point towards an association between cognitive performance and ecological adaptations and a systematic summary of respective associations across species may contribute to a better understanding of potential causalities and their relative effect sizes.
The required assessment of a species' ecological adaptation can be based on a characterisation of its niche, which is a multidimensional space comprising all ecological factors that determine species viability (Hutchinson 1953;MacArthur 1957). Specialisation and generalisation represent the extremes of the continuous variation along each of the dimensions (Sargeant 2007). Utilising this niche concept, however, involves some difficulties. First, it is important to differentiate between intrinsic specialisations due to evolutionary adaptations (i.e. an individual's genetics describing its fundamental niche) and extrinsic specialisations due to interspecific competition over resources (i.e. the observed realised niche), for instance (Hutchinson 1957;Devictor et al. 2010). Second, niche breadth can be defined by the diversity of resources used by a species, or by its overlap, measured as the deviation from other species' resource values (Sargeant 2007). Considering niche breadth, a specialist would then be a species consistently using a narrower niche than other species (Roughgarden 1972;Bolnick et al. 2003). Considering niche overlap, however, a specialist would use items/tactics that are rarely used within other species' niches (Bolnick et al. 2002). Moreover, classifications refer to only one niche axis (Futuyma and Moreno 1988), leading to species that can be highly specialised along one ecological gradient while being a generalist along another ecological gradient. It has therefore been proposed to use species co-occurrence as a measure of habitat breadth (Ducatez et al. 2014b). Finally, different studies use different terms for similar concepts without stating their definition, or they ignore differences between niche breadth and niche overlap, hampering broader comparisons (Colwell and Futuyma 1971;Devictor et al. 2010).
We, thus, use the concept of ecological specialisation as formalised by Hutchinson (1957) and similarly to Hughes (2000). Accordingly, we consider a dietary specialist as a species consuming a lower variety of food types and a habitat specialist as a species occurring in a lower variety of habitat types than a dietary generalist or habitat generalist, respectively. We use this distinction always relative to the species in comparison, not as an absolute attribute. Since animals are expected to have evolved cognitive adaptations to exploit these respective conditions as efficiently as possible (Mettke-Hofmann 2014), generalists and specialists are expected to vary in their performances across cognitive tasks but also in some personality traits. Hence, generalists have been suggested to be more explorative, to have better working memory, to learn faster, to exhibit greater behavioural flexibility and to have a higher innovative potential than specialists. Specialists are instead expected to exhibit better longterm memory, despite having smaller brains, than generalists (Reader 2003;Mettke-Hofmann 2014).
Below, we review relevant studies that explicitly investigated interspecific variation in cognitive performance posed by problems that are related to species-specific adaptations to factors reflecting the degree of ecological specialisation. Using the search query "(ecolog* or generali* or speciali* or "life style" or opportunist*) and (cogniti* or learn* or memory) and animal" in "topic" (including titles, abstracts, keywords and keywords plus) in the Web of Science [https://apps.webofknowledge. com/, accessed on 2019-07-14] and complementing the collection with other relevant studies via cross-references, we found a total of N = 25 studies that fit our criteria.
Merriam's All selected studies (1) experimentally compared (2) cognitive abilities between (3) at least two species with the aim of investigating (4) different ecological adaptations with a focus on the degree of ecological specialisation. We controlled for potential phylogenetic effects by excluding studies comparing species across taxonomic classes. The remaining studies either compared species within the same genus (40%), family (48%), or order (12%). Most of the studies compared wildcaught or semi-free ranging (72%) individuals in mammals (56%) or birds (24%) (N = 2 for each in reptiles and fish, N = 1 for invertebrates). The investigated ecological adaptations were mostly related to dietary challenges and variation in habitat complexity (Table 1). As studies of cognitive performance often differ in experimental conditions (animal housing, feeding regimes, environmental conditions, local and temporal conditions, experimental task and procedure, role of experimenter, etc.), measurement of cognitive performance and analysis in interspecific comparisons, we focused on explicitly comparative studies. Since only a few species were explicitly labelled as either generalist or specialist in the original studies, we assessed the relative degrees of habitat and/or dietary specialisation between the species investigated using additional literature. Similarly, if not mentioned in the original study, we gleaned information on group and brain size or proxies for brain size by consulting additional literature (Table 2).

Cognitive performance and ecological specialisation
Ecological challenges are of various nature, including the avoidance of predators and parasites and securing access to shelter or resources. However, most existing studies investigated variation in cognitive performance related to experienced foraging challenges. In the following, we distinguish among challenges related to habitat exploration while searching and finding food, accessing food items and memorising previous resource locations, and summarise their associations with the degree of ecological specialisation.

Habitat exploration while searching and finding food
Exploring different habitat types while searching for food may require different foraging techniques. More complex habitats with variable and unpredictable environments may require superior spatial learning abilities, allowing animals to flexibly adjust to these variable environments. Bats have been widely studied across habitats since their echolocation varies with landscape features (Schnitzler et al. 2003). Geoffroy's bats (Myotis emarginatus) and greater mouse-eared bats (M. myotis), which forage in more complex and less stable habitats, learned a complex spatial discrimination faster and showed more flexibility when reward contingencies changed, than long-fingered bats (M. capaccinii), which forages in simpler and more stable open water habitats (Clarin et al. 2013). Similarly, Cocos frillgobies (Bathygobius cocosensis) and Krefft's gobies (B. krefftii) that occur in spatially complex rock pool habitats performed better in a spatial learning test than Eastern long-finned gobies (Favonigobius lentiginosus) and Hoese's sandgobies (Istigobius hoesei) occurring in homogenous sandy shores (White and Brown 2015a). Also bank voles (Myodes glareolus), which occur in more complex habitats, exhibited better spatial search behaviour than root voles (Microtus oeconomus), which occur in more open habitats (Pleskacheva et al. 2000). Moreover, omnivorous bank voles and herbivorous common voles (M. arvalis) were similar in their efficiency of exploiting stable habitats, but the omnivorous bank voles were more efficient in exploiting habitats with temporally changing food locations (Haupt et al. 2010). However, striped mice (Rhabdomys pumilio, R. bechuanae, R. dilectus) occurring in habitats of different complexity did not differ in spatial learning abilities, possibly due to phylogenetic constraints (Mackay and Pillay 2018). Finally, adapting to and persisting in urban landscapes have been suggested to be associated with behavioural flexibility in several species (Sih 2013;Sol et al. 2013;Ducatez et al. 2020b). However, Eastern blue-tongued skinks (Tiliqua scincoides scincoides) originating from urbanised areas did not perform better in a reversal learning task than sleepy lizards (T. rugosa asper) originating from rural areas (Szabo and Whiting 2020). Hence, variation in habitat complexity seems to covary with learning abilities in most cases, in particular spatial learning abilities and decision-making.
Regarding the search for food, animals use specific ranging behaviour to track the spatiotemporal distribution of dietary items. By using specific navigational heuristics, i.e., decision rules applied to certain situations (Gigerenzer 2008), animals can improve their exploitation of the environment while reducing cognitive effort and energy expenditure. The use of such heuristics varies with the distribution of food items or the mobility of preferred food items. In primates, the more frugivorous Tonkean macaques (Macaca tonkeana) exhibited more goal-directed search strategies while foraging than the less frugivorous long-tailed macaques (M. fascicularis) or capuchin monkeys (Sapajus apella; Trapanese et al. 2019). The mobility of food items also influenced search strategies in three lemur species (Teichroeb and Vining 2019). Fat-tailed dwarf lemurs (Cheirogaleus medius), which are specialised on stationary fruits, performed best in a multi-destination array with several feeding platforms. Their superiority was explained by the efficient use of specific heuristics for exploration and feeder exploitation. In comparison, dietary generalist grey mouse lemurs (Microcebus murinus), which feed on stationary food items like flowers and gum but also on mobile food items such as insects, used fewer heuristics. Aye-ayes (Daubentonia madagascariensis), which are specialised on mobile and ephemeral insect larvae, used basically no heuristics at all, resulting in greater explorative effort and lower cognitive task performance. Similarly, Saussure's longnosed bats (Leptonycteris yerbabuenae), which are specialised on nectar, foraged more efficiently in a feeder setup with artificial flowers by revisiting the feeders less often and depleting them more than long-tongued bats (Glossophaga soricina), T. r. asper (rural habitat) No difference between P. montanus (store food for a several weeks) and P. palustris (store food for a few which complement their nectar and pollen diet additionally with fruits and insects according to seasonal availability (Henry and Stoner 2011). Thus, the reliance on more mobile food items seems to increase exploration, which results in lower task performance in spatial cognition tests. Variation in cognitive performance is also associated with foraging style. In rodents, faster exploring mice (Mus musculus) learned contingencies between an auditory cue and a food reward or punishment differently than slower exploring rats (Rattus norvegicus). Both rodents could learn either of the reward contingency, i.e. to stay in the initial compartment or move to a second compartment, to receive a food reward. However, they were unable to overcome their baseline activity tendencies to avoid a punishment: the more active mice only reached the learning criterion when they had to move to the second compartment, while rats only reached the learning criterion when they had to stay in the initial compartment to avoid punishment (Jones et al. 2017). In reptiles, the actively foraging Bosc's fringe-toed lizard (Acanthodactylus boskianus) learned a visual reversal learning paradigm faster than the Nidua fringetoed lizard (A. scutellatus), which is a sit-and-wait predator (Day et al. 1999a). Thus, a more proactive foraging style is consistently associated with superior performance in various cognitive tests.

Accessing food items
Once an animal has solved the problem of locating a given food patch, it encounters the next challenge: the extraction of the actual food item. Depending on the item's characteristics, superior sensorimotor coordination or manipulative skills, including extractive foraging techniques or tool use, are beneficial but also energetically more costly and ultimately require a larger brain (Parker and Gibson 1977;Heldstab et al. 2016). Sensorimotor control and extractive foraging abilities seem to be especially helpful for solving innovative problems, and the majority of innovative behaviours has indeed been recorded in the foraging domain (Reader and Laland 2002); . Indian mynas (Acridotheres tristis), which exhibited greater diversity in motor behaviours, were more innovative than noisy miners (Manorina melanocephala) (Griffin and Diquelou 2015). Madame Berthe's mouse lemurs (Microcebus berthae) that expressed better motor control than grey mouse lemurs subsequently learned a modified innovative problem faster Criteria for selection were that (1) at least two study species (2) within the same phylogenetic class were compared in (3) at least one cognitive ability using an experimental approach (4) taking some kind of ecological difference into account  (Henke-von der Malsburg and Fichtel 2018). In seven species of callitrichid monkeys, the existence of extractive foraging techniques predicted innovative abilities, with lion tamarins (Leontopithecus spp.), which are manipulative extractive foragers with a higher innovative potential, exceeding the gumspecialised, extractive foraging marmosets (Callithrix spp.) and the non-extractive, but only visually, foraging tamarins (Saguinus spp.) (Day et al. 2003). These examples suggests that efficient access to food sources can vary with cognitive abilities such as innovative behaviours, which also seemed to be influenced by motor coordination.

Memorising previous resource locations
When animals are highly reliant on cached food or when they migrate to other habitats, usually due to seasonal food shortage (Wall and Stephen 1990;Dingle 2014), they require welldeveloped spatial cognitive abilities. In both cases, animals with good spatial processing abilities are better at memorising locations of food patches than animals with no or only basic spatial processing abilities (Shettleworth 1990;Sherry et al. 1992). For example, compared to non-migratory dark-eyed juncos (Junco hyemalis carolinensis), migratory dark-eyed juncos (J. h. hyemalis) showed greater accuracy in remembering feeder locations that have been visited only once before a certain retrieval interval (Cristol et al. 2003). Moreover, Merriam's kangaroo rat (Dipodomys merriami), an intensive scatter hoarder, showed better spatial memory accuracy in a cache simulation task than the Great Basin kangaroo rat (D. microps), a leaf-eating specialist that does not rely on scatter hoarding (Barkley and Jacobs 2007). Furthermore, food-caching Clark's nutcrackers (Nucifraga columbiana) performed better in an initial spatial discrimination task than less food-caching pinyon (Gymnorhinus cyanocephalus) and non-food-caching Western scrub jays (Aphelocoma californica). Pinyon jays, however, performed better than the other two corvid species in serial reversal learning tasks (Bond et al. 2007) and Western scrub jays performed better in a distance discrimination task (Gibson and Kamil 2005). Thus, the reliance on food-caching can covary with spatial memory, but not necessarily with other cognitive abilities.
Although primates do not rely on food-caching, spatial memory abilities can be beneficial for relocating a certain food patch. Indeed, chimpanzees (Pan troglodytes) that feed on more patchy distributed foods than bonobos (P. paniscus) exhibited better retrieval performance when food items were hidden by a human demonstrator (Rosati and Hare 2012). Similarly, lemurs varied in performance in spatial memory tasks according to their diet. The most frugivorous ruffed lemurs (Varecia spp.) showed better spatial memory than ringtailed lemurs (Lemur catta), mongoose lemurs (Eulemur mongoz) and Coquerel's sifakas (Propithecus coquereli), the latter being the most folivorous species (Rosati et al. 2014). Studies are grouped after the ecological relevance of the task being rather linked to habitat exploration or foraging. The type of specialisation crucial for the ecological relevance is underlined. Below each study, the respective sign used in the sign test is given, where a plus (+) means that the best performing species is relatively more habitat (left) and/or dietary (right) generalist, lives in relatively larger groups or has a relatively bigger brain (or higher value in the according brain size measure) and vice versa for a minus (−). In case the specie was intermediate, or the compared species do not differ in these variables, we assigned a zero (0). NA indicates not available data Wied's marmosets (Callithrix kuhlii) performed better than golden lion tamarins (Leontopithecus rosalia) in spatial memory experiments with relatively short retention intervals (5 or 30 min). However, they performed poorly after longer retention intervals (24 or 48 h), while the tamarins could maintain their performance level (Platt et al. 1996). Again, the observed interspecific differences match the species' foraging strategies: while marmosets revisit single food patches several times per day (Rylands 1989), tamarins do so only every 3 days (Peres 1989). Hence, spatial memory abilities also vary in accordance with a species-typical foraging ecology.

Ecological generalism versus ecological specialisation
Empirical comparisons of cognitive performance between generalists and specialists have either investigated effective habitat exploration in, for instance, spatial memory tasks (Pleskacheva et al. 2000;Haupt et al. 2010), or specific foraging abilities like innovative propensities (Day et al. 2003;Overington et al. 2009;Overington et al. 2011;Griffin and Diquelou 2015;Henke-von der Malsburg and Fichtel 2018), associative learning (Hoedjes et al. 2012) or behavioural flexibility (Day et al. 1999a), using a variety of problem-solving experiments, including food extraction tasks, visual or olfactory discriminations or reversal learning tasks.

Habitat exploration and the degree of habitat specialisation
Occurring across larger and more complex areas, habitat generalists would benefit from advanced navigational strategies to efficiently explore these areas, specifically when they feed on patchy distributed but potentially predictable food sources. The habitat generalist bank vole, for instance, showed increased spatial memory compared to the more specialised root vole (Pleskacheva et al. 2000). In lemurs, the species with greater habitat specialisation performed better in the spatial memory task due to more efficient use of navigational heuristics (Teichroeb and Vining 2019). In bats, Saussure's long-nosed bats, a relative habitat generalist, exhibited more efficient feeder exploitation than the sympatric but more specialised longtongued bats (Henry and Stoner 2011). Similarly, the relative habitat generalists, the greater mouse-eared and Geoffroy's bats, learned a complex visual discrimination faster and were more flexible in a reversal learning task than the most specialised long-fingered bat (Clarin et al. 2013). Migratory vertebrates tend to be more habitat specialists than generalists, possibly because they need to disperse further to find a habitat patch with suitable conditions (Martin and Fahrig 2018). In a comparative study on spatial memory accuracy in two junco subspecies (Cristol et al. 2003), the migratory subspecies performed better than the residential subspecies. However, since both subspecies rely on comparable diets and occur in similar habitats throughout the year, and due to a lack of data on population densities and different habitat types, it is neither possible to calculate a species specialisation index (Martin and Fahrig 2018), nor to classify the migratory subspecies as more specialised than the residential one. Overall, one may argue, however, that the degree of habitat specialisation tends to covary with spatial memory accuracy, learning flexibility and decision-making.

Foraging and the degree of dietary specialisation
Food storing or caching can be considered a behavioural adaptation to variable resource abundance. While a positive link between these behaviours and spatial memory abilities has been reported (Clayton and Krebs 1994a, b;Bednekoff et al. 1997), it is not clear how the degree of ecological generalism may fit into this relationship. The aforementioned example on spatial memory accuracy in a cache simulation task reported the better performing kangaroo rat to be a leaf-eating specialist (Barkley and Jacobs 2007), but others classified them as less specialised because they also, although more rarely, feed on seeds like other kangaroo rats (Cassola 2016;Timm et al. 2016), indicating that the classification into generalists and specialists is not always straightforward.
The degree of dietary breadth was related to discriminative learning abilities in a comparative study of parasitic wasps. The more dietary generalists (Nasonia vitripennis, N. longicornis) learned an association between an odour and a rewarding host better than the more specialised N. giraulti (Hoedjes et al. 2012). Also, the dietary generalist bank vole performed better in a spatial learning task with temporally changing food locations than the more dietary specialist common vole (Haupt et al. 2010). Hence, dietary generalism seems to covary with discriminative and spatial learning ability.
Individuals with greater innovative abilities are also expected to deal more efficiently with changing environmental conditions, including diet (Sol et al. 2005). Since generalist species are by definition exposed to more variable conditions, they are suggested to express greater behavioural flexibility and greater innovative propensities than specialists (Ducatez et al. 2014a;Navarrete et al. 2016). Among birds, habitat generalist species have indeed higher innovation rates than habitat specialists (Overington et al. 2011). Moreover, the omnivorous Indian myna showed a higher innovative propensity than the noisy miner, which is specialised on honey (Griffin and Diquelou 2015). In contrast, the more dietary and habitat specialised Madame Berthe's mouse lemur outperformed the sympatric generalist grey mouse lemur in innovative extractive foraging tasks with variable difficulties (Henke-von der Malsburg and Fichtel 2018). The better performance of the specialist might have been a result of enhanced executive control enabling individuals to inhibit the use of a previously learned problemsolving technique and to develop an adjusted solution to a modified problem, indicating that other factors than ecological specialisation may explain variation in performance. Across primates, however, performance in inhibitory control tests was best predicted by absolute brain size and dietary breadth, suggesting that species differences in dietary specialisation might indeed be related to levels of self-control (MacLean et al. 2014). Hence, dietary specialisation seems to covary with learning ability, spatial learning and inhibitory control.
In general, cognitive performance can be related to the degree of ecological specialisation. Twenty-one of the interspecific comparisons reviewed here report cognitive differences between species expressing a different degree of habitat/dietary specialisation, while four do not (sign-test: p < 0.001). Habitat generalists (N = 14) were more likely to outperform habitat specialists (N = 4; sign-test: p = 0.031), but the degree of dietary specialisation could not explain interspecific variation in cognitive performance (sign-test: N generalist = 13, N specialist = 8, p = 0.383).

Variation in cognitive performance in relation to group size
Because performance in cognitive tests in these studies might be explained by consistent differences in sociality, we scored the species included in this review with respect to their group size to index their social complexity (Table 2). While half of the comparisons (N = 13) are controlled for group size effects, the other half (N = 11) compared species living in differently sized groups, which also exhibit interspecific cognitive variation. However, we do not find species living in larger groups to generally perform better than those living in smaller groups, which might also be due to our small sample size (sign-test: N larger = 6, N smaller = 5, p = 1).
Five studies supported a positive link between group size and cognitive performance: Mexican and pinyon, as well as Western scrub jays, which live in larger flocks, performed better in spatial learning paradigms than Clark's nutcrackers (Bednekoff and Balda 1996;Gibson and Kamil 2005); Saussure's long-nosed bat, which form larger colonies, performed better in a spatial working paradigm than Palla's long-tongued bat (Henry and Stoner 2011); pair-living sleepy lizards were more behaviourally flexible in a visual reversal learning task than solitary Eastern blue-tongued skinks (Szabo and Whiting 2020); and golden lion tamarins, which live in relatively larger groups, showed better memory retention for longer retention intervals than Wied's marmosets (Platt et al. 1996). However, Wied's marmosets outperformed golden lion tamarins in the same task using a shorter retrieval period (Platt et al. 1996). In lemurs, performance in a spatial memory task was not linearly related to group size across four species (Rosati et al. 2014). Moreover, in innovative problem-solving paradigms, primates living in intermediatesized (Day et al. 2003) or birds living in smaller groups (Griffin and Diquelou 2015) outperformed the respective species living in relatively larger groups.
Based on the currently available evidence, it is therefore not possible to determine whether sociality covaries with cognitive performance scores in these studies. First, we set the focus on studies comparing species with variation in ecological adaptations, which were not designed to compare species with different group size. Second, we indexed sociality in terms of group size but disregarded group composition, stability, cohesion or hierarchy. Finally, most of the cognitive tests were not explicitly designed to have any functional relevance in terms of sociality or variation in social traits, so that a correlation with performance scores is unlikely. Hence, to address the relative importance of either ecological or social factors driving the evolution of brain size, comprehensive cognitive test batteries addressing both sets of factors are required (Shaw and Schmelz 2017;Völter et al. 2018;Fichtel et al. 2020).
Variation in cognitive performance in relation to brain size Brain size can be assessed via absolute or relative brain mass or volume, via an encephalisation quotient (Jerison 1973;Hartwig et al. 2011) or neural connectivity, for instance. Since the studies included in this review were not designed to compare potential effects of a certain brain size measure, we had to find comparable measures or proxies elsewhere (Table 2). With this information, we did not find evidence for a link between experimental cognitive performance and brain size in this sample (sign-test: N bigger = 9, N smaller = 8, p = 1). Since the available brain size measures differed between these relatively few studies, the observed lack of an effect of brain size on cognitive performance might reflect this methodological shortcoming.

Discussion
In this review, we summarised comparative research investigating variation in cognitive performance in relation to specific adaptations to ecological factors animals are exposed to in their daily life. Although these ecological factors can vary greatly among species in the same taxonomic group, studies systematically investigating the relationship between ecological factors and cognitive performance are still rare. Most studies reported a predicted relationship between the measured cognitive performance and an ecological factor differentiating the study species (Table 1), but we cannot know whether this pattern is affected by a publication bias against studies reporting no effect. Our rough control indicated that phylogeny as well as group and brain size did not have pervasive effects on the observed pattern. Nonetheless, some studies failed to find an effect of ecology, perhaps due to unsuitable study designs (Bednekoff and Balda 1996;Healy and Suhonen 1996) and/or ecological irrelevance of the respective cognitive ability tested (Day et al. 1999a;Gingins and Bshary 2016). Below, we discuss the main correlates of interspecific variation in cognitive performance in terms of flexible foraging strategies, spatiotemporal habitat exploration and food patch exploitation, as well as the degree of ecological specialisation. Further, we highlight the importance of considering potentially confounding factors when designing a study appropriate for the investigation of species-specific ecological adaptations (Shaw and Schmelz 2017;Schubiger et al. 2020).

Adaptations to particular ecological factors correlate with cognitive performance
Flexible foraging strategies Interspecific differences in cognitive performance have been reported as a function of variation in ranging behaviour and search strategies (Teichroeb and Vining 2019;Trapanese et al. 2019), foraging activity (Day et al. 1999a;Day et al. 2003;Jones et al. 2017), foraging techniques (Day et al. 2003), characteristics of preferred dietary items (Pleskacheva et al. 2000;Henry and Stoner 2011;Teichroeb and Vining 2019), adaptations to habitat complexity (Pleskacheva et al. 2000;Clarin et al. 2013;White and Brown 2015a) or adaptations to seasonality (Cristol et al. 2003; Barkley and Jacobs 2007;Henry and Stoner 2011) (Fig.   2). Active or manipulative extractive foragers have been reported to learn more flexibly (Day et al. 1999a) or to be more innovative (Day et al. 2003), respectively. Flexible learning and innovative abilities can be linked to innovators that possess the ability to invent a new behaviour or to modify an existing behaviour (Reader and Laland 2003) and to incorporate these into the behavioural repertoire via flexible learning mechanisms (Dukas and Ratcliffe 2009). In contrast to sit-and-wait predators, active foragers need to rapidly adjust the current foraging strategy to the behaviour of the prey of interest as well as to the environment while searching and hunting for prey. They would specifically benefit by learning the association of a certain stimulus with a reward (i.e. the prey) and to flexibly update such associations whenever the stimulus or other conditions change. This underlying behavioural flexibility is then an advantageous characteristic when environmental conditions change (Lee 2003;Lefebvre et al. 2004). Further, innovations appear predominantly in the foraging context (Reader and MacDonald 2003), favouring a link with a species' foraging ecology rather than with its sociality.

Spatiotemporal habitat exploration and food patch exploitation
When searching for food, animals always need to deal with the tradeoff between habitat exploration and food patch Fig. 2 Links between ecology and cognition. We identified several links (thick lines) between cognitive abilities and adaptations to ecological factors (thin lines) such as certain habitat characteristics, characteristics of dietary items or ecological challenges related to the foraging process (including the search for food, access to food items and memorising resource locations). Positive relationships between specific adaptations and cognitive abilities are represented with thick solid lines while negative relationships are represented with dashed lines exploitation (Hills et al. 2015). The decision of when to switch from one to the other varies with the spatiotemporal distribution of food items since this determines the energetic costs of habitat exploration and energy intake during patch exploitation. Habitat exploration is particularly costly when food items are sparse or patchily distributed or when food abundance is (seasonally) low. Using specific navigational heuristics or investment in spatial memory can reduce foraging costs under these conditions. However, the underlying capacities are energetically constrained and should, therefore, evolve in species that feed on stationary rather than mobile food items, on dispersed rather than highly abundant items, or in species, that are exposed to harsh environments (Roth and Pravosudov 2009).
Also, when relocating a certain food patch, irrespective of the length of a retrieval interval, the energetic investment in spatial memory capacities can be beneficial. At least in birds, rodents and primates, there is evidence that the evolution of spatial memory abilities parallels a species-specific foraging ecology. Better spatial cognition has been reported for species feeding on dispersed items of rather unpredictable abundance (Platt et al. 1996;Pleskacheva et al. 2000;Rosati and Hare 2012;Clarin et al. 2013), frugivorous species (Rosati et al. 2014;Teichroeb and Vining 2019;Trapanese et al. 2019), scatter hoarders (Barkley and Jacobs 2007) or migrating species (Cristol et al. 2003). In such cases, better-adapted species evolve greater hippocampi as an adaptation to the highly demanding ecological challenge of memorising previous food locations or caches.

Other ecological adaptations
Evidence for a general association between cognitive performance and ecological factors might be biased since most studies measuring interspecific variation conducted experiments on only a few cognitive skills such as spatial processing, flexible learning or innovative problem-solving. It remains to be investigated, however, whether other cognitive tasks, such as those estimating the ability of causal reasoning or numerical understanding, or a combination of different tasks in a valid test battery can also be linked to ecological factors (Shaw and Schmelz 2017). Also, the potential effects of other ecological factors, such as predation and parasite risk, on relevant cognitive abilities remain largely unstudied (Garamszegi et al. 2007;Soler et al. 2012). Thus, there is a need for additional studies to obtain a more comprehensive understanding of the ecology-cognition link.
How does cognitive performance correlate with the degree of ecological specialisation?
In several studies, we found the degree of ecological specialisation to be correlated with variation in certain cognitive abilities (Platt et al. 1996;Pleskacheva et al. 2000;Day et al. 2003;Barkley and Jacobs 2007;Haupt et al. 2010;Henry and Stoner 2011;Hoedjes et al. 2012;Rosati et al. 2014;Griffin and Diquelou 2015;Henke-von der Malsburg and Fichtel 2018). We found that habitat generalists generally outperform habitat specialists, but the degree of dietary specialisation did not consistently vary with cognitive performance. Given that habitat generalists regularly face more challenges by exploring a broader, more variable habitat than specialists, they might specifically exhibit better spatial processing abilities and more behavioural flexibility (Overington et al. 2011), at least in the sense of 'behavioural flexibility' allowing for adaptations to variable environments (Lea et al. 2020). However, behavioural flexibility does not necessarily result in better cognitive performance per se because less behaviourally flexible species, as specialists, may instead possess other behavioural characteristics that promote better performance in certain cognitive skills (Henke-von der Malsburg and Fichtel 2018). In studies reporting the more specialised species to exhibit better performance than the generalist (e.g. Teichroeb and Vining 2019), better performance was linked to specific adaptations for habitat exploration or exploitation. In this context, efficiency can be of various nature: to not use certain paths multiple times while foraging, to deplete a certain food patch to a certain extent varying with search decision rules (Wilke et al. 2009) or to not use ineffective solutions but to inhibit the execution of related behaviours. Greater efficiency might be more likely to vary with specific adaptations to certain ecological challenges than to the degree of ecological generalism per se and would require a more detailed investigation than the currently available evidence allows.

Confounding factors and limitations of the review
Several factors may confound a putative relationship between a particular ecological factor and a corresponding cognitive ability. First, the cognitive trait under study must have ecological relevance. This problem becomes apparent, for example, in a study designed to compare cognitive abilities in an ecologically non-relevant context, i.e. spatial discrimination abilities across six species of labrid fishes (Gingins and Bshary 2016). Because these cleaner fish do not rely on advanced spatial abilities, as they do not actively search for food patches but are visited by parasitised client fish, it is not surprising that they exhibited similar performances when associating a food source with a location.
Second, social factors that differ systematically between species may obscure the effects of ecological factors on cognitive abilities. For example, more social Mexican jay performed better than food-caching Clark's nutcrackers in a spatial memory task in which the birds' recovery performance of food caches made by conspecifics was measured (Bednekoff and Balda 1996). Similarly, of three corvid species, pinyon jays, who live in the most socially complex environment, performed better in a reversal learning task than Clark's nutcracker and Mexican jays with a more generalist ecology (Bond et al. 2007).
Finally, given the currently available sample size of studies meeting our criteria, the purported link between ecological specialisation and cognitive performance might reflect a publication bias. Comparisons of mostly mammals (especially primates) and birds and the focus on ecological challenges related to foraging may also create a bias. Nonetheless, we hope that the present review will stimulate more comparative research regarding this interesting topic, using additional taxa and, most importantly, a wider range of ecologically relevant cognitive traits in order to draw firm conclusions about the relative importance of various ecological factors in shaping cognitive abilities.
Funding Open Access funding enabled and organized by Projekt DEAL.
Data availability The original search record of the reviewed literature is provided as electronic supplementary material.

Compliance with ethical standards
Conflict of interest The authors declare no conflict of interest.
Ethics approval Not applicable.

Consent to participate Not applicable.
Consent for publication Not applicable. Ability to perceive, process and memorise information from the environment or other individuals.
Decision-making Determination of an action considering environmental cues and experience. Learning Any change in behaviour as result of experience; operationalised by an increase in performance.

Cognitive task performance
Operationalisation for an individual's learning abilities, often measured as success latency or ratio to solve a problem.
Problem-solving ability Ability to solve problems incorporating objects (i.e. inanimate objects, food), e.g. puzzle box, object manipulation test. General intelligence (g-factor) Composite factor derived from correlating cognitive performances across various cognitive tasks.
Cognitive test battery Array of at least two different cognitive tasks; often conducted to investigate correlations between cognitive abilities.
Cognitive abilities related to perception Discrimination learning Learning contingencies between events via conditioning. In a visual discrimination learning task, usually objects differing in shape, colour, pattern, and/or location serve as stimuli, of which only one is associated with a reward. Performance is measured as trials or time until a specified learning criterion is reached.

Reversal learning
Reversed learning after an initial discrimination learning with the previously rewarded stimulus becoming unrewarded.

Numerical learning
Learning of contingencies in relation with numbers, e.g. the ability to discriminate between quantities.
Cognitive abilities related to processing Behavioural flexibility Ability to flexibly adjust the behaviour according to the actual circumstances. Innovation Solution to a novel problem or novel solution to a modified problem; operationalised using problem-solving tasks. Causal reasoning Cognitive ability to relate two events with each other using causal understanding instead of arbitrary contingencies like space or time; operationalised using, e.g. a string-pulling task where pulling a string should be related to getting access to an attached reward. Tool use Behaviour in which an animal uses a secondary object as a specific tool to solve a given problem.
Cognitive abilities related to memory Shor-term memory Holding information that is currently being processed, e.g. the memorisation of a certain learning contingency from one experimental session to the other. Long-term memory Relatively persistent storing of information; can be manifested via several repetitions. Spatial memory Ability to perceive, process and memorise information from the environment or other individuals.
Holding specifically spatial information; operationalised, e.g., using a maze with several end locations of which only one holds the rewarded stimulus, or using a cache simulation task, where the subject is allowed to relocate a hidden food reward after a certain retention interval.

Cognitive abilities in social contexts
Social learning Changes in an individual's behaviour resulting from attending to another individual's behaviour or its products.

Recognition memory
Memory capacities to recognize other individuals.

Transitive inference
Deductive reasoning allowing to derive a relation between items or individuals that have not been explicitly compared before. I.e. if A is related to B and B is related to C, then A must also be related to C. Tactical deception Usage of a behaviour in an unusual context that is likely to be misinterpreted by other individuals.
Individual characteristics that could affect problem-solving performance Personality trait Behaviour that is consistent across time and space. E.g. exploration as the tendency to explore an unknown arena over a short time interval. Persistence Perseverance of a certain behaviour despite its inefficiency; often operationalised by measuring the manipulative effort towards a puzzle box with a blocked opening mechanism. Executive/Inhibitory/ Self-control Ability to inhibit a prepotent behaviour due to its (temporary) inefficiency; operationalised using, for example, a detour reaching task with a transparent cylinder.