SMCP3: Sequential Monte Carlo with Probabilistic Program Proposals

Alexander K. Lew, George Matheos, Tan Zhi-Xuan, Matin Ghavamizadeh, Nishad Gothoskar, Stuart Russell, Vikash MansinghkaOpenReview 2023

Abstract

This paper introduces SMCP3, a method for automatically implementing custom sequential Monte Carlo samplers for inference in probabilistic programs. Unlike particle filters and resample-move SMC (Gilks and Berzuini, 2001), SMCP3 algorithms can improve the quality of samples and weights using pairs of Markov proposal kernels that are also specified by probabilistic programs. Unlike Del Moral et al. (2006b), these proposals can themselves be complex probabilistic computations that generate auxiliary variables, apply deterministic transformations, and lack tractable marginal densities. This paper also contributes an efficient implementation in Gen that eliminates the need to manually derive incremental importance weights. SMCP3 thus simultaneously expands the design space that can be explored by SMC practitioners and reduces the implementation effort. SMCP3 is illustrated using applications to 3D object tracking, state-space modeling, and data clustering, showing that SMCP3 methods can simultaneously improve the quality and reduce the cost of marginal likelihood estimation and posterior inference.

Introduction

Sequential Monte Carlo (SMC), or particle filtering, is a powerful method for tracking evolving posterior distributions in dynamic systems. However, designing effective proposals for SMC involves a significant challenge: simple proposals often yield poor samples, while complex proposals—such as those involving optimization steps or auxiliary variables—require the manual derivation of exact probability densities to calculate valid importance weights.

When complex proposals involve deterministic mathematics or auxiliary randomness, calculating these weights requires deriving tedious and error-prone change-of-variables corrections. SMCP3 addresses this by providing a framework that automatically handles these calculations, allowing practitioners to focus on designing high-quality proposals rather than the underlying calculus.

The SMCP3 Framework

SMCP3 defines updates using pairs of probabilistic computations—standard probabilistic programs that can sample random variables and execute deterministic code.

  • The Forward Proposal ($K$): Takes an existing particle and proposes a new state. It can utilize auxiliary randomness and deterministic transformations (like gradient steps) to identify high-quality states.
  • The Backward Proposal ($L$): Given a new state, this program attempts to "guess" the auxiliary randomness used by $K$ to reach it. It exists purely to facilitate the mathematical computation of weights.

By pairing $K$ and $L$, SMCP3 can automatically compute the correct incremental importance weight for the new particle. The implementation in the Gen Probabilistic Programming Language (PPL) uses static analysis and forward-mode Automatic Differentiation (AD) to automatically calculate the Jacobian determinants needed for change-of-variables corrections.

Comparison between standard SMC Samplers and the proposed SMCP3 update.

Empirical Evaluation

The authors evaluated SMCP3 on a mix of synthetic and real-world datasets, demonstrating its ability to outperform standard baselines like Bootstrap Particle Filters and Resample-Move SMC.

State-Space Modeling

On a 100-dimensional Gaussian state-space tracking task, SMCP3 achieved a significantly better log marginal likelihood estimate (-2271.03) compared to Resample-Move SMC (-2828.29) and the Bootstrap filter (-4347.67).

Data Clustering

Using the Medicare Hospital Compare dataset for online Bayesian data clustering, SMCP3 dynamically split and merged clusters as new data arrived. It achieved a log marginal likelihood of -13882.47, vastly outperforming Resample-Move (-16898.79) and Locally Optimal SMC (-40851.15). Furthermore, SMCP3 was more efficient, taking 34.0 seconds on average compared to 42.3 seconds for the Resample-Move baseline.

3D Object Tracking

SMCP3 was also applied to tracking a sliding box in RGB-D video, utilizing a non-differentiable renderer within the proposal mechanism to maintain high-quality state estimates.

Key Insights and Discussion

A core insight of SMCP3 is that proposals do not require tractable marginal densities. As long as a backward program ($L$) can be written to approximate the forward program's ($K$) path, valid particle weights can be computed. This allows SMC to be viewed as a generalization of Involutive MCMC, where programs that would be invalid for MCMC (due to lack of reversibility) can function as valid forward proposals in SMCP3.

Additionally, SMCP3 ensures that particles receive "credit" for high-quality moves. Unlike standard Resample-Move methods that use MCMC to improve locations without updating weights, SMCP3 properly re-weights particles, preserving high-quality trajectories that might otherwise be lost during resampling.

While SMCP3 reduces implementation effort, designing effective $K$ and $L$ kernels still requires practitioner intuition. Future work includes exploring automated tuning of these proposals and leveraging massively parallel hardware for further performance gains.

Summary updated

BibTeX
@misc{lew2023smcp,
  author = {Alexander K. Lew and George Matheos and Tan Zhi-Xuan and Matin Ghavamizadeh and Nishad Gothoskar and Stuart Russell and Vikash Mansinghka},
  title = {{SMCP3: Sequential Monte Carlo with Probabilistic Program Proposals}},
  year = {2023},
  url = {https://openreview.net/forum?id=9hez8FKelgc},
  howpublished = {OpenReview},
}

Loading related content...

Figure