Dissecting Larval Zebrafish Hunting Behavior using Deep Reinforcement Learning trained RNNs

Raaghav Malik, Satpreet Harcharan Singh, Sonja Johnson-Yu, Nathan Wu, Roy Harpaz, Florian Engert, Kanaka Rajan · Submission to ICLR 2026 · Rejected

TL;DR

By training recurrent neural network (RNN) agents with deep reinforcement learning in a biologically grounded simulator, the authors demonstrate that hallmark larval zebrafish hunting behaviors—such as eye-vergence shifts, bout-based velocity trade-offs, and systematic prey-angle halving—spontaneously emerge as optimal solutions to energetic and sensory constraints without any imitation learning or biophysical fluid simulation.

What Problem Does This Paper Address?

Larval zebrafish exhibit remarkably stereotyped hunting motifs: they swim in discrete bouts, abruptly converge their eyes into a binocular "hunting mode," systematically halve the angular error to their prey on each pursuit bout (~50% reduction), and either strike or abort within tight time windows.

While neuroscientists have detailed descriptive and mechanistic models of these actions, we lack a normative explanation: Why do these specific behavioral strategies emerge? In live animals, ecological parameters (such as food density, prey motility, visual noise, and metabolic costs) covary, making it nearly impossible to isolate and causally manipulate them in closed-loop settings.

Methods

The authors built a minimal, bout-based 2D virtual simulator to train RNN agents via Proximal Policy Optimization (PPO) without biological imitation data:

  • Sensing: Two movable eyes with a $163^\circ$ monocular field of view divided into 10 angular sectors. The eyes rotate symmetrically (vergence $\theta_v$). Only the overlapping binocular zone provides distance estimation and lower sensory noise; monocular zones report binary object presence with higher noise.
  • Kinematics & Action Space: The agent acts in discrete bouts ($\Delta t = 125\text{ ms}$, 8 FPS). Forward speed and angular turn velocity are coupled in a triangular action space: higher forward speeds constrain maximum turning ability, matching real larval locomotion.
  • Energetic Costs & Rewards: Reward is granted upon prey capture ($R_{\text{capture}} = 10$), with strike capture probability decaying with angular alignment error via a modified Laplace distribution. The objective includes explicit linear penalties for high forward velocity ($C_{\text{speed}}$), sharp turns ($C_{\text{turn}}$), and maintaining eye vergence away from resting divergent angles ($C_{\text{vergence}}$).
  • Prey: Non-adversarial, stochastic 2D walkers modeling Paramecium.
   [Sensing: 2 Eyes (Monocular + Variable Binocular Field)]
                           │
                           ▼
        [Recurrent Policy Network (Actor-Critic RNN)]
                           │
                           ▼
  [Actions: Coupled Forward/Turn Speeds + Symmetric Vergence]
                           │
                           ▼
 [Environment: Stochastic Prey + Movement & Vergence Energy Costs]

Datasets

Not discussed in the paper. No biological behavioral tracking datasets were used for training or supervised imitation. The agent learned entirely from scratch via reinforcement learning. Biological literature values were used exclusively to set physical limits, noise parameters, and reward thresholds, and as benchmarks for qualitative and quantitative comparisons.

Key Insights and Ideas

  • Vergence as an Economic Investment: Converging the eyes incurs a direct energetic penalty, but the agent learns to converge rapidly upon prey detection because binocular stereopsis provides accurate range sensing.
  • Strategic Aborts Emerge Naturally: Successful hunts are short, whereas failed hunts drag on until the agent aborts. If prey alignment is lost or tracking stalls, the agent diverts back to exploration rather than wasting energy on low-probability strikes.
  • Kinematic Trade-Offs Dictate Angle Halving: The recursive halving of prey angle per pursuit bout emerges directly from the triangular action space and turn penalties. The agent sacrifices forward velocity during pursuit to prioritize turn precision.
  • Solution Degeneracy & Fitness: Better-performing policy seeds correlate strongly with more pronounced, naturalistic eye convergence patterns, illustrating that evolutionary fitness favors these exact behavioral motifs.

Key Results

  • Angle Halving: During the final $0.75\text{ s}$ of pursuit, the agent systematically halves prey azimuth per bout (regression slope $\approx 0.45\times$, close to real zebrafish empirical observations) while reducing prey distance by $\sim 15\%$ per bout.
  • Locomotor Clustering: Unsupervised PCA and K-means clustering ($k=4$ to $5$) of 8-timestep movement windows revealed distinct bout classes—fast, straight strike bouts vs. slower, variable turn adjustments—matching real fish repertoires.
  • Vergence Dynamics: Vergence increased at an average rate of $+14.5^\circ/\text{s}$ during the first second after detection and relaxed at $-12.7^\circ/\text{s}$ post-capture. Across baseline seeds, hunting success strongly correlated with hunting-mode vergence magnitude ($R^2 = 0.50$).
  • Virtual Sweeps: Increasing prey speed directly decreased capture rates and increased aborts; constraining maximum or minimum vergence impaired binocular depth perception and reduced capture efficacy.

Limitations and Future Work

  • Simplified Physics and Anatomy: The environment lacks realistic 3D fluid dynamics, complex multi-joint tail biomechanics, and non-visual senses (such as lateral line fluid sensing).
  • Passive Prey: Prey are modeled as random stochastic walkers rather than responsive or evasive prey.
  • Future Directions: The authors plan to extend this "virtual lab" to multi-agent settings (predator-prey competition and schooling), analyze the internal RNN latent representations to identify how behavioral states (motivational drive, accumulated evidence) are encoded, and compare policy seed variability directly to individual animal-to-animal differences.

Summary updated

BibTeX
@inproceedings{malik2025dissecting,
  author = {Raaghav Malik and Satpreet Harcharan Singh and Sonja Johnson-Yu and Nathan Wu and Roy Harpaz and Florian Engert and Kanaka Rajan},
  title = {{Dissecting Larval Zebrafish Hunting Behavior using Deep Reinforcement Learning trained RNNs}},
  booktitle = {AI4Science @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=3kiCmoOQz7},
}
Figure