Abstract
LangevinFlow is a novel generative model that leverages physics-inspired stochastic differential equations—specifically the underdamped Langevin equation—to characterize the latent factors driving large-scale neural activity. By integrating physical priors such as inertia, damping, and oscillatory potentials into a Variational Auto-Encoder (VAE) architecture, the model effectively balances deterministic intrinsic dynamics with stochastic external influences. LangevinFlow demonstrates superior performance in predicting neural firing rates and capturing emergent biological phenomena like traveling waves, outperforming existing state-of-the-art deep learning methods on the Neural Latents Benchmark.
Introduction
When neuroscientists record from hundreds of neurons simultaneously, they observe coordinated patterns known as latent dynamics. These dynamics are driven by both the brain’s internal "programming" (intrinsic dynamics) and unobserved sensory inputs or random fluctuations (external stochastic influences). Existing models often struggle to balance these; some are overly rigid, while others lack the physical intuition necessary to model how biological systems evolve over time. LangevinFlow addresses this by integrating physics-based constraints within a modern deep learning framework to naturally model neural state evolution.
Methods
The core of LangevinFlow is a sequential VAE where the latent space is governed by the underdamped Langevin equation. This "physics engine" incorporates several key components:
- Inertia (Mass): Provides momentum to the system, preventing unrealistic, jerky state jumps.
- Damping (Friction): A force that stabilizes the system over time.
- Potential Function ($U$): Parameterized as a network of locally coupled oscillators, this biases the model toward rhythmic, wave-like patterns common in the cortex.
- Stochastic Forces: Random "kicks" representing unobserved external inputs.
As shown in Figure 1, the architecture consists of a GRU-based RNN encoder that maps raw spike data to initial latent states. The latent flow then evolves these states forward in time according to Langevin dynamics. Finally, a one-layer Transformer decoder refines the firing rate predictions by capturing long-range dependencies across the entire sequence.
Results and Evaluation
The model was evaluated on synthetic data (Lorenz attractor) and the Neural Latents Benchmark (NLB), which includes diverse datasets from macaque motor, somatosensory, and frontal cortices.
LangevinFlow achieved state-of-the-art performance on the NLB, specifically in co-smoothing bits per spike (co-bps) and forward prediction accuracy, surpassing models like AutoLFADS and Neural Data Transformers (NDT). On synthetic Lorenz data, it reached an $R^2$ of 0.944, outperforming competitors in reconstructing ground-truth firing rates. Furthermore, the model's latent variables proved highly effective for decoding physical behaviors, such as hand velocity, indicating their biological relevance.
Discussion and Key Insights
A significant advantage of LangevinFlow is its use of second-order dynamics, which includes velocity to produce smoother, more biologically plausible trajectories than standard first-order models. By designing the potential function as coupled oscillators, the model naturally recovers spatiotemporal traveling waves—a common cortical phenomenon rarely captured explicitly by latent variable models.
Future work may involve making the "energy landscape" (potential function) dynamic to respond to external cues and exploring more complex, non-linear parameterizations of these landscapes. While computationally more intensive than standard RNNs due to SDE integration, the use of a single-layer Transformer decoder helps maintain efficiency.
Summary updated