As a Ph.D. student, I wanted to understand the evolution of individual differences in fruit fly behavior - the building blocks of personality. My experiments involved measuring how my tiny subjects acted in a maze.
Author
- Shraddha Lall
Ph.D. Candidate in Organismic and Evolutionary Biology, Harvard University
So each day in the lab began with using a thin paintbrush to lift a single, anesthetized fruit fly and transfer it into a simple maze. After it woke up and had explored the maze, I'd place the fly - careful not to let it escape in transit - back into a tube where it could eat and hang out while I decided its fate.
My labmates and I repeated that process again and again, ultimately measuring the behavior of 900 individual flies daily.
I listened to countless podcasts and audiobooks over many days of moving lots of flies around by hand and keeping track of their individual identities, but this wasn't how I'd originally planned this experiment. I had been excited to work with MAPLE, my lab's robot , to automate the first and last steps of the process. MAPLE would grab individual flies, safely move them into their own tiny mazes, and back out after I'd measured their behaviors.
I'd been trying for months to modify MAPLE's code. I finally got it running smoothly - and then on Day 1 of my 500-day experiment, MAPLE did not work.
After a little bit of panic, and a lot of deep breathing, I decided to power through without the robot's help. MAPLE's refusal to cooperate was the first of many obstacles I faced as I continued my experiment for the next year and a half. During this time, I learned a lot about the building blocks of personality - as well as the challenges of doing scientific research and how to work around them.
Animals have personalities
As an evolutionary biologist who studies animal behavior, I'm fascinated that no two individuals are completely alike. Think about the animal friends in your life - cats and dogs have unique personalities and idiosyncrasies, whether it's a specific food they hate or a particular way they like to nap.
All animals - from the smallest worm to the biggest whale - have personalities : individual behavioral preferences that remain more or less stable throughout their lifetime. In Drosophila melanogaster, the fruit flies I worked with, individuality is evident in simple binary behaviors . Individual flies show a preference for turning left or right, choosing a hot or cool environment, preferring brightly lit areas or the shade, and many other idiosyncrasies.
Both nature and nurture influence animal personality. The environment during development can play a crucial role in some instances. In others, genes inherited from parents can drive preferences. In certain populations of fruit flies, for example, parents that like hot temperatures increase the chances that offspring prefer hot temperatures.
It is also possible for genes to influence how much individuals differ from each other. For instance, certain combinations of genes can lead individual fruit flies to have widely different temperature preferences , with some liking colder temperatures and others preferring it warm. These genes determine how wide the range of temperatures an individual's preferences are drawn from.
Scientists have found genes that influence variation in traits in many animals and plants , so evolution seems to have kept them around for a reason. But what's the benefit of a gene that makes individuals within a group different from each other?
The benefits of variation
An evolutionary theory called bet-hedging suggests that in an unpredictable environment, having options can be less risky. When conditions are fluctuating, there is no one behavior that is best suited for the environment. Variability-influencing genes can be adaptive in this situation.
Take temperature preference, for example.
Imagine that an organism can have either a low temperature-variability gene, which I will call low-var, or a high temperature-variability gene, high-var. Animals with the low-var gene have similar temperature preferences and can all survive and reproduce when the environment has stable, average temperatures. Comparatively, animals with high-var have very different temperature preferences from each other.
When the environment has average, stable temperatures, the preference of some animals with the high-var gene may be a good fit for conditions. They'll be able to reproduce, but many other high-var individuals may not.
However, if temperatures fluctuate unpredictably, going below or above the average, all the low-var animals will be unfit and unable to pass on their genes. The low-var population would completely collapse.
In the high-var group, no matter how the environment fluctuates, there would be some individuals whose particular temperature preference makes them able to survive, reproduce and pass on the high-var gene.
The competition underlying evolution is a fight for which genes win out and are able to persist over time. In fluctuating environments, a gene that makes the individuals variable across a certain trait, such as temperature preference, has a better chance of persisting long term . Populations with these kinds of bet-hedging genes can therefore have a higher chance of surviving in unpredictable environments.
How can evolution shape this variation, and what kinds of genes are involved? To answer this question, I turned to artificial selection . This process is akin to how humans have domesticated plants and animals for millennia. An experimenter screens individuals from a population for a trait of interest, and only those that meet a certain threshold are allowed to reproduce to create the next generation. Instead of nature deciding who survives, the researcher chooses.
Variability in behavior responds to evolution
To evolve high variability, I picked a simple behavior: turn bias . When given a choice to turn left or right in a Y-shaped maze, some flies almost always choose left, others almost always choose right, and others choose left sometimes and right sometimes. These preferences remain stable over their lifetime, and their genetic background plays a role in determining it.
While the particular turn bias is not inherited - a left-turning mom and a left-turning dad don't necessarily make left-turning fly babies - the variability in turn bias can be influenced by genes. This potential for variability can be considered the fly's "personality" - whether that's a strong preference for one direction or a more flexible approach.
For 21 generations, I used video and a type of AI called computer vision to track thousands of flies . I focused on siblings that shared a mother. If a sibling group made very similar turn choices, they likely had low-variability genes. If a group of siblings was mixed in terms of how biased they were for turning left or right, it was likely their lineage had a high-variability gene.
The next step was the artificial selection. I'd choose the families most likely to have the high-variability genes to mate and produce the next generation.
At the end of my experiment, I had evolved populations with very high levels of turn-bias variability. My results showed that variability in traits and increased individuality in behaviors can evolve in response to selection, definitely in the lab and potentially also in nature.
Now, I'm working on figuring out what happened to their genes as the flies evolved, and how their bodies and brains might have changed when I forced them onto this evolutionary path.
Creating a world where bet-hedging dominates
I now knew that increased behavioral individuality can evolve. That is, flies can evolve differing personalities driven by selection. Could I recreate in the lab the environmental conditions that would lead to this evolution in nature?
Fruit flies are ectotherms , meaning they need to get heat from external sources. Their temperature preference ensures that they find a suitable environment to live and lay eggs in. In a world with increasing unpredictability in temperatures , bet-hedging strategies may evolve as animals adapt.
Based on bet-hedging theory, I hypothesized that evolving in an unpredictable thermal environment in the lab, with temperatures fluctuating over generations, would lead to the evolution of higher variability in temperature preferences.
With this in mind, a labmate and I began creating houses for flies where we could control temperatures of different areas and change them over time. Unfortunately, time and logistics stopped this experiment, and it sits in storage now. I hope to continue this work someday.
My fly experiments taught me a lot about how animal behavior evolves, and also a lot about the process of doing research. There have been two constants - first, sometimes things don't work out, and that's OK. And second, regardless of the challenges - including broken robots, long hours and paused experiments - I want to keep exploring how evolution can shape personality as animals adapt to changing environments.
Shraddha Lall was affiliated with The Conversation U.S. as a AAAS Mass Media Science Fellow for summer 2025.