iLQR-VAE : control-based learning of input-driven dynamics with applications to neural data

Marine Schimel, Ta-Chu Kao, Kristopher T Jensen, Guillaume Hennequin

Abstract

iLQR-VAE is a novel framework for learning nonlinear latent dynamics that replaces traditional RNN-based encoders with an optimization-based recognition model using the iterative Linear Quadratic Regulator (iLQR). By tying the inference process directly to the generative model, it achieves state-of-the-art performance in reconstructing neural activity and behavior while being more robust and flexible than previous deep-learning approaches.

The Challenge of Unobserved Inputs

In systems neuroscience, researchers strive to understand how the brain's internal "state"—the collective activity of populations of neurons—gives rise to behavior. However, recordings typically capture only a tiny fraction of the brain. This means the localized circuit under observation is constantly being "pushed" by unobserved external inputs from other brain regions.

Existing methods, such as Latent Factor Analysis via Dynamical Systems (LFADS), use a Sequential Variational Autoencoder (VAE) to address this. They rely on a "recognition model" (typically an encoder RNN) to estimate the initial conditions and external inputs that produced a specific snippet of neural data.

The challenge: Training these black-box encoders is notoriously difficult. They often require extensive hyperparameter tuning and "tricks" (like KL-warmup) to prevent the model from ignoring the latent variables entirely—a phenomenon known as posterior collapse. Furthermore, there is often an "amortization gap," meaning the encoder's generalized guess is rarely as accurate as the best possible fit for that specific piece of data.

The iLQR-VAE Framework

To overcome these limitations, the authors introduce iLQR-VAE, which swaps the standard RNN encoder for a control-theory-based optimization approach.

  1. Generative Model: The system assumes a nonlinear latent dynamical system (often a Gated Recurrent Unit or GRU) where the state evolves based on its previous state and an external input: $z_{t+1} = f_\theta(z_t, u_t, t)$.
  2. Recognition Model (The "iLQR" component): Instead of a separate neural network "guessing" the inputs $u$, the model solves a control problem. It asks: "What sequence of inputs $u$ would force my generative model to produce outputs that look most like the observed data?" This is solved using the iterative Linear Quadratic Regulator (iLQR) algorithm.
  3. Differentiable Control: To train the model, the authors must backpropagate through the iLQR optimization. They utilize recent advances in differentiable model predictive control to do this efficiently, maintaining a memory cost that does not scale with the number of optimization iterations.
  4. Heavy-Tailed Priors: The model employs a multivariate Student-t prior for the inputs. This encourages "sparsity," meaning the model tries to explain the data using internal dynamics as much as possible, only resorting to external "kicks" (inputs) when strictly necessary.

Key Insights and Advantages

  • Implicit Recognition: By using iLQR, the recognition model is implicitly defined by the generative model. This drastically reduces the number of free parameters and ensures that the "encoder" and "decoder" are always perfectly synchronized.
  • No More "Tricks": Because the recognition model is tied to the generative model, iLQR-VAE is naturally resistant to posterior collapse. It does not require KL-warmup or complex scheduling to start learning meaningful dynamics.
Training progression showing the evolution of inferred inputs and states alongside the negative ELBO for different prior configurations.
  • Handling Heterogeneous Trials: Traditional RNN encoders are often locked into a specific trial length. iLQR-VAE can perform inference on trials of any length. The authors demonstrated this flexibility by training the model on 4-second chunks and then successfully running inference on a single continuous 9-minute recording.
  • Physics-Informed Inference: The model acts like a "smoother." It finds the most likely trajectory that is physically possible according to the learned dynamics, rather than merely interpolating between data points.

Experimental Evaluation and Discoveries

The model was rigorously evaluated on a mix of synthetic and real-world biological data, including autonomous linear systems, the chaotic Lorenz attractor, and input-driven nonlinear systems like the Duffing oscillator. For biological validation, it was applied to neural recordings from monkey motor cortex (M1) and dorsal premotor cortex (PMd) during both delayed and continuous self-paced reaching tasks.

  • State-of-the-Art Performance: On the "Maze" dataset, iLQR-VAE achieved a kinematic reconstruction $R^2$ of 0.896, matching or exceeding AutoLFADS (0.907) but without the need for extensive, computationally expensive hyperparameter sweeps.
  • Sparse Input Recovery: In synthetic tests, the model perfectly recovered the timing and magnitude of sparse external inputs that were hidden from it, whereas standard VAEs often "smeared" these inputs over time.
  • Neuroscientific Discovery: When applied to M1 data, the inferred inputs peaked around the time of target onset—roughly 150ms before the monkey actually started moving. This aligns seamlessly with current neuroscientific theories that external inputs drive "motor preparation" prior to execution.

Limitations and Future Directions

While powerful, the iLQR-VAE approach has limitations. Solving an iLQR problem for every data sample in every training iteration introduces a higher computational overhead compared to a single RNN forward pass. Additionally, the problem of separating internal dynamics from external inputs is inherently "degenerate"—multiple combinations of dynamics and inputs could theoretically explain the same data. While sparse priors mitigate this, there is no strict mathematical guarantee that the model finds the true biological input.

Finally, the current model uses a simplified, trial-independent covariance for the posterior. The authors suggest that "amortizing" the uncertainty—reusing iLQR computations to estimate variance dynamically—is a highly promising next step for future research.

Summary updated

BibTeX
@inproceedings{schimel2022ilqr,
  author = {Marine Schimel and Ta-Chu Kao and Kristopher T Jensen and Guillaume Hennequin},
  title = {{iLQR-VAE : control-based learning of input-driven dynamics with applications to neural data}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=wRODLDHaAiW},
}
Figure