Automatic Rao-Blackwellization for Sequential Monte Carlo with Belief Propagation

Waïss Azizian, Guillaume Baudart, Marc Lelarge

TL;DR

Exact Bayesian inference in complex state-space models is generally intractable, while standard Sequential Monte Carlo (SMC) filters suffer from high variance and particle degeneracy. This paper introduces OnlineSampling.jl, a reactive probabilistic programming language in Julia that pairs SMC with Gaussian Belief Propagation to automate Rao-Blackwellization. By analytically solving linear Gaussian tree structures and sampling only when non-linearities arise, the algorithm dramatically improves filter stability with far fewer particles.

What Problem Does This Paper Address?

In online state estimation (such as tracking an agent’s position and velocity from noisy sensor feeds), Bayesian filtering must continuously update posterior beliefs over time. Standard particle filters (e.g., bootstrap Sequential Monte Carlo) can approximate arbitrary models, but they scale poorly: high-dimensional or non-linear state spaces demand enormous particle counts to avoid particle collapse and divergence.

Rao-Blackwellization mitigates this by analytically integrating out (marginalizing) the variables that admit closed-form solutions (like linear-Gaussian components), leaving the particle filter to sample only the non-linear "hard" variables. However, doing this manually is mathematically tedious and model-specific. Existing automation frameworks (like Delayed Sampling) typically restrict analytical tracking to simple linear chains and cannot easily reverse parent–child dependencies on the fly.

Methods

The authors introduce an end-to-end approach combining synchronous reactive programming with symbolic-numeric inference:

  • Reactive PPL (OnlineSampling.jl): An embedded Julia domain-specific language modeled after ProbZelus. It executes programs in discrete lockstep data streams using macros (@node, @init, @prev, and @observe).
  • Gaussian Tree Belief Propagation: The system models tractable random variables as rooted Gaussian trees. By exploiting conditional Gaussian conjugacy (inverting parent–child relationships along paths), the algorithm dynamically shifts the root of the tree to any observed node and exact-marginalizes it using localized message passing.
  • Hybrid Stream Belief Propagation (SBP): For partially tractable models, each Monte Carlo particle maintains exact Gaussian beliefs over linear tree components. Non-linear operations trigger sampling to concrete values, resuming exact propagation downstream.
  • Bounded Memory Filtering: Because filtering only requires estimating the present state distribution rather than full historical smoothing, the algorithm drops ancestral nodes, relying on Julia’s native garbage collector to maintain a bounded memory footprint.

Datasets

The authors evaluate the framework on synthetic benchmark tasks rather than static empirical datasets:

  • Linear Gaussian State-Space Model: A canonical random-walk linear dynamical system used to benchmark filtering accuracy and execution speed against established baselines.
  • Discretized Brownian Bridge: A 1D random walk starting at zero and conditioned to end at zero at step $T$, used to verify analytic covariance calculations.
  • Non-linear Trail Runner Tracker: A 5,000-step simulation tracking a runner's speed, position, and terrain altitude. Speed follows a linear Gaussian walk, while altitude is computed via a non-linear elevation map. Observations arrive every 5 timesteps.

Key Insights and Ideas

  • Dynamic Tree Re-rooting over Rigid Directed Graphs: Prior automated Rao-Blackwellization engines (like Delayed Sampling) struggle when observations invert standard generative directions. By formulating subgraphs as undirected Gaussian trees and rerooting them on-demand along specific query paths, the inference engine flexibly marginalizes variables without full graph message passing.
  • Leveraging Language Garbage Collection for Markovian Bounds: Rather than engineering custom tree-pruning logic to prevent memory bloat over infinite horizons, the system simply drops references to past states once conditioned, letting Julia's runtime garbage collector naturally bound memory usage.
  • Strategic Observation Placement: Structuring the model so linear observations (e.g., speedometer readings) are registered before calling non-linear transformations (e.g., trail elevation maps) isolates the linear sub-problem, enabling exact Kalman filtering over speed while isolating Monte Carlo sampling strictly to position and altitude.

Key Results

  • Kalman Equivalence: On linear SSMs, the algorithm's posterior estimates agree numerically with dedicated Kalman filter libraries (Kalman.jl and ReactiveMP.jl). While specialized Kalman solvers are faster due to minimal abstraction overhead, SBP remains competitive across observation horizons up to $10^4$ steps.
  • Covariance Recovery: On the Brownian bridge, Gaussian belief propagation matches the theoretical covariance matrix $\mathrm{Cov}(B(s), B(t)) = \min(s, t) - st / T$.
  • Divergence Prevention: In the non-linear runner tracking task over 5,000 steps, a standard SMC particle filter diverged early across 100 trials, even when equipped with 40 particles. In contrast, the SBP algorithm tracked the runner to the end of the 5,000-step run almost 100% of the time with just 10 particles.

Limitations and Future Work

  • Gaussian Tree Restriction: Exact symbolic marginalization is currently limited to tree-structured Gaussian subgraphs. It does not handle loopy Gaussian graphical models without approximation, nor does it yet support general exponential family conjugates (e.g., Dirichlet-Multinomial or Gamma-Poisson).
  • Interpretive Overhead: For purely linear systems, the dynamic graph manipulation incurs higher computational latency than dedicated matrix-based Kalman routines.
  • Future Work: The authors propose deeper integration with Julia’s metaprogramming ecosystem, especially coupling reactive stream inference with reverse-mode automatic differentiation libraries.

Summary updated

BibTeX
@inproceedings{azizian2023automatic,
  author = {Waïss Azizian and Guillaume Baudart and Marc Lelarge},
  title = {{Automatic Rao-Blackwellization for Sequential Monte Carlo with Belief Propagation}},
  booktitle = {SPIGM @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=YNf2XCQqM1},
}
Figure