TL;DR
Our brains generate a torrent of electrical chatter every millisecond, only a fraction of which actually steers what our bodies are doing right now. Switching Shared Latent Dynamics (SSLD) filters out internal background noise by isolating the exact space where brain activity and physical behavior intersect—and reveals how the rules governing that space abruptly shift as an animal switches from planning, to moving, to resting. It gives neuroscientists a clean, interpretable window into how neural circuits shift gears to drive action.
What Problem Does This Paper Address?
Modern neuroscience tools let us record hundreds of neurons firing while simultaneously tracking an animal’s every twitch and reach. Connecting the two, however, is like trying to figure out how a car’s engine turns the wheels while also listening to the radio, the air conditioning, and two passengers arguing. Most neural activity has nothing to do with immediate movement.
Until now, researchers mostly relied on two separate toolkits:
- Dynamical systems models, which look at how neural activity evolves and switches states over time. However, because they look at the brain in isolation, the "switches" they find might reflect arbitrary internal chatter rather than actual behavioral changes.
- Shared representation models, which align brain data and behavioral data into a common mathematical space. Yet, these typically treat the connection as static, ignoring how those shared patterns evolve and change rules as an animal transitions from, say, waiting for a cue to lunging for a treat.
SSLD bridges this divide: it isolates the brain-behavior overlap and explicitly models how its underlying dynamics switch across different behavioral phases.
Methods
SSLD is a variational autoencoder framework that splits incoming neural and behavioral time-series data into three distinct buckets, while applying a state-switching engine exclusively to the middle bucket.
Here is how the pipeline works:
- Separate Encoders & Disentangled Spaces: Two Transformer encoders take in neural recordings and behavioral tracking data, respectively. Linear layers then split these into three latent spaces: a private neural latent (brain activity unrelated to the measured movement), a private behavioral latent (movement nuances not captured by the recorded neurons), and a shared latent (where brain and behavior meet). To ensure the private and shared buckets don't leak identical information into each other, the authors penalize overlap during training—primarily by maximizing the Cauchy-Schwarz divergence between their distributions.
- Switching Dynamics in the Shared Space (The Novel Twist): Rather than modeling dynamics across all brain activity, SSLD places a Switching Recurrent Neural Network (SRNN) strictly inside the shared latent space. At each time step, the model infers a discrete state (via Markov transitions) that selects a specific set of RNN weights. During training, known behavioral epochs act as a prior to guide these switches; at test time, SSLD infers the discrete state switches purely from the raw data.
- Reconstruction: Finally, decoders stitch the shared latent back together with each modality's private latent to reconstruct the original neural and behavioral signals.
Datasets
The authors tested SSLD on one simulated dataset and four public experimental datasets (no new benchmarks were introduced, though they span an impressive variety of species and recording styles):
- Monkey Reaching: Single-unit electrophysiology from motor/premotor cortex paired with hand kinematics and muscle activity across 27 reaching conditions.
- Monkey Bump Task: Single-trial somatosensory cortex recordings paired with hand position, velocity, and arm force during active reaches and passive bumps.
- Mouse Decision-Making: Widefield calcium imaging across 22 dorsal cortex regions paired with paw, nose, and tongue pose tracking.
- Mouse Spontaneous Movement: Dorsal cortex widefield calcium imaging during unconstrained, natural behavior (locomotion, grooming, quiescence).
Key Insights and Ideas
- Isolating the "private" brain reveals hidden housekeeping: When SSLD strips behaviorally relevant signals out of the monkey reaching data, the leftover private neural latent isn't just random static—it shows massive, clean rotational trajectories that look nearly identical across all 27 reaching conditions. This aligns beautifully with prior neuroscience findings that the largest signals in the motor cortex actually reflect when a movement happens (internal timing), not which movement is being made!
- Brain-behavior dynamics visibly change shape across task phases: By plotting the RNN "flow fields" (which show where the shared state wants to drift next) and computing line-attractor scores, SSLD reveals distinct computational regimes. In monkeys, dynamics stabilize along a line attractor right after a "go" cue or during preparation, then relax during movement. In mice making decisions, stimulus onset triggers a stable line attractor—pointing to an evidence-accumulation mode in the cortex.
- Linear alignment isn't enough: In ablation tests, classic linear Canonical Correlation Analysis (PCA-CCA) overfit on training data and collapsed on held-out test sets, demonstrating that the bridge between neural populations and physical movement is fundamentally nonlinear.
Key Results
- State Alignment Accuracy: SSLD accurately recovered task-defined behavioral epochs on held-out test data, hitting 0.96 on Monkey Reaching, 0.99 on Monkey Bump, and 0.95 on Mouse Decision-Making. Even an unsupervised variant of SSLD (trained without behavioral state priors) scored 0.81 on Reaching, crushing unsupervised baselines like rSLDS (0.21) and HMMs (0.23). Unconstrained Mouse Spontaneous Movement proved tougher for all models, with SSLD leading at 0.51.
- Clean Disentanglement & Geometry: Linear decoders confirmed that behavioral information ($R^2$) was packed into the shared and private-behavioral latents, while dropping to near zero (or negative) in the private neural latent. Furthermore, in the reaching task, the geometric similarity of SSLD's shared latent across conditions correlated at $r = 0.942$ with physical hand-path similarity—beating raw neural activity ($r = 0.745$).
- Ablations: Removing the SRNN switching module caused state-alignment accuracy to plummet (e.g., from 0.96 to 0.51 in Reaching, and 0.95 to 0.44 in Decision-Making). Dropping behavioral observations during training similarly tanked behavioral decoding $R^2$ (e.g., from 0.80 to 0.31 in the Bump task).
Limitations and Future Work
- Hungry for good labels: Supervised SSLD relies on well-defined discrete behavioral states and crisp behavioral tracking during training. In messy, naturalistic settings like spontaneous mouse behavior, state recovery noticeably degrades (0.51 accuracy).
- No concept of outside surprises: SSLD treats brain-behavior coupling as a closed, internally driven loop. Even when a robotic arm physically bumped the monkey's hand in the Bump task, the model had no explicit mechanism to account for external inputs or causal perturbations.
- Next steps: The authors plan to build input-driven and causal components into SSLD to handle external stimuli and perturbations, and aim to scale the framework to ingest raw behavioral video alongside neural data—positioning switching shared dynamics as a core building block for future neuroscience foundation models.
Summary updated