[Paper Review] Measuring the reliability of MCMC inference with bidirectional Monte Carlo
This paper introduces BREAD, a protocol that uses bidirectional Monte Carlo to bound the symmetrized KL divergence (Jeffreys divergence) between approximate MCMC samples and the true posterior, enabling reliable validation of MCMC inference in probabilistic programming languages like WebPPL and Stan. It demonstrates that model representation choices—such as collapsing latent variables—significantly impact convergence speed, with BREAD revealing that collapsed models converge faster in WebPPL but not in Stan, and also uncovering a critical bug in WebPPL's multivariate Gaussian sampling.
Markov chain Monte Carlo (MCMC) is one of the main workhorses of probabilistic inference, but it is notoriously hard to measure the quality of approximate posterior samples. This challenge is particularly salient in black box inference methods, which can hide details and obscure inference failures. In this work, we extend the recently introduced bidirectional Monte Carlo technique to evaluate MCMC-based posterior inference algorithms. By running annealed importance sampling (AIS) chains both from prior to posterior and vice versa on simulated data, we upper bound in expectation the symmetrized KL divergence between the true posterior distribution and the distribution of approximate samples. We present Bounding Divergences with REverse Annealing (BREAD), a protocol for validating the relevance of simulated data experiments to real datasets, and integrate it into two probabilistic programming languages: WebPPL and Stan. As an example of how BREAD can be used to guide the design of inference algorithms, we apply it to study the effectiveness of different model representations in both WebPPL and Stan.
Motivation & Objective
- To address the lack of reliable, quantitative measures for assessing the accuracy of MCMC-based posterior inference in black-box probabilistic programming systems.
- To develop a general, automatic, and rigorous method for monitoring inference quality without requiring expert interpretation of convergence diagnostics.
- To validate that inference performance on simulated data accurately reflects performance on real-world data, ensuring relevance of benchmarking experiments.
- To guide model representation choices in probabilistic programming by quantitatively comparing convergence behavior across different formulations.
- To detect implementation bugs in probabilistic programming systems by verifying theoretical consistency between forward and reverse AIS chains.
Proposed method
- Extends bidirectional Monte Carlo (BDMC) to estimate an upper bound in expectation on the symmetrized KL divergence (Jeffreys divergence) between approximate posterior samples and the true posterior.
- Applies the method to MCMC-based inference algorithms that can be viewed as importance sampling over an extended state space, such as annealed importance sampling (AIS) and sequential Monte Carlo (SMC).
- Implements a reverse AIS chain starting from exact posterior samples to compute an upper bound on the divergence, while the forward chain provides a stochastic lower bound.
- Introduces BREAD (Bounding Divergences with REverse Annealing), a protocol that infers hyperparameters on real data, simulates data from them, and evaluates inference quality on the simulated data to validate relevance to real data.
- Integrates BREAD into WebPPL and Stan, enabling automatic, end-to-end validation of inference quality within these probabilistic programming frameworks.
- Uses the consistency of inference behavior between real and simulated data as a diagnostic tool to detect implementation errors, such as incorrect posterior sampling in the reverse chain.
Experimental results
Research questions
- RQ1How can we obtain a reliable, quantitative measure of the accuracy of MCMC-based posterior inference that is independent of heuristic convergence diagnostics?
- RQ2To what extent does the performance of MCMC inference on simulated data reflect its performance on real-world data, and how can this be validated?
- RQ3How do different model representations—such as collapsed vs. uncollapsed latent variable structures—affect the convergence speed and efficiency of MCMC inference in probabilistic programming languages?
- RQ4Can the theoretical guarantees of bidirectional Monte Carlo be used to detect subtle implementation bugs in probabilistic programming systems?
- RQ5What insights can be gained about the trade-offs between computational efficiency and convergence speed when choosing between different model parameterizations?
Key findings
- BREAD successfully detects a critical bug in WebPPL’s multivariate Gaussian sampling routine, where reverse AIS chains produced lower log-likelihood estimates than forward chains, violating theoretical guarantees and indicating incorrect posterior samples.
- In Stan, the collapsed matrix factorization model converges faster in terms of MCMC steps, but the uncollapsed model is more efficient in terms of running time due to higher per-step computational cost in the collapsed version.
- In WebPPL, the collapsed matrix factorization model converges significantly faster in terms of running time, making it the preferred representation in that language despite similar per-step costs.
- The BDMC upper bound on the Jeffreys divergence is highly accurate on small toy examples, where both the true divergence and the bound can be computed exactly, validating the method’s reliability.
- The protocol demonstrates that inference behavior on simulated data is consistent with real data, supporting the use of simulated benchmarks to guide inference configuration and model design.
- BREAD reveals that model representation choices have language-specific impacts: collapsing variables improves performance in WebPPL but not in Stan, highlighting the importance of language-aware model engineering.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.