Online Variational Sequential Monte Carlo

Alessandro Mastrototaro, Jimmy Olsson

This paper, recently presented at ICML 2024, introduces Online Variational Sequential Monte Carlo (OVSMC). It bridges the gap between high-accuracy batch inference and the practical necessity of processing streaming data in real-time.

TL;DR

OVSMC is a new algorithm that enables simultaneous learning of model parameters and optimal particle proposals for state-space models entirely on-the-fly. By distributing the gradient of the variational evidence lower bound (ELBO) over time, it achieves faster convergence and lower computational overhead than traditional batch methods or smoothing-based online alternatives.

What Problem Does This Paper Address?

State-Space Models (SSMs) are the bread and butter of time-series analysis, used in everything from tracking objects in video to modeling financial volatility. However, SSMs are notoriously difficult to train because the "latent states" (the underlying reality) are hidden behind noisy observations.

Traditional tools like Sequential Monte Carlo (SMC) (particle filters) are great for tracking but struggle with parameter learning due to "path degeneracy"—where the history of particles collapses over time. Variational Inference (VI) offers a way to learn parameters by optimizing a lower bound on the likelihood (the ELBO), but it often lacks the flexibility to handle complex temporal dependencies.

Variational SMC (VSMC) combined these two, using particles to form a tighter ELBO. The catch? VSMC is an offline method. It requires you to have the entire dataset upfront and re-process it repeatedly. In a world of streaming data and massive datasets, we need a way to learn as the data arrives.

Methods

The authors propose OVSMC, which transforms the batch VSMC objective into a recursive, online update scheme using stochastic approximation. Key technical components include:

  • The Reparameterization Trick: To make the particle filtering process differentiable, the authors use a standard trick from Variational Autoencoders (VAEs), allowing gradients to flow through the sampling steps.
  • Dual-Rate Optimization: A standout feature of OVSMC is its use of two different particle counts. It uses a small number of particles ($L$) to adapt the proposal distribution (how we guess the next state) and a larger number ($N$) to learn the model parameters.
  • Decoupled Sampling: To ensure theoretical stability, the algorithm uses one set of random variables to estimate the gradient and another to propagate the particles, preventing the "collapsing" issues common in other online methods.
  • No Backward Sampling: Unlike many online EM algorithms, OVSMC does not require computationally expensive backward smoothing passes, keeping its memory footprint constant over time.

Datasets

The authors evaluated OVSMC across three distinct scenarios:

  1. Linear Gaussian SSMs: Used as a controlled environment to prove convergence and compare against ground truth parameters.
  2. Stochastic Volatility Models: A classic non-linear financial model used to compare OVSMC against PaRIS-based Recursive Maximum Likelihood (RML).
  3. Deep Generative Moving Agent: A complex high-dimensional task where a Variational Recurrent Neural Network (VRNN) learns to predict and "hallucinate" the movement of a plus-shaped agent in a 32x32 video stream, even when the agent is occluded by a central block.

Key Insights and Ideas

  • The "Small L" Advantage: Counter-intuitively, using fewer particles ($L < 10$) is often better for learning the proposal distribution. As the number of particles increases, the signal-to-noise ratio of the proposal gradient actually drops, eventually becoming pure noise. OVSMC exploits this by keeping the proposal learner "lean."
  • Global vs. Local Adaptation: Most online proposal adaptation methods look only at the current time step. OVSMC uses a global Kullback–Leibler (KL) criterion, which guides particles toward high-likelihood regions without over-fitting to local outliers or temporary noise in the data stream.
  • OVSMC as a Batch Challenger: Even when the data isn't streaming, the authors found that OVSMC is a "strong challenger" to batch VSMC. Because it updates parameters more frequently (every time step vs. every full pass), it often reaches a high-quality solution much faster.

Key Results

  • Efficiency: In the moving agent video task, OVSMC completed a single run in less than one hour, whereas the state-of-the-art baseline (Online Variational Filtering) took 17 hours on the same hardware.
  • Speedup: Compared to PaRIS-based RML, OVSMC was three times faster while providing similar or better parameter estimates.
  • Convergence: The authors provided a rigorous proof (Theorem 4.7) showing that OVSMC converges to the same "mean field" as an ideal, infinite-batch VSMC as the number of observations grows.

Limitations and Future Work

  • Consistency: While the algorithm converges to the VSMC target, the authors note that it remains an open question whether this target is always statistically consistent for the true model parameters in all types of SSMs.
  • Non-Stationarity: The current theoretical framework assumes the underlying model parameters are fixed. A natural next step is extending OVSMC to handle "drifting" parameters where the system itself changes over time.
  • Bias: The gradient approximation used is technically biased (a common simplification in VSMC literature). While numerical results show this doesn't hurt performance, a more "unbiased" version could be a future theoretical refinement.

Summary updated

BibTeX
@inproceedings{mastrototaro2024online,
  author = {Alessandro Mastrototaro and Jimmy Olsson},
  title = {{Online Variational Sequential Monte Carlo}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=jbPc3pW6sC},
}
Figure