Inferring learning rules in deep neural network architectures from animal learning data

Shaunak Bhandarkar, Jonathan W. PillowNeurIPS 2026

TL;DR

How does an individual brain go from clueless novice to seasoned expert? By fitting tiny deep neural networks directly to the trial-by-trial choices of individual mice, researchers found that both network depth and nonlinearity are crucial for capturing the messy, idiosyncratic ways real animals learn—and discovered that a mouse’s "initial weights" and learning rate can predict whether it masters a task or gets stuck in bad habits.

What Problem Does This Paper Address?

Watch a few dozen mice learn a simple video game—say, turning a wheel to move a visual grating to the center of a screen for a sip of water—and you will see wild individuality. Some learn steadily; others develop stubborn side-biases (turning exclusively right for days before finally figuring out the left side); some never become experts at all.

Computational neuroscientists often model this trial-and-error process using Reinforcement Learning (RL) or gradient descent (GD) in neural networks. Recent work suggested that 2-layer ("deep") linear networks explain mouse learning curves better than 1-layer ("shallow") ones. However, past approaches either fit models to averaged clusters of animals—blurring out individual quirks—or only fit shallow 1-layer networks to single animals. Until now, we lacked a rigorous statistical way to fit deep, nonlinear network learning rules directly to a single animal's raw history of stimuli, actions, and rewards.

Methods

The authors treat learning rule discovery as an inverse problem. Given an individual mouse's exact sequence of sensory inputs, choices, and rewards over thousands of trials, they infer three core components of a candidate neural network:

  1. Initial weights ($\theta_1$): Where the animal starts before trial one (including preexisting biases).
  2. Learning rate ($\alpha$): How aggressively the network updates its weights via gradient descent on reward-prediction error after each trial.
  3. Softmax gain ($\beta$): How deterministically vs. randomly the network turns its internal reward predictions ($Q$-values) into actions.
Figure 1: Overview of mouse learning task and DNN learning rule inference framework. A. A canonical binary decision-making task in mice (top), and running summary statistics for mice across learning (bottom). B. Three candidate “minimal” neural network architectures for modeling mouse decision-making. Each network is equipped with a softmax-based policy for sampling a decision (right or left). C. An illustration of each network’s forward computation in conjunction with gradient- based learning rule dynamics. Crucially, the learning dynamics depend on the network’s parameters: initial weights θ1, learning rate α, and softmax gain parameter β.

They test three minimal architectures: a 1-layer linear (1L) network, a 2-layer linear (2L) network, and a novel 2-layer nonlinear (2NL) network featuring a saturating sigmoid ($\text{erf}$) activation after the first layer. Crucially, because a deep network can mathematically masquerade as a shallow one (see Key Insights), the authors introduce a regularized maximum-likelihood objective to keep parameters bounded and architectures identifiable.

Datasets

No new datasets were collected; instead, the authors evaluated their framework on two existing, large-scale behavioral datasets of mice learning the International Brain Laboratory (IBL) binary visual decision-making task across thousands of trials:

  • Pan-Vazquez et al. (2024): $n = 22$ mice (trained without zero-contrast stimuli or corrective repeat trials, following a passive pre-exposure session).
  • Liebana et al. (2025): $n = 36$ mice (trained with zero-contrast trials and a curriculum that repeated trials after mistakes).

Key Insights and Ideas

  • Deep networks can fake being shallow (The "Lazy" Regime Trap): Before looking at real mice, the authors proved a neat theorem: a 2-layer linear network initialized with huge first-layer weights and tiny second-layer weights will barely change its first layer during gradient descent, mimicking a 1-layer network to arbitrary precision. Without regularization, you can't tell architectures apart from behavior alone!
  • Saturating nonlinearity matches biological perception: Linear networks scale their internal signals infinitely with stimulus contrast, whereas real mice treat 50% and 100% visual contrast almost identically. Adding a saturating nonlinearity (2NL) lets the model mirror this perceptual ceiling.
  • Stochasticity alone can cause "bifurcations": When the authors took a single fitted model (identical initial weights and learning rate) and re-simulated its training from scratch multiple times, the simulated trajectories sometimes split into two distinct camps—some developing strong right biases, others left biases. Pure coin-flip noise in early choices can snowball into completely divergent learning strategies.
  • Initialization and learning rate predict destiny: In the Pan-Vazquez dataset, a high learning rate helped unbiased mice reach high accuracy, hurt biased mice (likely amplifying instability), and strong initial sensory weights in layer 1 protected mice against falling into stubborn side-biases.

Key Results

  • 2NL dominates model comparison: Under 5-fold cross-validation on interleaved held-out trials, the 2-layer nonlinear (2NL) model achieved the best fit for 55 out of 58 mice across both datasets (20/22 in Pan-Vazquez et al., and 35/36 in Liebana et al.), and won 58 out of 58 by Akaike Information Criterion (AIC).
  • Reconstructing behavioral trajectories: When re-trained from scratch on the mice's stimuli, fitted 2NL models closely tracked true mouse accuracy curves, bias evolution, and sensitivity to faint stimuli.
Running accuracy curves for sample mice alongside reconstructions from the three network architectures, showing the 2-layer nonlinear model closely tracking real animal performance.
  • Predicting individual variability: In the Pan-Vazquez dataset, the magnitudes of the inferred initial layer-1 right-stimulus weights strongly correlated with overall mouse accuracy ($R^2 = 0.728$) and negatively correlated with task bias ($R^2 = 0.586$).
  • Architecture vs. Learning Rule: As an exploratory baseline, a 1-layer network trained with the REINFORCE policy-gradient rule (with baseline) beat 1L gradient descent and rivaled 2-layer networks—even outperforming 2NL on the Liebana dataset—showing that changing the learning rule is a viable alternative to adding depth.

Limitations and Future Work

  • Within-session fatigue and overnight gaps: The models treat trial 10,000 the same whether it happens five seconds after trial 9,999 or the next morning. Consequently, they miss late-stage, within-session dips in mouse accuracy (like getting full of water and losing motivation near the end of a session).
  • Deterministic weight updates: Choice sampling is stochastic, but the gradient update itself is deterministic. Adding noise to weight updates could better capture late-training behavioral fluctuations.
  • Dataset discrepancies: The striking correlations between inferred 2NL parameters and mouse accuracy/bias in Pan-Vazquez et al. were much weaker in Liebana et al., likely due to differences in training curricula (e.g., corrective repeat trials). Future work will explore richer architectures incorporating choice history, discrete behavioral states, and time-varying learning rates.

Summary updated

Abstract

A major goal in computational neuroscience is to understand how animals learn to perform a new behavior from a sequence of actions and rewards. Recent work from Liebana et al. (2025) has argued that animal learning trajectories are inconsistent with learning in shallow (1-layer) networks and are better explained by gradient descent (GD) in a 2-layer, "deep" neural network (DNN). However, previous work on inferring animal learning rules from behavioral data has focused on either 1-layer networks or fits to group behavior, highlighting the need for methods to fit DNN learning rules to individual animal learning trajectories. To address this gap, we develop a method for inferring single-animal DNN-based learning rules, parametrized by a set of initial weights, a learning rate, and a softmax parameter governing stochasticity in choice behavior. We first prove that GD in a shallow network can be arbitrarily well approximated by GD in a deep network, establishing a theoretical limit on network identifiability. Using this result to refine our inference method, we analyze two behavioral datasets from mice learning a sensory decision-making task. Specifically, we compare three model architectures: 1-layer linear (1L) and 2-layer linear (2L) models considered in Liebana et al., as well as a 2-layer nonlinear network (2NL) with a sigmoidal nonlinearity after the first layer. Of these three models, the 2NL model achieved the best fit for 55 out of 58 mice in both datasets (under cross-validation). Moreover, simulated learning trajectories from the fitted 2NL model closely matched the timecourse of key behavioral metrics such as bias, stimulus sensitivity, and accuracy. Strikingly, in one dataset, we found that the inferred learning rate and initial layer-1 weights of the 2NL model systematically predicted individual differences in accuracy and task bias, linking network initialization and learning rate to individual differences in learning performance across mice. Together, these results point to the importance of depth and nonlinearity in capturing individual learning trajectories.
BibTeX
@inproceedings{bhandarkar2026inferring,
  author = {Shaunak Bhandarkar and Jonathan W. Pillow},
  title = {{Inferring learning rules in deep neural network architectures from animal learning data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=wsgPXDF5VH},
}
Figure