The geometry of decision-making in individuals and collectives

Significance Almost all animals must make decisions on the move. Here, employing an approach that integrates theory and high-throughput experiments (using state-of-the-art virtual reality), we reveal that there exist fundamental geometrical principles that result from the inherent interplay between movement and organisms’ internal representation of space. Specifically, we find that animals spontaneously reduce the world into a series of sequential binary decisions, a response that facilitates effective decision-making and is robust both to the number of options available and to context, such as whether options are static (e.g., refuges) or mobile (e.g., other animals). We present evidence that these same principles, hitherto overlooked, apply across scales of biological organization, from individual to collective decision-making.

Jijσiσj [1] where, k is the number of options available to the animal and Jij is the interaction strength between spins i and j. A positive 69 Jij indicates an excitatory interaction between spin i and spin j while a negative Jij indicates an inhibitory interaction. 70 Here, we assume that interactions are excitatory when spins encode a similar directional preference, and inhibitory when 71 they encode conflicting directional preferences. This captures both explicit ring-attractor networks, with local excitation and 72 long-range/global inhibition (as found in fruit flies, and other insects (16)), and computation among distributed competing 73 neural groups (as in the mammalian brain (23)). The locality of excitatory interactions encoded by Jij, or directional tuning of 74 the spins is given by the tuning parameter ν. Here, Jij is given by where, θij is the angle between preferred directions of spins i and j, and ν represents the neural tuning parameter. For ν = 1, 76 the interactions become "cosine-shaped" Jij = cos (θij), and the network has a Euclidean representation of space (Fig. S1). For 77 ν < 1, the network has more local excitation and encodes space in a non-Euclidean manner (Fig. S1). For sake of simplicity, 78 we assume a fully-connected network. At each timestep, energy of the system H is minimized using the Metropolis-Hastings 79 algorithm i.e. a change in neural state σi is dependent on the change of energy (∆H) that accompanies it. where P (i) 1→0/0→1 is the probability that a spin switches its state and ∆H = H2 − H1 where H1 is the energy of the system 81 before the spin changes its state and H2 is its energy after the change in state. This is akin to other Ising spin models where 82 the temperature parameter T is interpreted here as neural noise. The agent then moves with a velocity V determined by the 83 normalized sum of goal vectorspi of all active spins.
where v0 is the proportionality constant. The agent moves along V and spins update their goal vectorpi to reflect the agent's where, f (θij) is the probability density at θij from a normal distribution N (0, σ θ 2 ) and θij is the deviation in the preferred 155 direction of spin i from the center of target j. Effectively, a discounted spin in the decision-making ensemble and a spin that 156 does not fire i.e. σi = 0 are treated identically. Fig. S4 shows results from a model with and without implementation of the shows these results in an asymmetric setup as discussed above. 159 1.7 Mean-field approximation. Here, we present a mean-field approximation of the same neural decision-making model described 160 in section 1.2. This model largely draws inspiration from spin models used in physics, primarily to explain magnetism (1,27). 161 As analogy, neural activity here akin to spins in these models, excitatory neural interactions are described as being ferromagnetic 162 and inhibitory interactions as antiferromagnetic. 163 In our model the N spins are divided into k equal groups Gi(i = 1, . . . , k), where k is the number of options (potential 164 targets in space) available to the animal. The fraction of the total number of spins that are active towardspi is given by Then we can rewrite equation [4] in the following way The rule by which a spin switches its state from inactive (σi = 0) to active (σi = 1) is constructed such that the spin is 167 more likely to be active if the animal is already moving in that direction. This can be expressed by Glauber dynamics (28). where r (i) 1→0 is the rate in which a spin in group Gi changes from "active" state to "inactive" and r (i) 0→1 is the rate of the opposite 169 transition, from "inactive" to "active". r0 is a constant rate which we set to one. The model also includes noise in the neural 170 system i.e. the rate at which spins will switch states spontaneously independent of the collective dynamics involved. This is 171 analogous to the temperature parameter that introduces randomness in the spin-flipping dynamics. Then the equations of 172 motion (master equation) in the limit of N 1 are We rearrange the above equation [10] to get 174 dni dt = 1 The steady state solution of this equation can be written as the solution of the following system of algebraic equations The system of equations that including k equations [12] and the 2 equations [8] in 2D is our basic system that gives us as its 176 solution the velocity V and the fraction of active spins in each group ni at steady state. We will henceforth refer to this system 177 as the "model equations". 178 When the targets are at infinity, the angles between the targets are constant, and the Hamiltonian is time-independent and 179 describes a system in equilibrium. We now examine the simplest case of two targets at infinity, i.e. where k = 2 andp1 andp2 180 are fixed. In this case, there exists a symmetric solution that describes a compromise between the two targets. which always has a solution for (0 < θ < π; 0 < T < 1). In the three-choice case (k = 3), we get a similar compromise solution 183 when the targets are radially symmetric,p1 ·p2 =p3 ·p3. 184 When the angle is large enough (θ > θc) and the temperature is low enough (T < Tc), there exists a second non-symmetric 185 solution to the model equations that we term "decision" as it describes breaking the compromise between the targets and . where,n 0 is the normal to V0. Substituting into equation [15], expanding to first order in and taking the normal component, 202 we get the following equation for the perturbation .
Therefore, the solution V = V0 is stable if A > 0 and unstable if A < 0. Hence, the curve A = 0 for the compromise solution 204 is the spinodal curve. can be written as When we decompose the velocity to the initial velocity and the small perturbation vn in the normal directionn 0 in which case, the susceptibility χ (at constant temperature) is given by [21] We substitute the decomposition equation [20] into the normal component of equation [19].
Taking the derivative at vn = 0 yields Using the definition from equation [18] and the fact that d( V ·n 0 ) = dvn, we can write the susceptibility as Vivek H. Sridhar, Liang Li, Dan Gorbonos, Máté Nagy, Bianca R. Schell, Timothy Sorochkin, Nir S. Gov and Iain D. Couzin 7 of 41 Thus, susceptibility diverges when A → 0, i.e. on the spinodal curve (see Fig. S5). Based on this analysis, we arrive at the conclusion that maximal susceptibility is obtained when the bifurcation occurs at the highest possible angle-as late as 218 possible from the perspective of an animal approaching the different spatial targets. 219 1.7.2 Short-time response function. Let us consider that our system of N spins is in the averaging/compromise regime. Since the 220 order parameter of the system is the velocity component in the direction normal to the movement direction, we will denote it 221 by Vn, so that a change in the direction of the movement will be a result of Vn = 0. At t = 0, we add a single spin that encodes 222 direction to one of the targets, sayp1. The short time response of the system is defined here as the response of the system as 223 manifested in a change of the order parameter Vn in a very short time, so short that it allows for only one spin to switch states.

224
In other words we are looking for a change δVn over the firing time of a single spin δt as a result of bias introduced by the 225 additional spin. In doing this, we generalize a similar calculation that appeared for a one dimensional spin model in (27) First, we consider a simple limit T → ∞ where there is no response. The probability of a spin in the group i to be in the 229 active state (σi = 1) is given by which in the limit T → ∞ gives 1/2. We add a single spin that encodes direction to the target pointing towardsp1. Therefore 231 it contributes to Vn according to equation [25]. In order to find the contribution of the rest of the spins in the decision-making 232 ensemble, we have to multiply the probability that each spin is active (which is 1/2 without response) by the number of spins 233 in the group and the contribution of one active spin according to equation [25]. We therefore get When the targets are symmetric with respect to the direction of movement, the first term in equation [27] vanishes, and we where θ is the angle between the targets in the case of two targets, and the angle between the leftmost and the rightmost 237 targets in the case of three targets.

238
Now let us return to the response of a single spin over time δt. At t = 0, we introduced an additional spin that encodes 239 directionp1. Prior to any response, equation [27] gives the expression for Vn. We can write the contributions of the change in 240 state of all spins in the ensemble in the following way which gives us the response of the system.
Let us assume that we start from the symmetric compromise solution for t < 0, so that Vn = 0, and thus at t = 0, Vn is 243 still small. Then we can look at it as a small perturbation of V (0) according to equation [19], and obtain to first order in the 244 perturbation vn where A is given in equation respectively. Now let us look at response due to the same bias that is introduced at t = 0, but Vn(t < 0) = 0 as it is essential in order to 250 calculate the response function after the first bifurcation. In this case, Vn is not small and there is a response for t < 0. We 251 can add the additional spin that encodes directionp1 in the following way where we denote V (t < 0) = V0. We can write the response to this additional spin at t = 0 over the very short time δt in the 253 following schematic form where P (1) i,0→1 is the firing probability of an inactive spin in group Gi as a response to bias introduced by the additional spin that 255 encodes directionp1, and P (1) i,1→0 is the probability that an active spin in group Gi turns off as a response to bias introduced by 256 the additional spin.
where N/k is the number of spins in group i, P (i) is the probability of having an inactive spin at t < 0 in group Gi, is the probability of having an active spin at t < 0 in group Gi, is the probability of a spin to become inactive at t = 0 in group Gi, is the probability of a spin to become active at t = 0 in group Gi, is the probability of having an inactive spin at t < 0 in group Gi, that becomes active at t = 0, 1→0 (t = 0) is the probability of having an active spin at t < 0 in group Gi, that becomes inactive at t = 0.
where A is given by equation [18]. Also in this case we see that the response is maximal when A = 0, namely at the spinodal on the verge of instability (see Fig. S5). (4, 31) are motivated by head-direction cells found in the brain of both vertebrates (23, 33) and invertebrates (16, 30). They 266 are known to underlie the representation of instantaneous heading direction of an animal in the horizontal plane regardless of 267 its location and ongoing behavior (34). When animals are exposed to a prominent landmark, an activity bump appears on a 268 specified sector of the ring, and rotates concurrently with the landmark as the animal turns towards it (30). Upon introduction 269 of a second landmark, this activity bump was found to either 'flow' or 'jump' to, and stabilize at, a new location. The exact 270 nature of the bump shift ('flow' or 'jump') was found to be dependent on the angular distance of the new landmark from the 271 older one (16). All these dynamics are captured by neural ring-attractor models. We follow the general structure of the neural 272 ring-attractor models presented for example in (5) and (32).

273
In the ring-attractor model, neural firing rate is described in a continuous formulation by a single scalar function m(θ, t) 274 which is a function of the preferred angle θ and time t. The model is essentially one-dimensional with ring topology, and the active spins in the mean field limit, and below we show that our model is within the class of neural ring-attractor models.

282
The dynamics of the firing rate is expressed schematically by the following equation where g is a non-linear function which describes the gain of a spin from the input which can further be split into interactions 284 with rest of the network I(θ, t) and external input X(θ, t) and τ is a time constant that sets the time scale of the dynamics of 285 the system (32). The gain function g is usually taken to be Heaviside step function (5, 32).

286
Interactions with the rest of the network are usually given as a convolution of the following form where the function J describes the relative weights of the neurons in the network. It commonly takes the form of a Ricker  Let us consider N spins at each point of the ring. In this regard we take a continuous limit of the neural model, and in the 297 end we consider the mean field limit, which means in particular taking N 1.
J is the interaction strength which is assumed to be equal for all spins in all to all interactions. The interactions here (first 299 term in [40]) are considered to be as the regular scalar products between different directions (pi(θ, t) ·pj(θ , t)) which can be network. The stimuli represent the targets that positioned at the anglesθ l (t). We assume that they induce a very narrow 305 distribution of external field centered at θ =θ l (l = 1, .., k), that we write them here with delta functions.

306
In order to obtain the free energy in the mean field limit we can rewrite the Hamiltonian in the following way We are following here the procedure that was used for the one dimensional Curie-Weiss model (see (38), chapter 13) and 308 was applied in the context of a similar spin model Hamiltonian in (1) for the case of two targets. The partition function for the 309 Hamiltonian is Since the system is two-dimensional, let us introduce two auxiliary fields V ≡ (Vx, Vy) and using the Gaussian identity where we take We can write the partition function in a form which is linear in σi In the limit of large N the partition function is dominated by where n(θ) is the fraction of active spins defined by n(θ) ≡ 1 N N i=1 σi(θ). Summing over the possible states of the spins we get where Dθ ≡ α dθα over all angles.

316
Then we can read the free energy per spin F ( V , T ) from the general form The effective result of this construction is that at each value of θ along the ring we obtain a separate contribution to the 319 equation of motion in the mean field approximation. From the equations of motion ∂F ∂ V = 0 we get the steady state solution and according to equation [46] we identify the fraction of active spins at steady state to be 321 n(θ, t) = 1 We see here that indeed if the global inhibition is high, n(θ, t) → 0, except for θ =θ l (l = 1, .., k).  in animal groups (43) to a multi-choice decision scenario. In the absence of any feedback mechanism, we find that this model will 331 fail to produce the bifurcation patterns observed in our data. However, previous work has shown that uninformed individuals 332 (those without a desired direction of travel), to some degree, are able to provide this feedback, at least when the group is 333 deciding between two options (43)). However, because the uninformed individuals are recruitable by informed individuals with 334 different desired directions of travel, they primarily function to keep the group together, and fail to provide the necessary 335 feedback in the three-choice context ( Fig. S19. Thus, the group will almost always approach the central target. By introducing 336 feedback on individual goal-orientedness as a function of their experienced travel direction, we are able to produce all bifurcation 337 patterns observed in our experimental system, in the presence of two, and three, options. With these feedback mechanisms in 338 place, the model predicts that animal groups, like the brain, will break multi-choice decisions to a series of binary decisions (see neighbours within a certain distance from them. They turn away from nr neighbours encountered within a small repulsion 345 zone of radius rr. This represents collision avoidance and maintenance of personal space, and as is apparent in real animal 346 groups, takes highest priority. where di(t + ∆t) represents the individual's desired direction of travel in response to conspecifics. If no neighbor is present in 348 this zone, the focal individual is attracted to and aligns with na neighbours within a larger interaction zone of radius ra.
Vivek H. Sridhar, Liang Li, Dan Gorbonos, Máté Nagy, Bianca R. Schell, Timothy Sorochkin, Nir S. Gov and Iain D. Couzin 13 of 41 Here, di(t + ∆t) is subsequently converted to the corresponding unit vectordi(t + ∆t) = di(t + ∆t)/|di(t + ∆t)|. To incorporate target preferences, individuals are given information about a preferred direction. Each individual is attributed a 351 goal vector gi(t) that points to one of the targets amongst which the group must choose. For sake of simplicity, we assume all 352 individuals have a preferred target, and that the number of individuals with preference for a given target is the same as the 353 number of individuals with preference for any other target. Individuals balance this personal preference with social interactions 354 using a weighting term ω to give their desired direction of travel.
Motion of all individuals is subject to noise (error in movement and/or sensory integration) which is implemented by rotating 356 di (t + ∆t) by a random angle chosen from a circularly wrapped Gaussian distribution centered at 0 and of standard deviation 357 σe. Once the desired direction is determined, individuals turn towards di (t + ∆t) with a maximum turning rate of ψ∆t. 358 As in (43) opposing directional preferences by decreasing their ω. 363 We also perform simulations without feedback on ω to emphasise that this is an essential feature for the model to produce was still maintained at 5 units but successive targets were now placed 40°apart. The targets were now located at (3.83, -3.21),

372
(5, 0) and (3.83, 3.21). All individuals were assigned a preferred target randomly such that each target had equal number of 373 individuals whose goal vector pointed to it. We ran simulations with and without feedback on the ω term to show that this 374 feature is essential to produce such patterns (Fig. S19). We ran 500 replicate simulations for each condition and each replicate 375 run was considered successful when the group reached a given target without splitting. In order to minimize group splits, 376 these simulations were run with 12 informed individuals having preference each target. The remaining individuals (36 and 24 377 individuals for the two-and three-choice simulations respectively) were considered 'uninformed' and exhibited no preference to 378 any target.  fruit-fly to "want" to flap its wings and fly. iv) The fly did not perform the stripe fixation task. was determined from an SQLite database that was generated automatically (see experimental design for details). Pillars that 408 were not part of the current stimulus were placed at >100 m distance where they were visually occluded by the cube.

Data collection.
Tethered Drosophila melanogaster were exposed to either a two-choice or a three-choice decision task in the 410 virtual reality environment. Each experimental trial lasted 15 min where flies were exposed to five stimuli-three experimental 411 stimuli and two control stimuli. The experimental stimuli consisted of two or three cylinders (depending on the experimental 412 condition) that were presented to the animal in three different angular conditions. The order in which the stimuli were 413 presented were randomized. The control stimulus was presented before and after the experimental conditions. This was a stripe 414 fixation task where the fly was exposed to a single cylinder and was expected to orient and fly towards this cylinder. This is 415 a well-known response in tethered Drosophila and flies that did not perform this were excluded from further analyses. The all experiments. A total of 60 flies were tested in the VR setup. Of these, 30 flies were exposed to a stimulus that consisted 421 two targets, and 30 flies were exposed to a stimulus that consisted three targets. Our analyses include 70% and 74% of all the 422 tracks adopted by flies in the two-choice and three-choice decision-making scenarios respectively. The remaining tracks were 423 excluded because these were trials where none of the targets were approached by the fly within the remaining experimental 424 duration, and hence, were considered to not constitute a decision-making scenario. (based on the two-choice results). Next, to quantify the decision points, we fold the data about the line of symmetry, y = 0. 434 We then applied a density threshold to the time-normalized (proportion of maximum across a sliding time window) density 435 plot to reduce noise and fit a piecewise phase transition function to quantify the bifurcation.
where xc is the critical bifurcation point, α is the critical exponent, and A is the proportionality constant. To avoid bias in the 437 fit that arises from y = 0 part of the data (to the left of the bifurcation), we exclusively fit the above function in a range starting 438 near to the suspected bifurcation point. For the three-choice case, the piecewise function is fit to each bifurcation separately.

439
Additionally, for each bifurcation we also performed randomization tests where we repeated the exact fit procedure described

Data collection.
The data collection procedure for the desert locusts was identical to the procedure adopted for flies (see 475 Section 3.4) except each experimental trial lasted 48 min-the three experimental stimuli lasted 12 min each, and the two 476 control stimuli lasted 6 min each. As with the flies, the control stimulus was a stripe fixation task for the two-choice experiments.

477
For the three-choice experiments, however, this was modified to be a two-choice decision task. A total of 156 locusts were 478 tested in the VR setup. Of these, 57 locusts were exposed to stimulus that consisted two targets, and 99 locusts were exposed 479 to a stimulus that consisted three targets (see Fig. S12 for locust trajectories during decision-making in the presence of two direction where it is facing, we exclude any animal that stops flying (flapping its wings) more than five times. The locustVR 487 however is designed for freely walking animals. Hence, the animal is free to stop, and not move towards any of the targets 488 presented to them. Because, the animal did not choose any of the presented targets, we consider these tracks to not constitute 489 a decision-making scenario.  3. Since we are interested in which conspecific(s) the real fish will follow, we exclude all data where the angle between the 533 real fish's direction and the virtual fish's direction (φ) is larger than 30°.

536
A total of 440 fish were tested. Of these, 198 fish were exposed to decision-making with two virtual targets, 39 fish were 537 exposed to decision-making with three targets, and 50 fish were exposed to decision-making with three targets in asymmetric 538 geometry. In the two-choice case, the real fish experienced five different virtual fish speeds. Our analyses focus only on data 539 where the virtual fish swim at an average speed of 4 cm/s, the average swim speed of larval zebrafish. For the experiments 540 in asymmetric geometry, the real fish was exposed to choice experiments where distance between the center virtual fish and 541 its closer neighbor was 0.03 m and its distance to the other neighbor was 0.09 m (see main Fig. 4). Note that the left-right 542 position of the two fish closer to each other was randomized, indicating that this pattern did not result from handedness in 543 individual fish. We also conducted experiments where the real fish was exposed to a single virtual fish, or where two real fish 544 were tested in pairs with no stimuli. 39 fish were exposed to a single virtual fish while 114 fish were tested in pairs (57 pairs) 545 and without stimuli. When real fish were tested in pairs, data were filtered to only consider cases when the two fish maintained 546 a distance of 0.5 cm to 20 cm between them (tracking accuracy reduced at distances closer than this). Relative 3D positions 547 were then collected by reorganizing the follower's position in the leader's coordinate frame (all relevant filters used in the 548 virtual fish case were also used here). Comparing these two cases-two real fish compared to one real fish swimming with 549 one virtual fish-we find that in the VR, and otherwise, the two fish swim on the same plane (Fig. S17). Hence, all further 550 analyses for decision-making were conducted on this plane in 2 dimensions.

563
Testing our model predictions experimentally is expected to be difficult. If we are correct, by far the clearest window into the 564 system dynamics will be when animals are presented with two, or more, identical options. This is due to the fact that the very 565 reason that the brain should exhibit bifurcation dynamics-to maximize sensitivity-will also result in amplification of subtle 566 differences between options to obscure our ability to see the underlying system bifurcations. The fact that the experimentalist 567 may often be unaware of such differences (such as a slight air motion, or light gradient, or other differences imperceptible to 568 humans), and that these differences can break the symmetry (between apparently identical options) makes these experiments configurations. An especially interesting case here is one where the targets are in radial symmetry-two targets 180°apart 576 or three targets 120°apart. Once again, we find congruence among predictions of our neural model, the animal collectives 577 model and behavioral experiments with flies (Fig. S9). Because these symmetric conditions represent cases where the animal is 578 already beyond the bifurcation angle, we find that it goes straight to one of the available targets. Further, to illustrate model 579 results beyond three targets, we also ran simulations for four, five, six, and seven targets. Once again, our predictions hold and 580 the agent continues to eliminate targets based on egocentric geometry, thus binarising its decisions (see Fig. 2 in main text).

582
Based on direct comparison with experimental results from fruit-flies (Drosophila melanogaster), desert locusts (Schistocerca 583 gregaria) and zebrafish (Danio rerio), we conclude that "cosine-shaped" interactions cannot explain trajectory patterns observed 584 in real animals; that the brain represents space in a non-Euclidean fashion and excitatory interactions among neurons are more 585 local (Fig. S1). Beyond this, the bifurcation patterns observed are agnostic to the exact nature of neural interactions. We 586 illustrate this by using truncated Ricker wavelet (Mexican hat-shaped) neural interactions that produce similar predictions 587 at the level of animal movement (Fig. S1). We specifically chose this function as it has been shown to represent orientation 588 selectivity in neurons of the visual cortex (52).
where, A is the amplitude of the Ricker wavelet/Mexican hat, θij is the angle between preferred directions of spins i and j, h is  Angle subtended by targets on the agent (θ) Neural interaction strength ( Jij ) Angle subtended by targets on the agent (θ) Neural interaction strength ( Jij )  (B) Effect of the starting distance to the targets on the critical bifurcation angle. We fit an exponential decay to the points to obtain the critical angle (represented here as a dotted line). (C) The neural tuning parameter (ν) also influences the bifurcation angle. Here, the angle flattens at 60°(represented by the dotted line) as this is the starting angular condition where the agent is initialized. (D-E) Minor difference between the targets causes the agent to choose the correct target with near certainty. The slope of the sigmoid indicates sensitivity of the system. D shows this sensitivity in the presence of two targets while E shows this for the three-target case. Here, we separate sensitivity to the center target vs sensitivity to a side target. As shown, the agent is equally sensitive to all three targets in its environment. See Table S1 for model parameters used here.  Table S1 for parameters used.  Table S1 for parameter values used in A and C. B and D were produced with identical parameters except the neural noise parameter T = 2.0. in Euclidean space. Panels A and D show results for two-and three-choice decision-making from a collective decision-making model, B and E show results from our neural decision-making model, and C and F show experimental results of fruit-flies exposed to two and three identical targets respectively. See Table S1 for parameters used in A and D, and Table S2 for parameters used in B and E.   S12. Characterisation of desert locust tracks at the individual and population level when exposed to two and three targets. A and J show consistency in individual behavioral tendencies in exhibiting either direct, non-direct or wandering tracks. (B-I) present raw trajectories (B-E) and density plots (F-I) of locusts exposed to two targets. The axes represent x− and y−coordinates in Euclidean space. B shows trajectories where the locust reached the target in a relatively short duration, where trajectories to the targets were relatively direct, D shows trajectories where the locust took long to reach the target, where trajectories to the targets were noisy, and C shows the remaining trajectories. F-I show the corresponding density plots, normalized such that the maximum intensity in G is set to 1, and in F and H is set to the proportion of trajectories in G relative to this condition. E and I show the raw trajectories and the normalized density plot for all locust experiments combined. Similarly, K-R present raw trajectories (K-N) and density plots (O-R) of locusts exposed to three targets. K and O show direct trajectories to a target and the corresponding density plot, M and Q show noisy trajectories to a target and the corresponding density plot, and L and P show the remaining trajectories that potentially exhibit the bifurcations, and the corresponding density plot. N and R show raw trajectories and the density plot for all locust experiments combined. Note that the three-choice trajectories here are symmetrized for the sake of visualization. Our conclusions do not differ when we include all the locust data. To show this, we fit the piecewise phase transition function (shown in black) to density plots I and R. used to characterize the animals' direction of movement-the green arrow represents the animals' velocity vector, the black dotted line is their current direction of movement, α1 and α2 represent movement direction relative to the two targets and φ represents movement direction with respect to the average of the egocentric target directions. The grey dashed line is the perpendicular bisector of the line connecting the two targets. All animals start their experimental trial at a fixed distance from the targets on this line. (B and D) Before the bifurcation, both flies and locusts tend to direct their movement directly towards the average of the egocentric target directions (φ). Thus, they do not fixate on either target. Beyond the critical angular difference, however, (C and E) they switch from directing their motion towards the average of the target directions, to fixating on one, or other, of them and thus exhibiting directed motion towards the selected target (in the direction of α1 or α2 to target 1 or target 2 respectively). The second peak evident when this occurs, offset from the heading by a large angle, shows the direction towards the unselected target.  We obtain a normalized marginal probability distribution of the real fish's position (perpendicular to the virtual fish's movement direction) and stack these distributions for varying lateral distances between the virtual fish (D). We can do this without losing information along the virtual fish's movement direction as the real fish maintains relatively stable front-back distance with its virtual conspecifics (E).   Table S2 for parameters used in A and C. For B and D, we removed explicit feedback on individual preferences by setting ωinc = 0 and ω dec = 0. However, with no feedback, the group will almost always split into subgroups that all go to their preferred target. Hence, B and D also included uninformed individuals that function to keep the group together. In these simulations, each target was preferred by 12 individuals and the rest were uninformed-simulations with two options had 36 uninformed individuals out of 60 while the simulations with three options had 24 uninformed individuals.