Latent state dynamics in female Drosophila during social interactions

Umesh Singla, Albert Lin, Jonathan W. Pillow, Mala MurthyAiForAnimalComms @ NeurIPS 2025

TL;DR

This paper introduces a novel state-space model (GLM-HMM) to understand how female fruit flies integrate male courtship signals into their behavior. They discovered distinct internal "states" that dramatically alter how flies respond to male cues, revealing a hidden structure in female decision-making during social interactions.

What Problem Does This Paper Address?

Animal social interactions are complex, involving a constant interplay between external sensory information and an animal's internal state. While male fruit fly courtship behaviors (like song production) have been meticulously studied at a fine temporal scale, the female's responses have been less understood. Her behavior is highly variable and often considered unpredictable, yet it's crucial for determining the outcome of courtship (e.g., copulation). This variability raises questions: is it random noise, or does it reflect underlying internal processes that modulate how she interprets and reacts to male signals? This paper aims to bridge this gap by precisely characterizing female behavior during courtship and uncovering the latent internal states that govern her responses to male cues.

Methods

The researchers developed a multi-state Generalized Linear Model-Hidden Markov Model (GLM-HMM). This framework allows them to model how female flies integrate multimodal male cues (visual, auditory, tactile) over time to produce behavioral outputs (locomotion and wing flicking).

Here's a breakdown of the key methodological aspects:

  • Data Acquisition: High-resolution pose tracking (SLEAP) was used to capture detailed trajectories of male and female flies, alongside synchronized audio recording of male courtship songs.
  • Feature Engineering: They extracted numerous sensory cues from the male (e.g., forward velocity, song components, distance) and behavioral outputs from the female (e.g., forward, lateral, angular velocity, wing flicking). These cues were temporally smoothed and projected onto basis functions to create input features.
  • GLM-HMM Architecture: The core of the model is a Hidden Markov Model (HMM) where each latent state has an associated Generalized Linear Model (GLM). This means that in each state, a specific linear mapping dictates how male sensory cues predict female behavior.
  • Model Training: The Expectation-Maximization (EM) algorithm was employed to fit the GLM-HMM parameters, estimating initial state probabilities, transition probabilities between states, and the GLM weights and biases for each state and behavioral output.
  • Performance Evaluation: They used normalized log-likelihood, Pearson correlation coefficients (for continuous outputs), and F1 scores (for discrete outputs like wing flicking) to assess model performance on held-out data.

Datasets

The study utilized a dataset of 75 male-female pairs of Drosophila melanogaster engaged in natural courtship. This dataset, comprising approximately 22 hours of courtship behavior, was collected using custom-built behavioral chambers with high-resolution video and audio recording capabilities. The data was used for both training and evaluating the GLM-HMM.

Key Insights and Ideas

  • Hidden States Govern Response: The most significant insight is the discovery of distinct latent internal states in female flies. These states are not directly observable but profoundly influence how the female processes male courtship signals.
  • Variable Cue Sensitivity: Male courtship cues, which are generally weak predictors of female behavior in aggregate, become highly predictive within specific latent states. This suggests that the female isn't just passively receiving signals; she's actively modulating her responsiveness based on her internal state.
  • Cue-Driven vs. Internally-Driven States: The identified states fall into a spectrum. Some states are strongly driven by male cues (e.g., responding directly to song or movement), while others appear more internally driven, with less sensitivity to external stimuli.
  • Temporal Dynamics of Decision-Making: While female behavior appears highly variable and unpredictable at millisecond timescales, the emergence of a rich latent state structure over longer timescales (minutes) suggests a more deliberate, internal gating and evaluation process is occurring.
  • Closing the Loop in Social Behavior Modeling: This work represents a crucial step towards a more complete understanding of social interactions by modeling the female's internal processing, moving beyond just describing observable behaviors.

Key Results

  • A five-state GLM-HMM model provided a substantial improvement in predictive performance (220 bits/s) over a standard GLM (115 bits/s) and a chance model on held-out data. Increasing the number of states beyond five did not yield significant additional gains.
  • The model achieved consistent predictive performance across animals for both training and held-out datasets.
  • Forward motion was the most predictable velocity component, with modest correlations for lateral and angular velocities, and modest F1 scores for wing flicking.
  • Individual states showed varying degrees of predictability, with some states being more cue-driven and others more internally-driven.
  • Specific states were characterized by distinct patterns of sensory cue integration, with some states showing strong filters for visual, auditory, or tactile cues, while others had nearly flat filters.

Limitations and Future Work

  • Interpretation of States: While the states show distinct dynamics, the precise functional interpretation of some states (e.g., State 5, characterized by prolonged stillness) remains speculative and may reflect a critical phase of "assessing" or decision-making.
  • Joint Modeling: The current work focuses on the female's response to male cues. A natural extension is to jointly model both animals' internal states and their mutual influence within the closed-loop social system.
  • Generalizability: The authors suggest that the fruit fly courtship system serves as an ideal testbed for developing machine learning approaches to animal communication, implying that these methods could be scaled to more complex systems.
  • Ground Truth: The paper highlights the challenge of applying AI to non-human communication systems due to the lack of ground truth labels for internal states or communicative intent, underscoring the value of models like the GLM-HMM for inferring these hidden variables.

Summary updated

BibTeX
@inproceedings{singla2025latent,
  author = {Umesh Singla and Albert Lin and Jonathan W. Pillow and Mala Murthy},
  title = {{Latent state dynamics in female Drosophila during social interactions}},
  booktitle = {AiForAnimalComms @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=cfZd3w1SyZ},
}
Figure