Machine learning traces how fish schooling arose about 60 times and was lost about 320
Schooling has evolved independently about 60 times in ray-finned fishes over the past 350 million years, and has been lost about 320 times, according to a study in Proceedings of the National Academy of Sciences. The team, led by Andrew Hein and Jay Love at Cornell University, used machine learning to score schooling behaviour across thousands of species. The authors describe it as among the largest evolutionary analyses of any behaviour in any group of species.
Turning behaviour into data
Earlier work on the evolution of collective behaviour, whether in fish schools, bird flocks or other groups, has typically examined one or two species at a time. Together, such studies cover only a few dozen species. Behaviour is also harder to record than anatomy, which has limited comparisons across whole evolutionary trees.
The Cornell team used two machine learning approaches to get round this. First, they trained a text transformer, the architecture that underlies large language models, to read written descriptions of species and convert them into numerical representations. These were then used to judge whether a species is likely to move collectively. Second, they analysed citizen science images and video, including material from iNaturalist. These were converted into three-dimensional representations, from which the heading of each fish and its alignment with neighbours could be estimated to decide whether individuals were moving as a group.
In total, the researchers assigned a schooling phenotype to 2,839 species, close to 10% of the roughly 39,000 living fish species. Hein is associate professor of computational biology in the College of Agriculture and Life Sciences; Love is a postdoctoral researcher in his laboratory.
Losses outnumber gains
The more unexpected result was the scale of loss. Hein said that experts in behavioural evolution, himself included, had expected such losses to be rare. Instead, the analysis found hundreds of cases in which a schooling lineage gave rise to a solitary daughter species.
The study does not establish why this happens. The authors suggest several candidate costs of group living:
- Groups are vulnerable to misinformation, for example when one skittish fish reacts to a false alarm and the whole school scatters.
- Where food is limited, moving and sharing as a group may confer no advantage.
- Disease risk may matter over longer timescales, since closely associated individuals are exposed to similar pathogens.
Testing why schooling evolves
The dataset allowed two long-standing hypotheses to be tested at broad scale. The first is that schooling aids predator avoidance. Species lower in the food chain were indeed more likely to school, but the pattern was not strict: many low-trophic species do not school and many high-trophic species do. This suggests that several pressures act together.
The second hypothesis is that schooling helps individuals locate scarce resources. The team reported that predators that move in groups virtually all eat prey that also move in groups, which fits the idea of following neighbours towards food.
The researchers also found that lineages in which every species schools were considerably more diverse and had produced more species. Love noted that the data cannot separate a higher speciation rate from a lower extinction rate; either, or a combination, would give the result.
Why it matters
The findings show that behaviours often regarded as flexible and hard to measure can be analysed in a phylogenetic framework when language models and computer vision are used to extract traits from existing literature and public images. The results are correlational, and the schooling scores are inferred from text and images rather than from direct observation of each species. Coverage also reaches only about a tenth of fish species. The open questions include the causes of repeated loss, which the authors have not yet identified, and whether similar methods can be applied to other behaviours and animal groups.
Source: Machine learning reveals how often fish schooling evolved—and repeatedly disappeared (Phys.org, 10 November 2026).
Image: AI-generated illustration.
Working on this topic? Find a journal for your research or join the discussion on Scholars Post.


