On aims and methods of collective animal behaviour

Collective animal behaviour is a sub ﬁ eld of behavioural ecology, making extensive use of its tools of observation, experimental manipulation and model building. However, a fundamental behavioural ecology approach, the application of optimality theory, has been comparatively neglected in collective animal behaviour. This article seeks to address this imbalance, by outlining an evolutionary theory framework for the discipline. The application of optimality theory to collective animal behaviour requires a number of questions to be addressed. First, what is the correct quantity to optimize? This can be achieved via a combination of considering the organisms' life history, alongside tools such as statistical decision theory and stochastic dynamic programming. Second, what mechanism is appropriate for optimal behaviour? This involves ensuring that models are self-consistent rather than assuming parameter values. Third, at what level of selection does optimization act? Selection acts on the individual except in very particular circumstances, yet collective animal behaviour phenomena are group level, thus introducing a risk of confusing at what level adaptive properties emerge. This article presents examples under each of the three questions, as well as discussing mismatches between theory and observation. In doing so, it is hoped that collective animal behaviour fully inherits the tools and philosophy of its parent discipline of behavioural ecology. © 2024 The Author(s). Published by Elsevier Ltd on behalf of The Association for the Study of Animal Behaviour. This is an open access article under the CC BY license (http://creativecommons.

Behavioural ecology aims 'to try and understand how an animal's behaviour is adapted to the environment in which it lives' (Davies et al., 2012, p. 5).One of the discipline's founding figures, Nikolaas Tinbergen, posed four questions for behavioural biologists (Table 1); these questions can be characterized according to whether they provide a static or a dynamic account of behaviour and, also, in thinking congruent with that of Ernst Mayr (Mayr, 1961), whether they provide an ultimate (evolutionary) or proximate (developmental/causal) view (Tinbergen, 1963).In this article we argue that the dynamic and ultimate views on collective animal behaviour have received much less attention compared to the large literature focused on static behaviour and its proximate causes.
Given its aims, the methods of behavioural ecology are typically characterized by (controlled) experimental observation of animal behaviour, coupled with optimality analyses of behaviour.
Examples of the latter are diverse and cover specific examples, such as mating behaviour of flies (Parker et al., 1993) and patch foraging behaviour (Pleasants, 1989), as well as the application of tools such as evolutionary game theory (Smith, 1982;Smith & Price, 1973), statistical decision theory (McNamara & Houston, 1980) and stochastic dynamic programming (Houston & McNamara, 1999;McNamara & Houston, 1980).As the opening quote in this section shows, the logic of applying optimality theory is broadly that natural selection is an optimizing agent, and hence animal behaviour is expected to be well fitted to its typical environment (Davies et al., 2012;Parker & Smith, 1990).Two types of optimal trait are typically identifiable: frequency dependent and frequency independent (Parker & Smith, 1990).Frequency-dependent traits are often analysed using evolutionary game theory, whereas frequencyindependent traits are analysed using tools imported from engineering and statistics, such as stochastic dynamic programming (Mangel & Clark, 1988) and signal detection theory (Green & Swets, 1966).
The application of optimality theory is caveated, however, by noting that it can be easy to misidentify the true target of optimization for natural selection (Parker & Smith, 1990), that controlled experiments, especially lab-based, may take animal behaviour outside of its typical environment (Fawcett et al., 2014), and that constraints including robustness may impact the extent to which narrowly defined optimality can be achieved (McNamara & Houston, 2009).
Over the past few decades, the study of collective animal behaviour has emerged as a subfield of behavioural ecology (e.g.Sumpter, 2010), and been incorporated into standard textbooks (Davies et al., 2012).However, optimality theory, one of the aforementioned twin pillars of behavioural ecology, is limited in textbook descriptions of, and in published research into, collective animal behaviour.For example, of 24 pages on optimality models listed in the index of the field's primary textbook (Davies et al., 2012), none feature in the chapter on living in groups; in fact optimality models do feature in this chapter, but are primarily focused on the behaviour of individuals living within the context of groups (frequency-dependent optimal traits, e.g.evolutionarily stable vigilance levels in groups, McNamara & Houston, 1992; foraging strategies in groups, Mesterton-Gibbons & Dugatkin, 1999; optimal versus stable group sizes, Sibly, 1983), with only a brief reference to a genuine group level 'wisdom of the crowd' effect in which pooled estimates of something are more accurate than typical individual estimates (Galton, 1907).In contrast, group level behaviours such as shoaling by fish (Couzin et al., 2002) and traffic flow in social insects (Couzin & Franks, 2003) are described alongside computational models of mechanisms giving rise to these behaviours.Similarly, in the index of an influential textbook of the collective animal behaviour subfield (Sumpter, 2010), optimality features only in the context of optimal and stable group sizes (e.g.Ame et al., 2006;Sibly, 1983); again, however, other optimality models in the context of living within groups do feature, with similar examples to those just mentioned including group foraging (Vickery et al., 1991) and synchronization (Rands et al., 2003).
In addition, in research articles, there is only a comparatively small literature on the application of optimality theory to collective animal behaviour, examples of which are given below.When optimality reasoning is applied to collective animal behaviour, however, it is easy to apply it at the incorrect level of organization, neglecting crucial details of natural selection theory in the process.Alternatively, the models presented can be partially analysed, with hidden assumptions that drastically change the conclusions drawn; this violates the principle of 'self-consistency' previously developed by theoreticians in behavioural ecology (e.g.Houston & McNamara, 2002).
The focus of collective animal behaviour on proximate explanations for behaviour comes despite Tinbergen himself proposing a number of interesting ultimate explanation questions for collective behaviour, such as why birds flock densely when attacked by a bird of prey (Tinbergen, 1963, p. 417), considering the adaptive benefit of the waggle-dance for honey bees, Apis mellifera, in both foraging and swarming (Tinbergen, 1963, p. 419), and arguing that the 'Physiology of Behaviour' he proposed should also seek to explain 'supra-individual societies' (Tinbergen, 1963, p. 416).It is the purpose of the present article, therefore, to argue for an overdue shift in the field to embrace the tools of optimality theory and their application to collective animal behaviour models.To achieve this, we highlight three key questions to help guide such applications, with motivating examples from the literature of how these questions are addressed.The examples focus primarily on the relatively recent application of decision theory and stochastic dynamic programming to collective animal behaviour; other areas, such as collective motion, will require appropriate optimality theory to be imported or developed.The summary thesis expressed is that in order to faithfully explain both collective animal behaviour as it is and propose theories that may guide empirical research into collective animal behaviour, it is essential to always bear questions such as these in mind.
It is worth noting that, while both collective animal behaviour and its parent discipline, behavioural ecology, focus on animal behaviour, there is growing realization than nonanimal organisms exhibit interesting and rich behaviours, which can fruitfully be studied through the lens of evolution, for example unicellular organisms (Miller & Bassler, 2001) and even cells within a body (Coburn et al., 2013;Davidescu et al., 2023).Hence although throughout this article we use the phrase 'collective animal behaviour', it should be remembered that in principle the arguments we seek to make here should apply equally to any other collective biological system that is the product of evolution through natural selection.

THREE QUESTIONS FOR COLLECTIVE ANIMAL BEHAVIOUR MODELS
In our view, in applying optimality theory to any collective behaviour it is essential to answer not four questions, but three; in fact, these three questions are general ones that any application of optimality theory requires to be answered correctly, but they are here illustrated with reference to failures, and successes, in doing so for collective animal behaviour models.As we show below, the final question, when applied to collective animal behaviour, also has the potential to generate interesting juxtapositions between optimality at different levels that are not seen when considering individual organisms alone.
The three questions, illustrated in Fig. 1 In any optimization problem an objective function, or quantity to optimize, must be identified.In analysing any system under natural selection, the ultimate answer to this question has to be evolutionary fitness, properly defined in terms of long-term evolutionary descendants (McNamara et al., 2011;Metz et al., Table 1 Tinbergen's 'Four Questions' (Tinbergen, 1963), categorized according to ultimate versus proximate (Mayr, 1961), and static versus dynamic views

Static view Dynamic view
Proximate view How is the behaviour generated?(Physiology, e.g.Seeley et al., 2012;Couzin et al., 2002;Couzin & Franks, 2003) 1992), although even this is nuanced by inclusive fitness considerations (Hamilton, 1964;Marshall, 2015).Ultimate evolutionary payoffs must, however, be related back to intermediate behavioural objectives; in behavioural ecology this is formalized in the concept of reproductive value (McNamara & Houston, 1986), although again yet further proxies must often be introduced in analysing any behaviour not directly relating to reproductive decision making.Hence here we consider three different types of behaviour: collective decision making, collective emigration and collective foraging.
Example 1: collective decision making Collective and decentralized decision making has emerged as a rich subfield of collective animal behaviour, with applications in collective foraging (e.g.Robinson et al., 2005), predator avoidance (e.g.van der Marel et al., 2019) and (e)migration (e.g.Seeley & Visscher, 2004).In analysing collective decisions, it has been common to import criteria from neuroscience and psychology.In particular, excellent work has been done in the application of optimal decision theory to perceptual decisions (Bogacz et al., 2006).This research has shown that the mechanism to achieve the theoretically best compromise between the speed and accuracy of decision making is the drift diffusion model (Ratcliff, 1978), a simple description of decision making that implements the statistically optimal sequential probability ratio test (Wald & Wolfowitz, 1948).Therefore, there is an implicit assumption in psychology and neuroscience, imported into collective animal behaviour (Franks et al., 2003;Latty & Beekman, 2011;Marshall et al., 2009), that it

Good site
Poor site

Follow the leader
Figure 1.There are three main questions that one should answer when applying optimality theory to collective animal behaviour.For each question, we depict representative examples.(a) What quantity should the group optimize?For example, honey bees making collective decisions on their future nest site location may be optimizing different quantities; they may optimize the speedevalue trade-off (Seeley et al., 2012), optimize the speedecohesion trade-off (Franks et al., 2013), or consider other criteria such as the sites' distance (Franks et al., 2008).(b) What mechanisms should be used?For example, when a group makes a binary collective decision, to flee or not to flee from a possible predator, the optimal rule to integrate social information may be different depending on the costs of an incorrect decision; possible rules can be to follow the majority of votes (King & Cowlishaw, 2007), use a super-or submajority quorum (Marshall et al., 2019), or simply follow the individual spontaneously identified as the group leader through confidence signalling (Marshall et al., 2017;Reina et al., 2022).( c) At what level is natural selection optimizing the behaviour?For example, starlings are self-interested individuals which aim to maximize individual fitness rather than flock fitness; therefore, their collective behaviour during coordinated flights (Cavagna et al., 2010) evolved to bring an individual level advantage.Instead, eusocial insects, such as honey bees, are selected primarily at the colony level and therefore their behaviour has been optimized to maximize the fitness of the group (Holldobler & Wilson, 2009;Wheeler, 1926).
is speedeaccuracy trade-offs that should be optimized.However, while this assumption is sound when decisions are rewarded by whether they are correct or not, which frequently occurs in laboratory experiments, in the naturalistic decisions that behaviours evolved to solve decisions are frequently rewarded by the value of an option selected.Thus speedeaccuracy trade-offs are unlikely to be optimized for many common decisions; rather, optimization may act on the speedevalue trade-off (Pirrone et al., 2014(Pirrone et al., , 2022)).While it can be argued that in psychological and neuroscientific experiments subjects should be able to optimize the decision problem they are actually faced with (e.g.Fudenberg et al., 2018), it is more likely that for sufficiently simple decision tasks the mechanisms used actually function as if solving the decision problem they were evolved for (Pirrone et al., 2014(Pirrone et al., , 2022)).Furthermore, for collective animal behaviour it is even less likely that a decentralized decision system, without any potential for topedown cognitive control, can adapt to solve problems other that those it evolved to.
As we discussed above, the optimality toolkit of behavioural ecology includes methods to determine how sequential decisions should be made optimally, in the form of (stochastic) dynamic programming.Within neuroscience this has recently been applied to the field of value-based decision making (Tajima et al., 2016(Tajima et al., , 2019)).Interestingly, these analyses predict that value-based decisions are also optimally solved by a version of the drift diffusion model, which exhibits the characteristic of insensitivity of reaction times to the absolute magnitude of alternatives under consideration.Thus, it appears that value-based decisions should be optimized by precisely the same mechanism as perceptual decisions.A resolution to this comes from realizing that the results of Tajima et al. (2016Tajima et al. ( , 2019) ) rest on an unrealistic assumption, that the cost of time is purely linear (i.e. the optimized quantity is the expected decision payoff in terms of linearly discounted time).While a linear cost of time may be the case for many laboratory experiments, where for example there is a fixed total experimental duration so time spent on one trial takes an equal quantity of time away from future trials, in naturalistic decision scenarios, as in dynamic programming, it is more usual to assume that time spent not deciding increases the chance that an option becomes unavailable, due to interruption, competition, etc.When time is discounted multiplicatively in this way the drift diffusion model is no longer optimal (Marshall, 2019;Marshall et al., 2021;Steverson et al., 2019), and phenomena such as magnitude-sensitive reaction times are predicted, which aligns with experimental observations in psychology of both perceptual and value-based decisions (Pirrone et al., 2018;Teodorescu et al., 2016).Of particular relevance for this article, the search for magnitude-sensitive reaction times originated with the analysis of a model of collective decision making during nest site selection by honey bee swarms (Pais et al., 2013;Seeley et al., 2012).This search led to a reconsideration of the quantity for optimization in both individual and collective decision making (Pirrone et al., 2022;Reina et al., 2023;Teodorescu et al., 2016).

Example 2: collective emigration
As well as misidentifying accuracy as being of key significance for decisions in collective emigration, as outlined immediately above in example 1, other criteria exist that need to be considered, especially for social insects.Social insect colonies such as those of ants and honey bees are tightly functionally integrated superorganisms (Oster & Wilson, 1978;Wheeler, 1911); thus, in social insect emigrations it is important to ensure cohesion of the colony.Franks et al. (2013) identified a speedecohesion trade-off for emigrating colonies; while selecting the best of the available nest sites is crucial for a colony of social insects, it is also essential that a high degree of unanimity is reached, so that all colony members end up in the same site.Utilizing information-theoretic measures, Franks et al. (2013) showed that in decisions over multiple alternative nest sites, the accuracy of a decision becomes increasingly decoupled from the cohesion of the decision, indicating that optimizing the speedeaccuracy trade-off by itself is not sufficient to guarantee cohesion of the colony.While speedevalue trade-offs for decisions such as nest site selection are now replacing speedeaccuracy trade-offs (see example 1 above), the logic for the decoupling of accuracy and cohesion can, in principle, also be generalized to the case of decision value and cohesion.

Example 3: collective foraging
In individual foraging, theory has been developed to determine the correct optimization criterion, such as energetic intake (Charnov, 1976), or energetic efficiency (Kacelnik et al., 1986) for example.In collective foraging, further complexity is added to the optimization problem.For example, colonies can target an ideal free distribution (Tregenza, 1995), or they can approximate probability matching which may be optimal under some scenarios (Kelly, 1956).Colonies can use positive feedback to recruit foragers when scarce resources are detected (Shaffer et al., 2013), or use negative feedback to stop recruitment when resource patches have become exhausted (Robinson et al., 2005) or are dangerous (Nieh, 2010).As well as simple net energetic maximization, superorganisms can also target more complex nutritional requirements (Bazazi et al., 2016) just as individually optimal agents can (Houston et al., 2011;Marshall et al., 2015).However, few analyses consider the importance of variability in performance.Reina and Marshall (2022) considered precisely this problem, when they showed that negative feedback signals can be an important regulatory function in recruitment systems based on positive feedback, reducing variance around target foraging distributions, and implementing speedeadaptation trade-offs in dynamic environments.Other work has investigated how a social insect colony can collectively maximize its exploration efficiency when searching for food in an unknown environment.Hunt et al. (2020) have taken the optimality result for probability matching in foraging (Kelly, 1956), and asked how an ant colony can function as a Bayesian superorganism.This approach derives appropriate behavioural rules from sampling theory, such as Markov Chain Monte Carlo, then examines behavioural rules for ants that can approximate this, and evaluates their behaviour against these rules.
Foraging in an unknown environment also requires the optimization of the exploreeexploit trade-off.For example, optimality theory, in the form of the dynamic programming approach described in example 1 above, has been applied to decentralized decision making by slime moulds (Physarum) solving a classical statistical decision problem, the two-armed bandit (Reid et al., 2016).This problem, in which an agent must sample between noisy sources before finally committing exclusively to one source, formalizes the exploreeexploit trade-off and is a reasonable approximation of the foraging problem for Physarum.The optimal solution of this problem, the Gittins index, has also inspired neuroscientists (Cohen et al., 2007), and was used by Reid et al. (2016) as a theoretical limit to evaluate real organismal performance, and approximation heuristics, against.Elsewhere in the field of collective animal behaviour, dynamic programming has been used to derive leader/follower dynamics in foraging pairs (Rands et al., 2003).
During collective foraging social insects coordinate their behaviour, forming efficient transport networks connecting the nest and food sources (Chandrasekhar et al., 2021) or multiple nests (Cook et al., 2014).While the initial intuition assumed that the colony would minimize the length of the transport network, recent research has shown different results.In fact, when needed, turtle ants, Cephalotes goniodontus, sacrificed path length (i.e.chose comparatively longer paths) in favour of network robustness (Cook et al., 2014) and traffic coherence (Chandrasekhar et al., 2021).
In summarizing Question A, the optimized quantity depends on the task as well as the constraints and needs of each species and their ecology.For collective foraging, for example, we have shown that it is a complex process involving multiple activities, such as exploration of the environment, distribution of animals among the different resources, creation and maintenance of transport networks; the collective behaviours to perform each of these activities can be analysed in terms of optimal strategies, and careful consideration is required of the appropriate quantities to optimize, such as energy intake, energy efficiency, search efficiency, exploreeexploit trade-off and transport network robustness.

Question B: What Behavioural Mechanism Should Be Used?
Having established the quantity that should be optimized, the next important question is to identify what behavioural mechanism should be used.This is closely related to the challenge of 'selfconsistency' in evolutionary modelling, in which at its simplest important quantities or parameters in models should be consequences of the modelling, rather than assumptions being fed into it (Houston & McNamara, 2002).In individual behaviour this is well illustrated by models that seek to explain the evolution of optimism and pessimism in decision making (Johnson & Fowler, 2011), which may be traced back to an arbitrary assumption that individuals only choose options having a probability greater than one half, regardless of priors and relative costs and benefits of choice outcomes (Marshall et al., 2013).

Example 1: simple majority quorum rules
For our examples of identifying behavioural mechanisms that are not self-consistent, we turn to a mainstay of collective animal behaviour research, the 'wisdom of the crowd' as manifested in the 'Condorcet jury theorem' (King & Cowlishaw, 2007).This simple combinatorial argument that shows how integrating votes improves group decision accuracy has formed the basis for arguments that increasing group size can lead to worse decisions by groups than by individuals (King & Cowlishaw, 2007) or, similarly, that group decision accuracy is maximized by intermediate group sizes (Kao & Couzin, 2014).Both of these studies, however, rest on hidden assumptions in the application of the simple Condorcet argument: first, a decision ecology assumption that there is only one type of error in any decision problem, and second, a selfconsistency assumption that majority voting is the best decision mechanism to use.
In fact, both assumptions turn out to be crucial in correctly applying optimality theory to collective decisions of this nature.First, it must be understood that any simple decision has two possible error types: for example, incorrectly identifying that a predator is absent when it is present, and incorrectly identifying that a predator is present when it is absent.Different error types in an organism's natural environment can have very different costs and benefits for the decision-maker and may also occur with very different frequencies.Appreciating this subtlety, and building on earlier work (Wolf et al., 2013) in analysing for effective nonmajority decision thresholds, allowed Marshall et al. (2019) to show conditions under which simplistic Condorcet reasoning can make systematically incorrect predictions about how groups can and should reach decisions; in doing so they showed how sub-and supermajority decision thresholds optimally relate to decision ecology, namely the costs of different error types and the prior probabilities of different states of the world (Marshall et al., 2019).
Similarly reliant on an assumption of a simple majority decision rule is the model of Kao and Couzin (2014), which shows how group decision accuracy can be maximized by intermediate group sizes, rather than additional decision-makers always improving collective decisions.This model considers decision-makers choosing whether to attend to a low reliability uncorrelated cue (i.e.amenable to the wisdom of the crowd effect through multiple observations), or a high reliability correlated cue (i.e.no improvement from multiple observations, due to correlation).Each individual decides which cue to attend to through a probabilistic 'voting strategy', then observes the indicated cue, and votes accordingly with the group decision reached via a majority decision rule as in the standard Condorcet model.Kao and Couzin (2014) showed that group accuracy is maximized at intermediate group sizes when the behaviour of the individual is based on a given set of voting strategies and majority decision rules.Making assumptions on the behaviour of the individuals is not in agreement with the self-consistency principle, that key parameters should emerge from analyses rather than be assumed.In fact, their analysis (Fig. 1(b) in Kao & Couzin, 2014) shows that if individuals are free to choose their voting strategy then the wisdom of the crowd effect can be restored in their model.By forcing the individual behaviour through an a priori assumption, they were able to show that when individuals are not free to choose their voting strategy, for example due to concurrent cognitive, social or environmental constraints, then intermediate group size can maximize collective performance.However, while such assumptions may have value, they should be explicitly acknowledged and, ideally, justified.

Example 2: sequential collective decisions
First principles applications of optimality theory to other aspects of collective decision making have also been attempted.An early example proposed the application of the Condorcet jury theorem to decision making by house-hunting honey bee colonies (Conradt & List, 2009).As described under Question A, this is an inherently sequential decision problem, for which the appropriate theory is based on sequential sampling models; yet the review did also identify the utility of a comprehensive theory of single-shot decision making from the political science literature (Ben-Yashar & Nitzan, 1997), which was only fully developed in the collective animal behaviour literature comparatively recently (example 1 above and Marshall et al., 2019).
Most collective decisions are, however, sequential in nature, making simple models based on signal detection theory comparatively unrealistic.As well as the general, model-free, theory of sequential decision making (Ratcliff, 1978) outlined under Question A above, a number of model-based approaches based on first principles have been derived.Of particular interest are sequential choice models where focal actors apply Bayesian reasoning to integrate the social information from the previous choices they have observed, along with their personal sensory information (Mann, 2018(Mann, , 2020)).This approach has successfully been applied to explaining observed variability in decision making that appears inconsistent with optimality (Mann, 2018), and how collective decision making can function in groups of rational decision-makers with differing opinions (Mann, 2020).This approach can then be extended including new quantities to be optimized (Question A), such as the cognitive costs for information processing (Mann, 2021b) or the resilience to connectivity changes in the social environment (Mann, 2022).

Example 3: from individual level optimization to emergent collective behaviour
By considering the quantity that individuals should optimize, it is possible to build bottom-up self-consistent descriptions of emergent collective behaviour.This approach is also advocated by Davis et al. (2022) in a recent article that suggests modelling collective animal behaviour as the results of optimal foraging decisions.In their view, optimal foraging theory and the marginal value theorem offer the mathematical framework to describe the optimal actions that individuals should take.
This bottom-up approach can explain collective decision making under a variety of social and ecological conditions.Similarly, Mann (2021a) has recently shown that minimization of individual cognitive costs can explain the emergence of cognitive heterogeneity within groups of self-interested individuals that make collective foraging decisions.The counterintuitive result of natural selection for reduced ability has also been documented by McNamara and Wolf (2022).
This bottom-up modelling approach based on optimal individual actions is not limited to self-interested individuals but it is also useful in modelling eusocial species where individuals have aligned interests.For instance, Lecheval et al. (2021) identified that, in building transport networks between nests and food patches, individual wood ants, Formica rufa, trade between patch distance and food quality.Building their model based on these individual level rules, they could explain the collective formation and maintenance of complex transport networks with emergent properties of network robustness, maximization of energy intake and minimization of transport costs.

Example 4: including context in the model
To describe, investigate and understand the mechanisms that regulate collective animal behaviour, it is crucial to include in the model the context in which the system operates.Considering the population in isolation from its environment can lead the modeller to introduce incorrect assumptions.The importance of context in understanding collective animal behaviour is exemplified by research explaining the different social interaction mechanisms employed by ants to regulate foraging activities (Gordon, 2016(Gordon, , 2021a)).Ants living in arid deserts do not leave their nest to forage until they receive social information that food is present.Unsuccessful foraging in the desert is very expensive (in terms of water loss) and therefore the default behaviour is to avoid exiting the nest if not told otherwise.The behaviour is diametrically opposed in ants living in food-abundant environments, as in the tropics.The default behaviour of these ants is to exit the nest and forage until they are told otherwise by peers signalling potential dangers (Gordon, 2016(Gordon, , 2021a)).
Considering the specificities of the environment in which the group operates has also been key in the work by Di Pietro et al. ( 2022), who explained how the coordinated behaviour of leafcutter ants could evolve.
Example 5: geometrical aspects While Chang et al. (2021) expected to find that a multisitenesting arboreal ant colony would optimize the transport network efficiency, their empirical observation did not confirm their intuition.Instead, they found that a simpler individual behaviour could explain the observed patterns.Given the geometrical properties of the environment, individuals following a simple random walk explained the collective choice of the nest by arboreal ants.
Including geometrical constraints in models of collective attention allowed Sosna et al. (2019) to explain an increase in collective sensitivity in the presence of a threat as an adaptive change of the social interaction network.Indeed, modelling collective decision making as a process made by individuals embedded in a geometrical space, rather than through spaceless models, can enable a better understanding of how collective decisions unfold over time (Couzin et al., 2005;Strandburg-Peshkin et al., 2015), and generate crucial insight on a general decision-making mechanism across species (Sridhar et al., 2021).
Question C: At What Level Should Behaviour Be Optimized?
Assuming we correctly identify both the criteria to optimize and the behavioural mechanisms to be optimized, there remains the question of at what level selection acts as an optimizing agent.While this is a general question for behavioural ecology, since individual level behaviour has a long history of erroneous explanations due to confusion over levels of selection (Wynne-Edwards, 1962), for collective animal behaviour the problem can appear particularly acute, as collective behaviours manifest at the group level yet selection acts primarily at the individual level.To recapitulate the evolutionary logic, selection acting on individuals will far outweigh selection acting on groups when those groups are only weakly genetically related (Williams, 1966); thus, suicidal behaviour to help unrelated members of a population is, for example, logically impossible.It is only when groups are highly genetically related that natural selection has the capacity to optimize group level behaviours directly (Bourke, 2011;Gardner & Grafen, 2009).For example, in the extreme case of clonal populations, which have maximal group relatedness, extreme division of labour can arise, with behavioural and morphological variation among different members of a group in order to optimize group level behaviour (Cooper & West, 2018).Since collective animal behaviour researchers study a gamut of species ranging from those living in unrelated groups, via family groups, through to the eusocial insects, this question assumes particular importance for the subdiscipline.In particular, collective animal behaviour offers an interesting new class of questions: how can selection for optimality at the individual level translate to (sub)optimality at the group level?
The earliest example of applying evolutionary reasoning to living in groups is due to W. D. Hamilton, who considered the selective pressures that could lead to dynamic groups forming due to predator evasion (Hamilton, 1971).Collective vigilance has also been modelled as an important ultimate cause for the evolution of group living (Pulliam, 1973).However, except at a rudimentary level, these early efforts at explaining group living do not explain the complex dynamical behaviour observed in many group-living species.Crucially, in explaining such behaviour, it is essential to identify the appropriate level of selection to consider.As discussed above, important early mechanistic modelling work was done in explaining a variety of collective motion patterns involved in animal groups consisting of predominantly unrelated individuals (Couzin et al., 2002).However the rules derived are descriptive rather than normative, and do not address questions of optimality, although optimization techniques can be used to rediscover similar behaviours under simulated predation threat (Demsar et al., 2015;Wood & Ackland, 2007).Outside of predation risk, identifying suitable optimization criteria for collective motion is challenging, but may include aerodynamic or hydrodynamic considerations (Belden et al., 2019;Li et al., 2021), sensing considerations (Berdahl et al., 2013), or even the application of emerging ideas from neuroscience such as 'surprise minimization' (Heins et al., 2023) to explain classical collective motion patterns.As always, however, it is necessary to offer a justification for the optimization criterion in terms of what natural selection shapes behaviour for.Other researchers have proposed that information transfer in groups such as starling flocks may be important, and have used approaches from statistical physics to detect and model scale-free correlations in starling flocks, arguing that increased propagation speed of information about predators, for example, helps the flock members avoid predation (Cavagna et al., 2010).This approach, however, is implicitly group selectionist in the original sense of Wynne-Edwards (1962); therefore, work is needed to identify how selection at the individual level within groups can give rise to such effects.
The above examples highlight an interesting source of research questions for optimality theory in collective animal behaviour, not present in classical behavioural ecology, namely how individual level selection can lead to group level optimality.While for the social insect colony examples discussed in Questions A and B this is straightforward, since given the extreme reproductive division of labour in the eusocial insects selection can act effectively at the superorganismal level (Bourke, 2011;Gordon, 2021b), the immediately preceding examples show that for unrelated groups the question is much more nuanced.Returning to the collective decision examples of Questions A and B, one approach is to consider whether selection on unrelated individuals within a group aligns or not, which can shift the pressure between optimal signalling, and optimal signal processing, within a group (Marshall et al., 2017).Potentially more interesting still is the study of when decisionmaking behaviour that is optimal at the individual level leads to either optimal or suboptimal group level performance.For example, Reina et al. (2022) have shown that groups of rational Bayes-optimal decision-makers undergo cascades of incorrect information when decisions are made simultaneously, and, instead, collective accuracy is restored in asynchronous scenarios where better informed individuals emergently decide first.Evolutionary trajectories in collective animal behaviour in the round can also be traced out using optimality theory; returning to collective foraging, for example, Reina and Marshall (2022) showed how individual level selection transitioning to genuine group level selection can lead to the progressive refinement of signalling systems.
Behaviour that is at first sight regarded as suboptimal or irrational can be explained by considering the appropriate selection level (individual or group).For example, experiments with Lasius niger ants show that individual ants are (irrationally) risk adverse (De Agro et al., 2021); however, their apparently irrational actions lead the colony to maximize its throughput with rational, riskindifferent, collective behaviour (Hübner & Czaczkes, 2017).Similarly, modelling optimal resource collection at the level of the colony can explain suboptimal foraging behaviour of the individual ants (Baddeley et al., 2019).Honey bees also work for the interest of the colony and readily increase their individual level burden to adaptively change the colony morphology and improve its collective mechanical stability (Peleg et al., 2018).
In summary, studying optimality of behaviour, whether at group or individual level, must take into explicit consideration how behaviours are selected with respect to the reproductive unit (Fig. 1).For instance, in eusocial insects, the reproductive unit is primarily the colony and therefore selection of collective behaviours is stronger than in group-living species of self-interested animals, such as fish or birds.Recognizing and applying this correctly allows a theoretically motivated explanation of (sub)optimality at both the individual and collective level, offers the potential for studying the phylogeny of collective behaviour during the transition to group living, and offers testable hypotheses for behavioural and comparative studies.

DISCUSSION
Our original motivation for this article has been to argue for an evolutionary theory of collective animal behaviour.Tinbergen's 'four questions' provide an appropriate framework for such a theory, spanning both timescales and levels of explanation (Tinbergen, 1963).In Table 1, we situate the examples reviewed in this article within that framework.Our focus has been on a comparatively neglected area of behavioural ecology within its subdiscipline of collective animal behaviour, the use of optimality theory, to motivate three further questions for those seeking explanations under the ultimate causal view of Tinbergen: what quantity should be optimized, what mechanism should be used and at what level should selection operate?As noted above, the application of optimality theory is not an argument that behaviour should be optimal, and mismatches between theory and observation necessitate a revision of theory (Parker & Smith, 1990).In fact, the simple models of optimality theory can be apt to oversimplify.For example, while elementary collective decision theory indicates that wider integration of opinions within the group should always be beneficial, a series of studies of opinion sharing in more complex environments and more complex decision tasks reveals that density effects can lead to restricted information sharing improving performance (Mateo et al., 2019;Rahmani et al., 2020;Talamali et al., 2021).Thus, the ideal for an evolutionary theory of collective animal behaviour, as in all of science, is a loop of hypothesis, observation, revision, resting on well-grounded theoretical predictions.