Goals and Limitations of Modeling Collective Behavior in Biological Systems

Local social interactions among individuals in animal groups generate collective behavior, allowing groups to adjust to changing conditions. Historically, scientists from different disciplines have taken different approaches to modeling collective behavior. We describe how each can contribute to the goal of understanding natural systems. Simple bottom-up models that describe individuals and their interactions directly have demonstrated that local interactions far from equilibrium can generate collective states. However, such simple models are not likely to describe accurately the actual mechanisms and interactions in play in any real biological system. Other classes of top-down models that describe group-level behavior directly have been proposed for groups where the function of the collective behavior is understood. Such models cannot necessarily explain why or how such functions emerge from first principles. Because modeling approaches have different strengths and weaknesses and no single approach will always be best, we argue that models of collective behavior that are aimed at understanding real biological systems should be formulated to address specific questions and to allow for validation. As examples, we discuss four forms of collective behavior that differ both in the interactions that produce the collective behavior and in ecological context, and thus require very different modeling frameworks. 1) Harvester ants use local interactions consisting of brief antennal contact, in which one ant assesses the cuticular hydrocarbon profile of another, to regulate foraging activity, which can be modeled as a closed-loop excitable system. 2) Arboreal turtle ants form trail networks in the canopy of the tropical forest, using trail pheromone; one ant detects the volatile chemical that another has recently deposited. The process that maintains and repairs the trail, which can be modeled as a distributed algorithm, is constrained by the physical configuration of the network of vegetation in which they travel. 3) Swarms of midges interact acoustically and non-locally, and can be well described as agents moving in an emergent potential well that is representative of the swarm as a whole rather than individuals. 4) Flocks of jackdaws change their effective interactions depending on ecological context, using topological distance when traveling but metric distance when mobbing. We discuss how different research questions about these systems have led to different modeling approaches.


INTRODUCTION
Throughout nature, molecules, cells, and organisms interact in ways that generate collective behavior. Collective behavior has been defined in many ways, but some features are generally recognized as essential. First, and perhaps most importantly, collective systems operate without central control. The grouplevel behavior and properties arise spontaneously from the local behavior of the individuals in the group, and no individual directs the behavior of others. The individuals interact with one another, but because individuals typically do not have global knowledge about the whereabouts and behavior of all the others, these interactions are local. Since the interactions are essential in determining the resulting collective behavior, different forms of group-level behavior arise from distinct types of interactions. Finally, collective behavior in nature (as we define it) always performs some biological function. The goal of modeling is to elucidate how local interactions, in the aggregate, allow the group to accomplish this function.
Some of the best-known examples of collective behavior are the many spectacular forms of synchronous movement in animals. Flocks of starlings wheel in the sky. Schools of fish travel together and turn sharply when a predator approaches. Clouds of locusts travel together. Similar patterns occur at the cellular level and also arise from interactions among individual cells. Groups of neural crest cells, for example, move together early in mammalian development [1]; the cells at one side contract, and the others do not, pulling the whole group of cells along. Common patterns of collective movement include flocks, where the animal motion is directionally ordered and the group has a net linear momentum; mills, where the motion is ordered and the group has a net angular momentum; and swarms, where the motion is disordered but the group remains bound together.
A second and widespread category of collective behavior regulates activity or effort to determine who does what and when, using a distributed process based on interactions [2]. For example, differentiation in a developing embryo occurs through local chemical and tactile interactions among cells, leading to the formation of distinct tissues that descend from identical cells. Another example of this type of collective behavior is task allocation in social insects, the process that determines how colonies adjust the numbers of individuals performing each of various tasks, such as foraging and care of the larvae. Individuals change tasks in response to interactions with each other and changing colony needs [3].
The patterns generated by collective animal groups, and more generally the distributed processes common to many forms of collective behavior, have captivated scientists beyond biology and have inspired diverse modeling approaches. Collective movement first caught the interest of the computer graphics and animation community [4], and has subsequently been the subject of a great deal of study in physics and applied mathematics [5,6].
Physicists have been especially interested in the observation that when different kinds of animals in different environments with very different individual behavior are brought together in sufficiently large numbers, only a few types of group dynamics emerge. Because collective behavior in natural systems involves large numbers of discrete individuals, many physicists have considered collective behavior through the lens of statistical mechanics. The hope in this approach is that collective behavior can be understood as an emergent property that arises from averaging over large numbers of interacting individuals. This is conceptually similar to how bulk material properties emerge from averaging over atoms or molecules.
This line of thinking has been the genesis of the young but rapidly evolving field of active matter [7,8]. In conceptualizing groups of organisms as matter, the focus of modeling has been on specifying minimal microscopic models and working to tease out how the group-level dynamics emerge. In this way, this bottomup approach to describing collective behavior reflects the way that physicists are trained to work from first principles when possible. The goal of the modeling in this case is the development of a general understanding of how and why group-level properties emerge given knowledge about the individual-level behavior. This approach has historically been successful in allowing us to understand and link many disparate physical phenomena [9]. However, the complexities of biological systems make them different from systems traditionally considered by physicists, in ways that warrant additional care in interpreting the predictions of models.
Collective behavior in natural systems is particularly appealing to engineers, who hope to exploit it in the design of engineered distributed systems. Collective behavior operates with no individual in charge and directing the motion of the others, and the properties and functionality of the group arise from the interactions among the individuals. This means that no individual is essential for the group to function. Thus, one advantage of collective behavior is that the function performed by the group is robust to the loss of individuals. Additionally, the bottom-up, self-organized nature of collective behavior means that the group is regulated and maintains coherence without the need for any individual to have global information about the state of the others-and thus serves as a robust model of distributed control with limited communication or information sharing.
Because the emphasis in the engineering community has been on the function performed by the group rather than on scaling up the behavior of each individual, models of collective behavior formulated by engineers tend to start with the group-level dynamics and propose a simplified model that generates this behavior. In this way, these top-down engineering models can be seen as explaining how a collective system works (in a simplified fashion) rather than why it works. The resulting models can be very powerful, both because they are easily translatable to designed systems and because they lead to predictions that can be tested in the biological system. However, because such models are not based on first principles, it can be difficult to know whether they will remain valid when the system parameters or other factors change.
Modeling biological processes brings further challenges that are not typically encountered in physics or engineering. Different organisms communicate and sense their surroundings differently, imposing distinct constraints on their behavior, so that even if the structure of two groups of different organisms is similar or they have similar functions, they may operate in very different ways. Additionally, organisms behave differently in different situations, so that a model that describes a particular group of animals well in one context may not hold when the environment changes. Moreover, organisms act to modify their environments, in ways that influence whether and how they interact, so that their behavior cannot be considered to be operating in an environment independent of the organisms [10]. Thus, models of collective behavior are unlikely to be generic, and do not fully describe the biological system. We argue that models of collective behavior that are intended to provide biological insight are most effective and useful when designed to address specific questions about collective behavior, and that it is important to remember their limitations.
To illustrate these ideas, we begin below with a broad overview of modeling trends in collective behavior, including a discussion of reasons why intuition gleaned from modeling in physics and engineering may not be sufficient to understand a biological system. We then discuss four distinct case studies that differ in organism, interactions, and ecological context: foraging by harvester ants, the formation of trail networks by arboreal turtle ants, the emergence of binding and group-size regulation in midge swarms, and collective travel and mobbing by flocking jackdaws.

MODELING COLLECTIVE BEHAVIOR
Modeling is ubiquitous in all branches of science. However, both what is meant by the term "modeling" and what its goal is differ among disciplines. Such distinctions are particularly fraught in an interdisciplinary field such as collective behavior, and they can lead to misunderstandings among scientists with different priors. Here, then, we begin by trying to elucidate some of these differences and to clarify the various starting points and perceived purposes of modeling collective behavior, before describing modeling strategies in more detail.
Modeling in physics tends to be built on the process of stripping away details, in an attempt to isolate only the most fundamental aspects of a problem or system. A "toy model" in this sense is typically not intended to reproduce the behavior of the modeled system exactly; rather, the goal is to construct a more tractable system that shares the same key features as the problem of interest but whose dynamics can be completely understood. A model of collective behavior developed in this spirit would not necessarily be expected to capture the specific behavior of any particular organism, but instead could be used to explain how individual, local interactions can scale up to produce coherent and distinct group-level behavior. We can characterize this general approach as being bottom-up: the model explicitly specifies the microscopic dynamics of the system, and the macroscopic behavior is expected to be an outcome of solving the model.
An engineer might approach modeling the same system differently. The goal of models in engineering is often to describe the actual behavior of the system, rather than why a system behaves as it does. If such a model captures enough about how the behavior works, it can then be translated into a new situation or used for a different purpose. For collective behavior, this style of modeling would entail describing in a simplified fashion what a collective group does in the aggregate, without explaining how the function of the collective behavior arises from the behavior of the individuals. In this way, this approach is more top-down: the macroscopic behavior of the group is what is explicitly specified in the model.
Here we discuss the approach to modeling used by biologists to guide empirical investigation [11]. A model is a description of a natural process that can make specific predictions. When the predictions do not fit the data, this provides an opportunity to modify the model so as to describe the natural process more accurately. However, even when the predictions of the model fit the data, this does not prove that the model is correct, because the same observed outcome could be achieved in other ways. Thus, although the physicist's modeling goal is achieved when the collective behavior can be explained as the outcome of individual behavior and the engineer's goal is reached when the operation of the system can be predicted, the biologist with a model that predicts the observed outcome will still seek to confirm that the real system actually operates in the way described by the model. In other words, for the biologist, obtaining a model that can then be studied and applied in contexts that do not occur in nature is not the goal; rather, the goal is to understand phenomena that do occur.
Thus, different scientific communities use models of collective behavior in different ways and to address different questions. It is important to remember that in all of these approaches, models are by their nature always limited in scope and applicability; as famously explained by the statistician George Box, "all models are wrong" [12]. In particular, no model is likely to capture all of the inherent complexity of a biological system as it adjusts to constantly changing environments. Richard Levins in Evolution in Changing Environments remarked that any model is either so general that it cannot be used to ask how well it fits observations or so detailed that it merely captures what is already known, and so the exercise of modeling is the attempt, through matching model results with data, to find a model that is somewhere in between [13].
Next, we contrast strategies for implementing the bottom-up and top-down approaches described above to address questions about natural systems, and then discuss case studies of models of different types of collective behavior.

Bottom-Up Modeling
The starting point of a bottom-up model of collective behavior is the individual. Each member of the group is assigned a set of behavioral rules, including interactions with others, that it executes. The goal is that the correct group-level collective behavior will emerge as the individuals follow their rules. This approach, often termed agent-based modeling, has seen widespread use in modeling collectively moving groups of animals such as flocks and schools. Designing an agent-based model of this type requires several explicit choices [14]. One must at minimum specify how each individual behaves when it is not interacting with others, which is often as simple as moving in a straight line at a constant speed; how the individual interacts with others; and which others it interacts with. Although these rules may be fully deterministic, it is common to include some stochasticity to mimic variously the imperfections of biological sensing or the random or unexplained variation among individuals that occurs in natural groups. Any behavioral rules assigned to individuals are themselves not fundamental, as they must arise from a complex process of sensory signal transduction by each individual and subsequent internal decision-making. Some classes of bottom-up models attempt to take aspects of these internal processes into account explicitly.
Some of the earliest agent-based flocking models were developed in the computer-graphics community [4], with the goal of producing animations of group motion that looked realistic. Subsequently, the same general framework was adopted by the physics community with the goal of casting the emergence of collective motion as a kind of critical phenomenon [15], by analogy with the study of phase transitions. The focus of this work was primarily on groups that display unidirectional ordered motion (that is, flocks), but later research showed that changes to the interaction rules can produce other types of group motion such as toroidal mills or disordered swarms [16]. More generally, agent-based models have also been used to describe many forms of collective behavior beyond simple collective movement [17].
The primary goal of bottom-up modeling, however, is not simply to replicate the observed collective outcome, such as the shape of a group of moving individuals, but rather to explain how that outcome arises from the behavior of individuals and their interactions. For example, we would like to understand how interactions between individual birds give rise to the macroscopic ordered motion of a flock [18,19], or why rafts of interlocked fire ants display an effective viscoelasticity [20].
In physics, questions about collective outcomes of interactions among individuals fit the general paradigm of statistical mechanics. Originally developed to describe thermal systems, statistical mechanics is a core tool throughout condensed matter physics, and is extremely powerful for describing the properties of materials by appropriately averaging over interactions between their constituent atoms. The purview of statistical mechanics has over the past several decades expanded enormously beyond its traditional areas of application, and has proved to be useful in understanding a broad range of topics, both physical and nonphysical [9]. Researchers have attempted to apply the general methods of statistical mechanics to just about every problem involving large numbers of discrete degrees of freedom [9]. It is an obvious extension of this approach to use statistical mechanics to treat collective groups, where the degrees of freedom are the individual organisms. This is the core of the young subdiscipline of active matter physics.
Statistical mechanics is not, however, a panacea; there are many cases where its methods do not work. It is worth considering when and why this occurs, to be aware of the limitations of a statistical-mechanical approach to collective behavior. The central concept in statistical mechanics is that of an ensemble: instead of trying to predict the dynamics of a single system, we instead make statements about the average properties of a large number of identically prepared and constrained systems. Thus, the key to any statisticalmechanical approach is the specification of an appropriate ensemble. One classical way to do this is to appeal to conservation laws. For an isolated thermal system, for example, we expect that its total energy is conserved. An appropriate ensemble in this case is the microcanonical ensemble, the set of all configurations of the constituent molecules whose individual energies add up to the (conserved) total energy. We can characterize different thermal systems in this framework by specifying the relative likelihood of each of these configurations via a density of states. However, there are many cases where this approach fails. Without an appropriate conservation law, for example, defining an ensemble is often not possible, e.g., in highly dissipative athermal systems like granular materials [21]. In systems far from equilibrium, which is the rule for biological systems, defining an appropriate ensemble is difficult, because the macroscopic properties of such a system may change in time.
Unfortunately, both of these caveats apply in the case of collective behavior. Because each individual organism independently consumes and dissipates energy, we cannot in general assert any of our usual conservation laws such as energy or momentum. By the same token, life is inherently far from equilibrium; a biological system in equilibrium is dead. Thus, it is not obvious how to define an appropriate ensemble.
Modeling methods that originated in the study of hydrodynamics and liquid crystals (and that generally fall within the domain of nonequilibrium statistical mechanics) have been somewhat more successful in developing grouplevel descriptions of animal groups that exhibit net motion [8].
In this approach, one models the group with a small number of continuum fields rather than discrete individuals. The equations of motion for these fields can either be developed by coarsegraining over the discrete microscopic equations of motion, or sometimes simply by including all terms allowed by symmetry and setting their relative strengths empirically. This approach was notably recently applied to polarized human crowds [22].
To date, bottom-up, agent-based models have been quite successful in demonstrating that collective states can be generated only from simple local interactions. Such models can produce various kinds of group shapes reminiscent of those observed in nature. Advances in active matter are beginning to lead to an understanding of how these collective states arise and their properties. However, we must remain cautious about interpreting these successes as indications that simple bottom-up models accurately describe real biological systems. It is certainly tempting to do so, following intuition gained from decades of studying critical phenomena. Toy models such as the Ising model accurately describe the behavior of physical systems with much more complicated structure at the microscale because these systems are strongly constrained by conservation laws and symmetries. These constraints give rise to universality, so that in a formal sense toy models describe aspects of real physical systems exactly. Biological systems, however, need not respect conservation laws and symmetries, particularly at the whole-organism level. Thus, care must be exercised in trusting the predictions of simple agent-based models of collective behavior, particularly when they are extrapolative. And because formal theoretical arguments cannot guarantee that models predictions will be correct, validation against observational data is essential. Finally, we note that even such validation is fraught, and comparing the output of a model with the macroscopic behavior of a real system cannot definitively confirm that the mechanisms assumed in the model are correct. Collective behavior requires interactions and is thus inherently nonlinear, and nonlinear systems are rarely invertible.

Top-Down Modeling
An alternative approach, that is characteristic of classic methods in engineering, is to use a top-down approach to describe a collective process. The goal of such models is not to discover the underlying principles that govern collective behavior, but instead to specify how to generate particular collective outcomes. It goes without saying, of course, that employing this approach requires one to know what outcome is sought. Dynamical systems theory generally aims to predict the outcomes of dynamical processes, without necessarily specifying the behavior of each component. For example, control theory was developed to specify how the flow of work, such as in a factory, possibly involving many different operations, yields a rate of production and minimizes delays or optimizes some outcome [23].
The tools of dynamical systems theory have been used to model forms of collective behavior that regulate activity. For example, many physiological processes arising from chemical interactions and interactions among cells can be considered to be collective behavior within tissues. The kinetics of such processes describe how outcomes depend on concentrations of various components, without considering the details of how the components encounter each other and interact. For example, metabolic pathways depend on interactions among various molecular actors, and their collective behavior can be described in a top-down way [24,25].
Systems biology has developed the quantitative analysis of collective processes within and among cells [26]. In general, the dynamics of signaling pathways can be described with differential equations that specify quantities without examining the details of local interactions among the participants, ranging from transcription networks [27] to cell division. For example, Cheng and Ferrell [28] showed how, in the frog egg, a trigger wave works quickly in apoptosis by examining the change in the quantity of caspase moving across the cell. The dynamics demonstrate the mechanism; trigger waves occur faster than diffusion. This result is based on top-down modeling; the dynamics reveal the broad strokes of how the components of the system interact without describing the interactions themselves in detail.
Similarly, the study of population dynamics in ecology uses models of the outcome of interactions among individuals to explain collective processes in populations [29]. The Lotka-Volterra equations are a simple example. They describe how populations change as a function of numbers of individuals and amounts of resources in the environment, without addressing the details of the particular interactions that cause individuals to reproduce or die, or how birth and death are affected by available resources.
Here we present some examples from our own work of different approaches to modeling collective behavior.

Harvester Ants
Our investigations of the collective behavior that regulates foraging activity in harvester ants have primarily used tools from engineering to create top-down models that capture the goals and tasks of the ants.
First, we considered a model of spatial distributions of a population of harvester ant colonies. Harvester ants forage for scattered seeds and so do not use pheromone trails [30]. Colonies compete with neighboring colonies of the same species for foraging area [31]. A colony regulates its foraging activity in response to interactions with neighboring colonies and food availability. Colonies must regulate activity in response to the risk of water loss. Ants lose water to evaporation when out foraging in the desert sun, but obtain their water from metabolizing the fats in the food they eat. The extent to which one colony's foraging area overlaps with its neighbors' changes over a colony's lifetime, as colonies grow older and larger [32].
We modeled the spatial distribution of colonies to ask how competition among neighboring colonies generates the shifting spatial distribution of colonies [33]. Our goal was to capture the relevant interactions among colonies enough to predict how distributions change over time. Similar studies have been done to explain the collective outcome of spatial interactions among individuals in populations of sessile organisms that compete with their neighbors for resources, such as self-thinning in trees [34] or populations of termite colonies [35]. The basic parameter in our model was the spatial range of foraging by each age class of colony. The results show how the local neighborhood of colonies of the same species affects each colony's opportunity to expand its foraging area. A recent analysis of the effect of spatial distributions on colony foraging area and its survival supports the results of this model.
Harvester ant colonies regulate foraging collectively using local olfactory encounters. Ants smell with their antennae, and when one ant touches the antennae of another, it assesses the odor of the other ant. Ants, like many insects, spread long-chain fatty acids, cuticular hydrocarbons, on their bodies by grooming. These cuticular hydrocarbons help to prevent desiccation, and also carry specific odors. In the course of a brief antennal contact, one ant smells the cuticular hydrocarbon profile of the other [36]. Ants use the odor of cuticular hydrocarbons to recognize whether another ant is a nestmate and also to identify the task of the ants they meet.
A harvester ant forager waits inside the nest entrance between foraging trips. An outgoing forager uses the rate at which it meets returning foragers with food to decide whether to leave the nest on its new trip [37]. Because each ant searches until it finds food, the rate of forager return is a cue to food availability: more food means a shorter search time and a higher rate of forager return.
We developed a model to predict the rate at which outgoing foragers leave the nest, based on the rate of forager return [38].
We tracked the rates at which foragers left the nest and returned, including in field experiments in which we manipulated the rate of forager return. The parameters of our model were the rate at which foragers left the nest, which we treated as a Poisson process, and a variable that describes how much returning foragers stimulate the rate at which foragers leave the nest. Here we did not specify the dynamics or details of the interactions of outgoing and returning foragers. We used the data on the rate of foraging return, and the model, to simulate the rate at which foragers leave the nest. Our goal was to ask if this simple process was sufficient to predict the observed fluctuations in foraging activity. We found a good fit by the simulations with the observed rate at which foragers left the nest. The good fit between model predictions and data shows that it is plausible that the interactions of returning and outgoing foragers as they mix inside the entrance chamber generate the moment-to-moment rate at which foragers they leave the nest.
The model showed that overall the rate at which foragers leave the nest depends on the rate of forager return. We then looked more closely at the interactions of outgoing and returning foragers, to ask what is the process that individual foragers use to decide whether to leave the nest on their next trip. Each forager makes many trips in a day, and when it returns to the nest, uses its rate of encounter to decide whether to leave the nest. The encounters are antennal contacts in which it assesses the odor of the ant it meets.
We asked how a forager assesses its rate of antennal contact with other ants [39]. We used a leaky integrator model, based on drift-diffusion dynamics, from theoretical neuroscience. This choice of model was based on an analogy between ants and neurons. Just as a forager uses the rate at which it meets returning foragers to decide whether to leave the nest, so a neuron uses the rate of stimulation from other neurons to decide whether to fire. In neurons, the electrical charge leaks as it travels down the axon. We modified the leaky integrator model to explain the firing rate of neurons, to ask whether the decisions of outgoing foragers could be based on a similar process.
In our model, each encounter between a returning and outgoing forager stimulates the outgoing forager to leave the nest, and this stimulus has a decay. If enough encounters occur often enough, the stimulus reaches some stochastic threshold value and the forager is likely to decide to leave the nest to forage. We added another element to the model that does not apply to neurons. Experiments showed that when no foragers return for an extended period, about 8 min or more, the outgoing foragers leave the entrance chamber and go down to the deeper nest where they are not available to be stimulated to forage.
We were able to fit the model to data by developing a method in the field to film ant interactions inside the nest. This allowed us to obtain data on the rates of encounter of outgoing and returning foragers inside the nest, as well as the rates of encounter of ants that decided not to leave the nest on the next trip. These data fit the predictions of the model. These results show that it is plausible that a forager can assess interaction rate using a physiological process in which each interaction it experiences has a decay, and the decision depends on the accumulated stimulation from encounters over time.
Once we understood the dynamics that regulate a forager's decision to leave the nest, we were able to consider the regulation of foraging activity, and how it varies from day to day and among colonies [40]. Using a low-dimensional analytical model from control theory, we brought together the dynamics of different aspects of the system, including interactions inside the nest and foraging outside the nest [41].
The model brings together the encounters of foragers inside the nest as an open loop with the activity of foragers going out to search, retrieve seeds and return to the nest as a closed loop. It uses excitability dynamics to represent how outgoing foragers inside the nest respond to returning foragers to decide whether to leave the nest to forage, and then uses a random delay distribution to represent the activity of foragers outside the nest. The results show how feedback from outgoing foragers returning to the nest stabilizes the incoming and outgoing foraging rates to a common value determined by the volatility of available foragers. There is a critical volatility in the interactions of outgoing and returning foragers, above which foraging activity continues at a set rate, and below which foraging stops. Observations show that foraging activity adjusts to changes in temperature and humidity both within a day and from day to day. Our model suggests that these adjustments occur because foragers modify their volatility after they leave the nest and become exposed to the environment; a forager's experience on its last trip influences how it responds to encounters with returning foragers.
In these examples, modelling was used to investigate different aspects of harvester ant behavior. First, we considered how the interactions of foragers of neighboring colonies shape the spatial distribution of the population. Then a series of models, combined with field experiments, investigated the feedback that regulates foraging activity through interactions of outgoing and returning foragers. We found that interactions lead to individual forager decisions whether to leave the nest, through excitable dynamics. Then we combined these in a model that included both the excitable dynamics and the adjustment of volatility by foragers in response to the conditions they encounter outside. This series of modelling projects show the role of feedback across many timescales in the collective regulation of foraging activity, and helps to explain how evolution is shaping collective behavior through variation among colonies in individual response to interactions [42].

Arboreal Turtle Ants
Turtle ants form networks of trails in the canopy of the tropical forest. The network consists of a routing backbone that connects several nests of the same colony, along which the ants distribute resources, and temporary trails to ephemeral food sources. Ants lay pheromone trails as they go, and when they get to a junction, tend to take the edge with the most pheromone. The pheromone evaporates over time, probably with an exponential decay. While most ants follow the edge with the most pheromone, occasionally some ant takes a different edge, not the one most strongly reinforced. This allows for search and exploration, and also for repair of breaks in the vegetation that interrupt the trail network [43].
We asked what is the algorithm that the ants use to maintain and repair trails [44]. We modeled this as a distributed algorithm with two parameters: the rate of evaporation of the pheromone, and the probability that an ant leaves the trail to explore. We found that the parameter values most successful in simulations matched those from field observations [43]. This shows that this model is plausible because it is consistent with field observations. Next, we asked what objectives are optimized by the algorithm that the ants use [45]. Unlike species that forage on the ground and can go anywhere in a 2D plane, arboreal ants never leave the tree canopy, and so the configuration of their trail networks is constrained by the vegetation. We considered what objectives the ant networks meet by comparing the observed turtle ant trail networks with simulated networks of random, hypothetical trails in the same surrounding vegetation. We made these comparisons with trails optimized for different objectives: the shortest path, the path with the least number of nodes or junctions in the vegetation, and finally the path linking nodes with a 3D configuration most likely to be reinforced by pheromone. To consider the alternatives from which the ants choose a path, we used data from maps of trail networks, tracking the path through the tree canopy that the ants used, and also the vegetation around the path. We found that the ants' trails minimize the number of nodes traversed, reducing the opportunity for ants to get lost at each node, and favor nodes with 3D configurations most likely to be reinforced by pheromone, thus keeping the ants together on the same trail. The results showed that rather than finding the shortest path, turtle ant trail networks take advantage of natural variation in the environment to favor coherence, keeping the ants together on the trails.
Next, we examined in detail what algorithm the ants use to minimize the number of nodes or junctions in the trail network, although no ant can assess the length of the trail [46]. This asks what the details of the local interactions involving trail pheromone are that have the outcome that trails minimize the number of nodes, although no ant can assess the total number of nodes in the trail.
The model is a form of a reinforced random walk on a directed graph. The ants lay pheromone on edges and at each junction, choose an edge with the most pheromone. The pheromone decays with time. Ants travel both ways on the trail. Because there is a consistent small probability that some ants explore, or choose an edge that is not reinforced, every edge not taken is an opportunity for leakage, losing ants off the trail. We found that this process converges to the path with the fewest nodes bypassed when the rate of flow of ants in both directions is constant. However, when the flow rate increases, for example, due to the discovery of a new food source, it converges to the shortest path. We showed that the combination of forward and backward flow, with ants laying pheromone (without directional signal) in both directions, is necessary for convergence. Thus this model provides a plausible explanation for how collectively the ants can minimize the number of junctions in the path, or find the shortest path, although no ant assesses the path's length or number of nodes.
These modelling projects help to explain how colonies maintain and repair trail networks that link nests and food sources using only local information based on pheromone intensity at junctions in the vegetation, how the networks are shaped by the physical configurations of the vegetation, and which aspects of the process contribute to the coherence of the trails.

Midge Swarms
Chironomid midges, like most other species in order Diptera, form swarms spontaneously as part of their mating process. Swarms are composed entirely of males, and are thought to provide targets for females to find mates. These swarms are transient (tending to form at dawn and dusk based on lightlevel cues), and form over ground-based features known as swarm markers. Unlike flocks or mills, swarms are fixed in place, in that the group as a whole does not exhibit net translational or rotational motion; however, each individual is constantly moving. Since the vector sum of the (nonzero) linear and orbital angular midge velocities must vanish, the relative motion of the midges must be either highly structured or largely random. Empirically, the latter situation is what is observed. However, the motion of individual midges is not completely arbitrary, because they remain bound to the swarm. In the wild, swarms form in free space with no external constraints; thus, the swarm boundaries, which are surprisingly tightly regulated, are dynamically set, and depend most strongly on the number of individuals in the swarm [47]. More precisely, midges behave as if they are moving in a harmonic potential well that binds them to the swarm [47]. The strength of this effective potential scales with the number of midges in the swarm. This emergence of this effective potential is one of the signatures that swarming is indeed collective despite the difficulty of identifying specific interactions between individuals [48].
Because swarms do not obviously accomplish any collective tasks (aside from staying fixed despite environmental fluctuations [49] and acting as a target for females), most models of swarms are bottom-up. Building on the body of work done to understand the Vicsek flocking model [15], one popular avenue for modeling swarms has been to treat them as Vicsek flocks in the unpolarized regime, often with additional attractive interactions [16] or a confining potential [50,51] to keep them cohesive. However, this type of model makes predictions that do not agree with observations, displaying, for example, much stronger attraction to neighbors relative to other swarm features than is measured in real swarms [48] or suggesting that swarms may spontaneously polarize and become mobile flocks [51]. Part of the problem with these models may indeed be that they start by assuming that the collective behavior arises from direct interactions between neighboring individuals, even though evidence for significant interactions of this type is scant [48,52].
A different modeling approach that has been more successful in capturing observed features of swarms is to begin not by assuming a particular type of behavioral interaction, but rather by considering how midges sense each other. Midges in swarms interact acoustically, perceiving the sound of the wingbeats of other midges. Indeed, this is thought to be the primary mechanism by which midges distinguish males from females, as the fundamental wingbeat frequency is very different for males and females. Male midges transduce sound via their Johnston's organs, and to leading order, the strength of the sound signal they perceive will decay as the inverse square of the distance from the emitting source [53]. Inverse-square laws are, of course, very common-perhaps most notably in gravitation. This observation led us to model swarms as a kind of self-gravitating system [53][54][55][56][57], following a line of reasoning that goes back to Okubo [58]. This framework is very appealing, as it allows us to translate intuition gained from studying gravitation to collective behavior. Several observed features of swarms also naturally arise in a gravitational model. Gravitational systems are, for example, naturally bound together, but local interactions are difficult to discern because gravitational forces are long-range. Additionally, multi-body gravitating systems are well known to allow for chaotic motion, so that the random and disordered nature of the motion of individuals in the swarm can be captured without needing to build it into the model explicitly.
A simple, purely gravitational model, although qualitatively reasonable, does not quantitatively capture the structure of real midge swarms [56]. However, we found that we can improve the model by making an addition that is also grounded in biological sensing. Most biosensors do not have a fixed gain; rather, to avoid damage and improve sensitivity, their gain adapts to the input signal strength. This typically occurs via the so-called fold-change detection mechanism [59], also known as Weber's law. In the case of a gravitational swarm model, incorporating adaptivity means that midges that are not too close to their neighbors primarily respond to the net contribution of all of the other midges in the swarm, while those that are close to neighbors respond primarily to these nearby midges [53]. Note that this renormalization of the effective force felt by individuals also formally makes the model many-body, in that the adaptive force cannot be decomposed into the linear superposition of the contributions from each individual midge.
Whether implemented in a deterministic way [53,54,56,57] or via a stochastic modelling framework [49,55,60,61], adaptivegravity models of swarms correctly reproduce many features of midge swarms. Model swarms display an emergent harmonic potential, as they must given the form of the gravitational interaction; but with adaptivity, they also reproduce the observed weakening of the strength of the potential with increasing swarm size [53]. They also reproduce the heavy tails seen in the acceleration distributions [53,60] and the distinct behavior of midges in the swarm core as compared with those on the swarm periphery [60,62]. What is perhaps more unexpected, since these adaptive-gravity models do not explicitly model direct interactions between individuals, is that such models also reproduce multipoint properties of swarms. For example, they display similar transient pairing of individuals as has been observed in real swarms [52,57]. Adaptive-gravity swarms also display similar material-like properties such as effective viscoelasticity [60,61].
To summarize, because the general function of swarms is not fully understood, we approached modeling them from the bottom up. Our primary goal was to understand a specific feature of the swarms, namely the emergence of the effective potential that binds swarms together and the way in which this potential varies with swarm size. Appealingly, our models also reproduced other empirical features of midge swarms. However, the models are certainly not full descriptions of the biology; for example, these models cannot shed light on the biological function of swarming.

Jackdaw Flocks
Jackdaws (Corvus monedula) are a highly social, colony-breeding corvid. In the winter, when there are no young in the nest, they roost together nightly in communal trees. At dusk, they form large "transit" flocks to travel from their daytime foraging grounds to their roosts. These flocks are highly polarized, in that the flight directions of all the individuals in the flock are close to uniform. In that sense, jackdaw transit flocks are qualitatively similar to those other species of flocking birds that have been studied such as European starlings. Unlike starlings, however, jackdaw societies are highly structured; in particular, they are known to form lifelong monogamous pair bonds [63]. Paired birds not only remain in close proximity during foraging and nesting, but also qualitatively appear to fly together during flocking [64]. Quantitative statistical analysis of jackdaw transit flocks confirms the presence of paired birds, which tend to remain unusually close together along their entire flight trajectories [65].
Agent-based, bottom-up models that assume a tendency for individuals to align their motion, such as the classic Reynolds [4] or Vicsek [15] models, were first introduced with the intent of capturing the behavior of bird flocks. Testing of these models, however, occurred only many years later, due to the difficulty of collecting detailed measurements of bird movement. Nevertheless, when tested on starling flocks, these models have been shown to perform reasonably well. They not only capture simple features of the flocks, such as their high degree of polarization, but also more subtle properties such as their long-range, scale-free velocity correlations [66,67]. To achieve agreement between the model and the data, however, one significant modification was required-not to the way in which individuals interact, but rather to which individuals interact. Standard agent-based models such as the Vicsek model assume that a given individual responds to all others that lie within some distance of it. This way of determining the interaction range is described as being metric, because it depends on real, physical distance. Flocking starlings, in contrast, were found to respond to a specific number of neighbors (six or seven, empirically), regardless of their distance [68]. This kind of interaction range is termed topological, because it does not depend on distance.
In many ways, jackdaw transit flocks appear to be similar to starling flocks. Like starling flocks, they are highly polarized and exhibit long-range velocity correlations [65]. Jackdaws in transit flocks also interact via a topological distance. An individual's topological range, however, depends on whether it is part of a mated pair or not: paired birds interact with three to four others, while unpaired birds interact with seven to eight [65]. This difference has group-level consequences, as the correlation length decreases monotonically with the fraction of jackdaws in the flock that are paired. Because the correlation length can roughly be taken to be a measure of the global responsiveness of the flock, this result suggests that the more paired birds a jackdaw flock contains, the less effectively that flock can detect and evade predators. This effect can be reproduced by a Vicsek-style model with a topological interaction rule and two classes of individuals Frontiers in Physics | www.frontiersin.org with different interaction ranges [65]. Pairing thus appears to have an adverse effect on the group behavior, in a way that can be captured by simple modeling. That finding led us to question whether pairing also carries some advantage. And indeed, in addition to any benefits that long-term pairing may convey when not flocking, paired birds also gain individual benefits from pairing when participating in transit flocks. An analysis of the wingbeat frequencies of paired and unpaired birds shows that paired birds beat their wings more slowly on average, and thus expend less energy flying in the flock than their unpaired conspecifics [65]. This effect is not captured by simple Vicsekstyle agent-based modeling, since such models do not consider energy expenditure; rather, self-propulsion is simply assumed at no cost to the individual. Jackdaws in the winter roosting season, in contrast to the summer nesting season, roost in separate nests while taking care of their young, and transit flocks do not form. However, even in this season jackdaws will come together when responding to distinctive scolding calls to mob predators [69]. This behavior can be induced using model predators and playbacks of recorded scolding calls [70].
Mobbing flocks are qualitatively different from transit flocks. Paired birds, for example, are not evident, presumably because one member of each pair remains in the nest with the young. The more significant difference between mobbing and transit flocks, however, is that the interactions among individuals in mobbing flocks occur over metric rather than topological distances [70]. Rather than interacting with a fixed number of neighbors, jackdaws in mobbing flocks align their motion with neighbors over a real physical distance, perhaps because they need to be careful about keeping their distance from the predator. This difference has consequences for the structure of mobbing flocks. Whereas transit flocks do not show a qualitative dependence on flock size, small mobbing flocks are loose and disordered while large mobbing flocks are dense and polarized [70]. The development of this large-scale order as the flock density increases is captured remarkably well by the Vicsek model using a metric distance [71].
When tested against quantitative observational data, bottom-up, agent-based models thus capture a fairly broad range of the features of jackdaw flocks. In particular, we were able to use modeling to assess the likelihood that pairing (and, more generally, differences in local interaction range and type) was responsible for the decrease in correlation length that we observed. However, the results described here also illustrate the limitations of such models. In particular, the observation that jackdaws in transit flocks interact via topological distances but use metric distance in mobbing flocks dispels any notion that there may be a single model for bird flocks, or even a single model for a given species. Ecological context is an essential factor for designing appropriate models, and cannot be ignored.

DISCUSSION AND CONCLUSION
These four examples illustrate how different modeling approaches can be used to address questions about collective behavior in biological systems. For both harvester ants and turtle ants, we know at least some of the functions that the collective behavior performs: the regulation of foraging in the case of harvester ants, and the construction and maintenance of trails in the case of turtle ants. For both of these examples, modeling shows in a simplified way how these distributed systems can accomplish these tasks given only local information. For both midge swarms and jackdaw flocks, however, the situation is somewhat different because the purpose of the collective behavior is less clear. The role of modeling in these examples thus cannot be to explain how the group achieves a task. Instead, in the case of midge swarms, we used models to describe the nature and properties of their non-random aspects. For jackdaws, we used models to understand the consequences of differences in local interactions between different individuals and of different ways of determining interaction distance. Importantly, in none of our examples did we attempt to create a single, complete model for the collective behavior; rather, our models were designed to ask specific questions or test specific hypotheses.
We argue that this approach, recognizing the limitations of models and deploying them in targeted, judicious way, is not simply an expression of ignorance but instead is a necessary consequence of the characteristics of biological systems. Biology is not physics. Organisms are not all the same, and even single individuals do not always respond the same way to stimuli. However, these variations are not purely stochastic, but rather are influenced and biased by many factors. The powerful constraints of conservation laws and symmetries that give rise to universality in physics simply do not apply to biological systems. Additionally, the types of questions that are pertinent to a biologist are different from those typically asked in physics. For physicists, the consequence is that there will probably never be a single unified model of collective behavior in biology, or even of the simpler problem of collective movement. Instead, we must acknowledge that the goal of models based on the physics approach is to explicate general principles of how global properties can arise from local interactions, and perhaps to constrain what kinds of properties are possible, while making it clear that such models are not intended to reproduce the details of any particular biological system. All models are limited and imperfect. Biologists will not be able to take a model off the shelf and apply it to a new system. Instead, we can bring together the modeling tools from different approaches to learn more about how collective behavior operates, and to identify for further investigation the processes that we do not yet understand.