Scalable approximate inference for state space models with normalising flows

Tom Ryder, Andrew Golightly, Isaac Matthews, Dennis Prangle

Bayesian inference for State Space Models (SSMs) has traditionally been constrained by computational bottlenecks. As datasets grow to include millions of observations, standard methods like Markov Chain Monte Carlo (MCMC) using particle filters become prohibitively expensive due to their $O(T)$ complexity, where $T$ is the sequence length. This paper introduces the Neural Moving Average (nMA) model, a generative framework that leverages the "locality property" of convolutional architectures to enable mini-batch Variational Inference (VI) at a constant $O(1)$ cost per iteration.

The Neural Moving Average (nMA) Model

The core innovation of this work is the nMA model, which transforms a sequence of independent noise variables into latent states using a Convolutional Neural Network (CNN). Unlike standard autoregressive models where each state depends on the entire history, the nMA model utilizes a CNN with a finite receptive field.

This design choice ensures that any specific latent state $x_i$ is only influenced by a local window of noise variables and observations. This "locality property" is the key to scalability: it allows the algorithm to sample short subsequences (mini-batches) from anywhere within a massive time series. The contribution of these mini-batches to the variational objective can be calculated independently, without requiring a full pass through the data.

Scalability and the Locality Property

By framing the nMA as a local version of an Inverse Autoregressive Flow (IAF), the authors can compute the exact log-density of the approximate posterior, a prerequisite for optimizing the Evidence Lower Bound (ELBO). This approach effectively trades long-range dependency for extreme scalability.

Figure 4: Maximum Mean Discrepancy (MMD) vs. Iteration for varying sequence lengths T. The overlapping curves demonstrate that the number of iterations to reach convergence remains constant as the data size increases, confirming O(1) scaling.

As shown in Figure 4, empirical tests on AR(1) models confirm that the number of iterations required for convergence remains nearly constant even as the sequence length $T$ scales from 5,000 to 100,000 steps. This $O(1)$ scaling per iteration allows the model to handle datasets that were previously inaccessible to traditional Bayesian methods.

Experimental Evaluation

The authors evaluated the nMA model across several challenging benchmarks, including non-linear predator-prey dynamics (Lotka-Volterra) and high-dimensional neuron models (FitzHugh-Nagumo).

Figure 5: Posterior parameter densities and latent state recovery. The model produces posterior estimates (left) that closely match ground truth and successfully recovers hidden latent trajectories (right) even in complex dynamical systems.

Key findings from these experiments include:

  • Accuracy: The nMA produces posterior parameter estimates that are nearly indistinguishable from "gold standard" MCMC results (see Figure 5, left).
  • Latent Recovery: The model successfully imputes latent states between sparse observations, capturing complex local dynamics and hidden components in high-dimensional systems (see Figure 5, right).
  • Real-World Efficiency: In a stochastic volatility analysis of U.S. Treasury bill rates, the nMA achieved convergence in just 20 minutes on a single GPU.

Conclusion

The Neural Moving Average model provides a powerful bridge between the flexibility of deep learning and the rigor of state space modeling. While the model's reliance on a finite receptive field limits its ability to capture very long-range dependencies, this trade-off enables unprecedented scalability. Future work may address these limitations through multi-scale architectures like dilated convolutions or more expressive flow bijections, further expanding the reach of amortized variational inference in time-series analysis.

Summary updated

BibTeX
@misc{ryder2019scalable,
  author = {Tom Ryder and Andrew Golightly and Isaac Matthews and Dennis Prangle},
  title = {{Scalable approximate inference for state space models with normalising flows}},
  year = {2019},
  eprint = {1910.00879},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.00879},
}
Figure