TL;DR
Fitting a machine learning model to brain recordings doesn't mean you've discovered how the brain actually computes—in fact, guessing the wrong mathematical "squashing function" for individual neurons can lead to completely false circuit wiring diagrams, even when the activity predictions look nearly perfect. This paper introduces gmLDS, a model that bypasses the need to guess a fixed neuronal activation function by learning how each neuron's sensitivity ("gain") changes dynamically on the fly. The result is a reliable microscope for reverse-engineering the hidden computational gears—like attractors and information routing—directly from neural data.
What Problem Does This Paper Address?
Imagine listening to the roar of an engine and trying to sketch its internal blueprint. In systems neuroscience, researchers record the electrical chatter of hundreds of neurons and fit latent dynamical models to uncover the underlying computation.
Standard Linear Dynamical Systems (LDS) summarize this chatter into clean, low-dimensional trajectories, but they are too abstract to tell us how the biological circuit is wired. Low-rank Recurrent Neural Networks (RNNs) bridge this gap by explicitly linking wiring to dynamics. However, fitting RNNs to data has a hidden Achilles' heel: you have to pre-specify the single-neuron activation function (like $\tanh$ or ReLU). Because we rarely know the exact mathematical nonlinearity of real, messy biological neurons, we have to guess. As the authors demonstrate, if your guess is slightly off, the model compensates by warping the inferred connectivity—giving you a great fit to the neural firing rates, but a completely misleading story about the underlying circuit mechanism.
Methods
To escape the trap of pre-defining an activation function, the authors look at what an activation function actually does locally along a neural trajectory: its derivative acts as a state-dependent sensitivity, or neural gain, scaling how strongly a neuron responds at any given moment.
Building on this insight, the authors introduce Gain-Modulated Linear Dynamical Systems (gmLDS). Instead of modeling raw firing rates with a rigid nonlinearity, gmLDS models tiny step-by-step increments in neural activity by decomposing the system into two parts:
- A static low-rank scaffold: Fixed matrices representing the baseline recurrent wiring and input embeddings shared across time and trials.
- A dynamic, learned gain field: A multilayer perceptron (MLP) that takes the current latent state and external inputs, outputting a diagonal matrix of unit-wise gains at every time step.
Crucially, this exact same neuronal gain matrix simultaneously modulates both the internal latent state transitions and the mapping to observed neural activity. For training, gmLDS uses standard variational inference: a backward LSTM summarizes future observations, an MLP infers transition noise, and the whole system is optimized end-to-end via the Evidence Lower Bound (ELBO).
Datasets
- Synthetic RNN Benchmarks: Vanilla and low-rank RNNs trained on four canonical cognitive tasks—Perceptual Decision Making (PDM), Context-Dependent Decision Making (CDM), Parametric Working Memory (PWM), and Delayed Match to Sample (DMS)—including networks with interpolated activation functions and varied regularization to induce diverse circuit strategies.
- Macaque LIP Recordings: Condition-averaged firing rates from the lateral intraparietal area during a random-dot motion discrimination task.
- Macaque PFC Recordings: Trial-averaged responses from 727 prefrontal cortex neurons during a context-dependent decision-making task (integrating motion vs. color).
- MC_Maze Reaching Dataset: Single-trial recordings from primary motor and dorsal premotor cortex during monkey reaching movements.
Key Insights and Ideas
- High $R^2$ can be a mirage: A model can reconstruct neural activity with $>0.95$ accuracy while having near-zero correlation with the true effective connectivity if its activation function is mismatched. Predictive accuracy does not equal mechanistic validity.
- Shared gain is the secret sauce: Coupling the latent dynamics and observation operators with a single shared gain matrix is essential. When the authors ablated this into four independent gain networks, activity reconstruction stayed at $r = 0.989$, completely masking the fact that effective connectivity correlation collapsed from $0.842$ to $0.090$.
- Brain dynamics are messier than textbook attractors: In primate prefrontal cortex, classical theory suggests a crisp, static one-dimensional "line attractor" integrates evidence, selected solely by recurrent dynamics. gmLDS reveals a richer reality: the circuit uses a both-and strategy (modulating sensory inputs and recurrent selection vectors simultaneously) across a multi-dimensional, slowly drifting dynamical regime.
Key Results
- Synthetic CDM Benchmarks: Across varying network regularizations, gmLDS achieved the highest effective-connectivity correlation against all baselines (including rSLDS, cdLDS, and activation-matched LINT) and accurately pinpointed selection vector angles (within ~$3.6^\circ$ in ablation tests). Even when observing only 25% of the neurons, connectivity recovery remained strong ($r = 0.761$ vs. $0.842$ fully observed).
- Real Decision-Making Data: Under 5-fold neuron co-smoothing, gmLDS reconstructed held-out neural activity with a mean $R^2 = 0.86$ in LIP (recovering textbook line-attractor dynamics ~160 ms post-stimulus) and $R^2 = 0.901$ in PFC (outperforming rSLDS at $0.871$).
- Single-Trial Motor Activity: On MC_Maze validation trials, gmLDS captured both condition-averaged trajectories (PSTH $R^2 = 0.530$) and trial-to-trial variability (squared residual correlation of $0.550$, beating permutation baselines at $p < 0.001$).
Limitations and Future Work
- Identifiability: Raw connectivity factors and gains aren't uniquely identifiable on their own (since rescaling one can be offset by the other); only their combined effective products (like the local Jacobian) are identifiable.
- Low-Rank & Short-Horizon Assumptions: gmLDS relies on a low-rank connectivity assumption, which may miss nuances in highly heterogeneous, high-dimensional circuits. It was also only tested on tasks lasting a few seconds, leaving gradient stability over long sequences, complex sequence working memory, and chaotic regimes as open territory.
- Biological Grounding: Future iterations could tighten mechanistic constraints further by incorporating anatomical wiring data, cell-type labels, or optogenetic perturbation recordings.
Summary updated