Preferential dynamic modeling with forward-backward smoothing

Omid G. Sani, Mohammad Hosseini, Trisha Jha, Maryam M. Shanechi

TL;DR

Decoding behavior from brain signals requires different temporal tools depending on the job: predicting the next instant, estimating the exact present, or looking back over a finished recording with full hindsight. Until now, models that prioritize behaviorally relevant neural dynamics were largely locked into just one of these modes. This paper cracks a subtle mathematical identifiability puzzle to unite all three—prediction, filtering, and smoothing—into a single, theoretically grounded linear and nonlinear framework.

What Problem Does This Paper Address?

Imagine listening to the crackle of hundreds of neurons in the motor cortex (our primary signal, $y$) to figure out how an arm is moving (our secondary signal, $z$). Depending on when you need the answer, you face one of three classic estimation problems:

  1. Prediction ($k|k-1$): Guessing behavior at step $k$ using neural data up to $k-1$.
  2. Filtering ($k|k$): Updating that guess the instant neural data at step $k$ arrives (crucial for real-time brain-computer interfaces).
  3. Smoothing ($k|N$): Offline hindsight—estimating step $k$ using an entire recorded window of length $N$, looking both forward and backward in time.

In standard single-signal models, filtering and smoothing the observed signal itself is trivial—if you already observe $y_k$, you don't need to guess it. Things get much trickier in two-signal settings, where $z$ is present during training, absent during inference, and buried inside a sea of unrelated brain activity.

Existing "preferential" methods like PSID (linear) and DPAD (nonlinear) solve this by prioritizing the latent neural dynamics shared with behavior, rather than getting distracted by neural noise. However, both were strictly built for one-step-ahead prediction. Conversely, deep sequential autoencoders (like TNDM) handle offline smoothing across whole trials, but can't run causal, step-by-step online decoding. A unified framework spanning all three regimes was missing—largely because the exact Kalman filter gain ($K_f$) needed for optimal filtering and smoothing cannot be uniquely identified from a single time series alone.

Methods

The authors bridge this gap analytically for linear state-space models and structurally for deep nonlinear networks:

  • PSID with Filtering: Standard PSID learns a steady-state "total" Kalman gain $K$, which lumps prediction and update steps together. The authors prove that while the standalone filter gain $K_f$ remains unidentifiable, the readout product $C_z K_f$—which is all you actually need to update the behavioral estimate—becomes uniquely identifiable when a secondary signal $z$ is present during training. They learn $C_z K_f$ directly by applying Reduced-Rank Regression (RRR) to the one-step-ahead prediction errors of $y$ and $z$.
  • PSID with Smoothing: Inspired by two-filter Kalman smoothers, the authors run PSID with filtering forward in time, subtract the filtered estimates from both signals to isolate the unexplained residuals, reverse those residuals in time, and run a second PSID with filtering pass backward.
Figure 1: (a) Diagram of PSID with filtering. The method consists of three main steps: (1) Regular PSID learns the predictor-form forward model parameters (where noise statistics are represented via K and Σy rather than {Q, R, S}; Appendix A.10) from input signals, (2) a Kalman predictor uses the learned model to make one-step-ahead predictions, and (3) Reduced Rank Regression (RRR) learns updated CzKf parameters to produce optimal filtered estimates of the behavior signals. (b) Diagram of PSID with smoothing. The method first applies PSID with filtering as in (a), and obtains the error of the filtered estimate of the secondary signal, i.e., ˜z1:N. Next, ˜y and ˜z are reversed in time, i.e.,
  • DPAD with Smoothing: To bring this forward-backward principle into the nonlinear realm, they extend DPAD using a bidirectional RNN. A forward RNN reads $y_{1:N}$, a backward RNN reads $y_{N:1}$ (initialized from the forward RNN's final state), and multi-layer perceptrons (MLPs) read out the concatenated forward-backward latent states while prioritizing behaviorally relevant dynamics during training.

Datasets

  • Simulations: 50 randomly parameterized linear state-space models with known ground-truth parameters.
  • Sabes Dataset: Non-human primate motor cortical recordings across 7 sessions, testing three neural modalities—smoothed spikes, raw local field potentials (LFP), and LFP power bands—paired with arm kinematics.
  • Neural Latents Benchmark (NLB): Three standard motor cortex benchmarks (Area2_Bump, MC_Maze, and MC_RTT) evaluating behavioral velocity decoding and "co-smoothing" (predicting held-out neurons from held-in neurons). No new datasets are introduced.

Key Insights and Ideas

  • A second signal breaks an identifiability symmetry: Many different internal noise covariances produce the exact same observable neural statistics $y$, hiding the true filter gain $K_f$. Introducing behavior $z$ breaks this equivalence: models that look identical on $y$ behave differently on $z$, exposing $C_z K_f$ so we can learn optimal causal filtering directly from data.
  • Residuals make smoothing a simple sum: Standard forward-backward Kalman smoothers require messy inverse-uncertainty weighting because both passes estimate the same state. By training the backward pass strictly on the residuals of the forward pass, the two filters target mathematically orthogonal subspaces. The optimal smoothed estimate becomes a clean, unweighted sum of the forward and backward predictions.
  • One linear fit gives two decoders: Because the forward pass of PSID with smoothing is PSID with filtering, training a single model gives you both an optimal real-time causal filter and an optimal offline smoother.

Key Results

  • Ideal Linear Convergence: Across 50 simulated systems, identifiable parameter errors dropped below 1% at $10^6$ samples, and learned test $R^2$ tightly hugged the theoretical optimum of the true ground-truth models across prediction, filtering, and smoothing.
Simulated vs Ideal R2 across estimation modes
  • Primate Motor Decoding: On the Sabes dataset across all three neural modalities (spikes, raw LFP, LFP bands), decoding correlation improved significantly at each step: Smoothing > Filtering > Prediction ($P < 0.0005$), with PSID consistently beating standard unprioritized linear subspace identification (NDM).
  • Competitive Nonlinear Benchmarks: On NLB, DPAD with smoothing consistently beat causal DPAD and unprioritized nonlinear smoothing. Against the official leaderboard, an ensemble version achieved state-of-the-art behavioral velocity decoding on MC_RTT ($R^2 = 0.7101$, beating the prior leader by $+0.0383$), placed second on MC_Maze velocity ($R^2 = 0.9230$), and ranked second across all three datasets when adapted for downstream neural forecasting.

Limitations and Future Work

  • Asymmetry in Theoretical Guarantees: Optimality is mathematically proven only for linear PSID. While linear DPAD has the representational capacity to match a steady-state smoother, general nonlinear DPAD relies on numerical optimization and carries no formal optimality guarantees.
  • Separate Training for Nonlinear Modes: Unlike PSID, DPAD with smoothing trains its forward and backward RNNs jointly; its forward RNN cannot simply be detached and used as a standalone causal filter—standard causal DPAD must be trained separately.
  • Unidentifiable Internal Noise: Even with two signals, internal stochastic noise covariances ($Q, R, S$) and sometimes the standalone matrix $K_f$ remain unidentifiable. Pinning down associated noise statistics, along with extending these filtering/smoothing tools to external-input-driven systems, switching dynamics, multimodal recordings, and multi-subject models, remain open avenues for future work.

Summary updated

BibTeX
@inproceedings{sani2026preferential,
  author = {Omid G. Sani and Mohammad Hosseini and Trisha Jha and Maryam M. Shanechi},
  title = {{Preferential dynamic modeling with forward-backward smoothing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=vFZhylvjKq},
}
Figure