Revealing the mechanism and function underlying pairwise temporal coupling in collective motion

Coordinated motion in animal groups has predominantly been studied with a focus on spatial interactions, such as how individuals position and orient themselves relative to one another. Temporal aspects have, by contrast, received much less attention. Here, by studying pairwise interactions in juvenile zebrafish (Danio rerio)—including using immersive volumetric virtual reality (VR) with which we can directly test models of social interactions in situ—we reveal that there exists a rhythmic out-of-phase (i.e., an alternating) temporal coordination dynamic. We find that reciprocal (bi-directional) feedback is both necessary and sufficient to explain this emergent coupling. Beyond a mechanistic understanding, we find, both from VR experiments and analysis of freely swimming pairs, that temporal coordination considerably improves spatial responsiveness, such as to changes in the direction of motion of a partner. Our findings highlight the synergistic role of spatial and temporal coupling in facilitating effective communication between individuals on the move.

For all statistical analyses, confirm that the following items are present in in the figure legend, table legend, main text, or or Methods section.

n/a Confirmed
The exact sample size (n) for each experimental group/condition, given as as a discrete number and unit of of measurement A statement on on whether measurements were taken from distinct samples or or whether the same sample was measured repeatedly The statistical test(s) used AND whether they are one-or or two-sided Only common tests should be described solely by name; describe more complex techniques in the Methods section.

A description of of all covariates tested
A description of of any assumptions or or corrections, such as as tests of of normality and adjustment for multiple comparisons A full description of of the statistical parameters including central tendency (e.g.means) or or other basic estimates (e.g.regression coefficient) AND variation (e.g. standard deviation) or or associated estimates of of uncertainty (e.g.confidence intervals) For null hypothesis testing, the test statistic (e.g.F, t, r) with confidence intervals, effect sizes, degrees of of freedom and P value noted Give P values as exact values whenever suitable.
For Bayesian analysis, information on on the choice of of priors and Markov chain Monte Carlo settings For hierarchical and complex designs, identification of of the appropriate level for tests and full reporting of of outcomes Estimates of of effect sizes (e.g.Cohen's d, Pearson's r), ), indicating how they were calculated Our web collection on statistics for biologists contains articles on many of the points above.

Data analysis
For manuscripts utilizing custom algorithms or or software that are central to to the research but not yet described in in published literature, software must be be made available to to editors and reviewers.We We strongly encourage code deposition in in a community repository (e.g.GitHub).See the Nature Portfolio guidelines for submitting code & software for further information.Data processing and analysis was done with MATLAB versions 2020a and 2023b.All codes that support the findings of of this study are available on on figshare with the identifier 10.6084/m9.figshare.25404004.

Reporting on sex and gender
Reporting on race, ethnicity, or other socially relevant groupings

Ethics oversight
Note that full information on the approval of the study protocol must also be provided in the manuscript.

Field-specific reporting
Please select the one below that is the best fit for your research.If you are not sure, read the appropriate sections before making your selection.

Life sciences
Behavioural & social sciences Ecological, evolutionary & environmental sciences For a reference copy of the document with all sections, see nature.com/documents/nr-reporting-summary-flat.pdf Behavioural & social sciences study design All studies must disclose on these points even when the disclosure is negative.

Research sample
Sampling strategy

Timing
The data that support the findings of this study are available in figshare with the identifier https://doi.org/10.6084/m9.figshare.c.7123501.v1 Quantitative experimental; including: lab-based measurements of behavior, controlled experiments in VR, computational modeling and analyses of thereof.
276 zebrafish of age 24 to 26 days post fertilization raised in a room at 28 degrees on a 12-h light, 12-h dark cycle.The sample is representative--we reach highly significant results and this is the range that was employed in previous works on social interactions of this species.
We determined sample size according to the three Rs principle (Replacement, Reduction and Refinement).We used all data without sub-sampling, i.e., this was random (fish were chosen at random).
All experiments were conducted on 1 cm ± 0.1 cm long zebrafish of age 24 to 26 days post-fertilization raised in a room at 28 °C on a 12 h light, 12 h dark cycle (light switching on and off and 7 am and 7 pm).The fish were bred and raised by the animal care staff of the Department of Collective Behaviour, Max Planck Institute of Animal Behaviour in an animal facility at the University of Konstanz.Fish were transferred to the experimental room at least 12 h prior to the experiments in water from their holding tanks.This ensured that the water quality in the experimental room was the same as in their holding facility.This water was also used in the experimental setups (either the arenas for 2 real fish experiments or the fishVR setup for virtual reality experiments) where water changing was done once a day.All the fish were na # !ve, and chosen at random from their holding tanks.All experiments were conducted in accordance with the animal ethics permit approved by Regierungsprasidium Freiburg, G-17/170, G-17/46 and G-21/153.
The majority of the experiments were executed by technicians in the lab, that were blinded to experimental conditions and / or the study hypothesis.
Pairs of real fish were tracked in two separate times: the first between 6.12.2017-22.01.2018Note that full information on the approval of the study protocol must also be provided in the manuscript.
Reciprocal virtual fish experiments were conducted between 05.02.2024-13.03.2024.
To account for errors in detection from the tracking algorithm of the pairs, we omitted from our analysis all data with undefined x, y or speed values.In addition, we removed minima of speed (the initiation of the bursts) that were above 5 cm/s or that weren't followed by a pronounced acceleration (100 ms after the minima the increase in speed was <2 cm/s) to only account for actual bursts and not small variations in speed.
Specifically for VR experiments, we omitted cases where we detected errors in the VR output, whereby the speed of the VF wasn't according to what we had assigned.That is, if we detected too low or too high speeds (< 0.001m/s or > 0.11m/s) for more than 5 frames within our window of analysis (100 frames in the case of the nonreciprocal VF with no VF turns and 300 frames in the case with the VF turns).In the case of the reciprocal VF, where the speed profile isn't fully determined prior to the experiment, we omit cases according to extreme values of VF acceleration (numerical differentiation of the speed)-that is, if we had more than 5 frames of > 0.05m/s^2 or < $0.05m/s^2 in a 100 frame window.
This description is given in the manuscript as well.
No participants were involved in the study.
As each fish was used only once, there was no need to randomize them.
Zebrafish (Danio rerio), Konstanz wild type, age 24-26 days post-fertilization N/A Our study deals with juveniles, where sexual differences aren't likely to yet play a prominent role.We randomly chose fish from a holding tank including both sexes, and we used them in the study without distinguishing their sex.

Plants
Describe the methods by which all novel plant genotypes were produced.This includes those generated by transgenic approaches, gene editing, chemical/radiation-based mutagenesis and hybridization.For transgenic lines, describe the transformation method, the number of independent lines analyzed and the generation upon which experiments were performed.For gene-edited lines, describe the editor used, the endogenous sequence targeted for editing, the targeting guide RNA sequence (if applicable) and how the editor was applied.was applied.was applied.
Report on the source of all seed stocks or other plant material used.If applicable, state the seed stock centre and catalogue number.If plant specimens were collected from the field, describe the collection location, date and sampling procedures.
Describe any authentication procedures for each seed stock used or novel genotype generated.Describe any experiments used to Describe any authentication procedures for each seed stock used or novel genotype generated.Describe any experiments used to Describe any authentication procedures for each seed stock used or novel genotype generated.Describe any experiments used to assess the effect of a mutation and, where applicable, how potential secondary effects (e.g.second site T-DNA insertions, mosiacism, off-target gene editing) were examined.
Guy Amichay, Mate Nagy, Iain D. D. Couzin Apr 22, 2024 Experiments were conducted in in a VR VR setup produced by by loopbio GmbH.One can refer to to Stowers et et al. (2017) for the details of of the fishVR setup.In In addition, fish tracking was done using the TRex software (Walter and Couzin, 2021).Stowers, J. J. R. R. et et al.Virtual reality for freely moving animals.Nature Methods 14, 995-1002 (2017).Walter, T. T. & Couzin, I. I. D. D. Trex, a fast multi-animal tracking system with markerless identification, and 2d 2d estimation of of posture and visual fields.Elife 10, e64000 (2021).
We require information from authors about some types of materials, experimental systems and methods used in many studies.Here, indicate whether each material, system or method listed is relevant to your study.If you are not sure if a list item applies to your research, read the appropriate section before selecting a response.