Measuring Sample Quality with Diffusions

Jack Gorham, Andrew B. Duncan, Sebastian J. Vollmer, Lester W. MackeyThe Annals of Applied Probability 2016 · DOI

Abstract

Stein's method for measuring convergence to a continuous target distribution relies on an operator characterizing the target and Stein factor bounds on the solutions of an associated differential equation. While such operators and bounds are readily available for a diversity of univariate targets, few multivariate targets have been analyzed. We introduce a new class of characterizing operators based on Itô diffusions and develop explicit multivariate Stein factor bounds for any target with a fast-coupling Itô diffusion. As example applications, we develop computable and convergence-determining diffusion Stein discrepancies for log-concave, heavy-tailed, and multimodal targets and use these quality measures to select the hyperparameters of biased Markov chain Monte Carlo (MCMC) samplers, compare random and deterministic quadrature rules, and quantify bias-variance tradeoffs in approximate MCMC. Our results establish a near-linear relationship between diffusion Stein discrepancies and Wasserstein distances, improving upon past work even for strongly log-concave targets. The exposed relationship between Stein factors and Markov process coupling may be of independent interest.

Introduction

In Bayesian statistics and machine learning, the gold standard for approximating complex probability distributions is the use of finite sample sets, typically generated via Markov chain Monte Carlo (MCMC) algorithms. However, a fundamental challenge remains: how do we know if a set of samples is actually "good"? Because the target distribution $P$ is often known only up to a normalizing constant, standard metrics like the Kullback-Leibler (KL) divergence or the Wasserstein distance are computationally intractable.

Stein discrepancies emerged as a solution to this problem, offering a way to assess sample quality without knowing the normalization constant. However, previous iterations of these discrepancies were largely restricted to "well-behaved," strongly log-concave distributions. This paper introduces diffusion Stein discrepancies (DSDs), a generalized framework that leverages the theory of Itô diffusions to evaluate samples from heavy-tailed, multimodal, and other challenging multivariate distributions.

Methodology: Diffusions as Characterizing Operators

The core innovation of this work is the use of Itô diffusions—continuous stochastic processes—to define Stein operators. By selecting a diffusion that has the target distribution $P$ as its stationary distribution, the authors create a "characterizing operator" that can be used to test how well a sample set matches $P$.

Stein Factors via Markov Coupling

A significant theoretical hurdle in Stein's method is the derivation of "Stein factors," which control the error and sensitivity of the metric. The authors provide a breakthrough by relating these factors to the Wasserstein decay rate of the diffusion. If the underlying diffusion process converges quickly to its stationary distribution (a property known as fast-coupling), the resulting Stein discrepancy is guaranteed to be a reliable measure of convergence. This allows for the first explicit multivariate Stein factor bounds for a wide range of non-standard targets.

The Spanner Discrepancy Algorithm

To make these theoretical insights practical, the authors introduce a computationally efficient implementation. Instead of optimizing over an infinite set of functions, they solve a finite-dimensional linear program over a "graph Stein set." This set is constructed using a geometric spanner—a sparse graph that preserves the distance between sample points. This approach reduces the computational complexity to $O(n \log n)$ or $O(n)$, making it feasible for large-scale datasets.

Experimental Validation

The authors evaluated the DSD framework across several challenging scenarios to demonstrate its robustness compared to traditional diagnostics like Effective Sample Size (ESS).

  1. Multimodal Detection: Using synthetic Gaussian mixtures, the DSD successfully identified when a sampler failed to capture all modes of a distribution, a scenario where standard diagnostics often fail.
  2. Heavy-Tailed Regression: The metric was applied to the Australian Institute of Sport (AIS) dataset (biometric data) using Bayesian Student’s t regression. The DSD accurately quantified sample quality even when the target distribution exhibited heavy tails.
  3. Robust Regression: On the Minnesota Radon dataset, the authors used DSD to evaluate Huber regression, demonstrating the metric's utility in robust statistical modeling.
  4. Hyperparameter Tuning: In experiments with Stochastic Gradient Riemannian Langevin Dynamics (SGRLD), the DSD correctly identified the optimal step size to balance exploration and bias. In contrast, ESS incorrectly suggested that larger, more biased step sizes were superior because they appeared to "mix" faster.

Key Insights

  • Coupling and Smoothness: The speed at which a diffusion process "forgets" its starting point (coupling) directly determines the smoothness of the solutions to the Stein equation. This link provides a new toolkit for analyzing multivariate distributions.
  • Bias Detection: Unlike traditional MCMC diagnostics that only measure internal chain consistency, DSDs can detect stationary bias—whether the chain is converging to the wrong distribution entirely. This is critical for tuning modern "approximate" MCMC algorithms.
  • Geometric Flexibility: By using preconditioned or Riemannian diffusions, the DSD can be tailored to the specific geometry of the target distribution, making the metric more sensitive to errors in high-dimensional space.

Conclusion and Future Work

The diffusion Stein discrepancy provides a rigorous, near-linear relationship with the $L^1$ Wasserstein distance, ensuring that a low discrepancy score truly reflects high sample quality. While the current framework requires distributions to have a finite mean and Lipschitz continuous coefficients, it represents a major step forward in MCMC diagnostics.

Future research may extend these results to distributions with undefined means using the Dudley metric or explore scaling strategies for extremely high-dimensional spaces where geometric spanner construction becomes more difficult. To facilitate adoption, the authors have released the SteinDiscrepancy.jl package in Julia.

Summary updated

BibTeX
@article{gorham2016measuring,
  author = {Jack Gorham and Andrew B. Duncan and Sebastian J. Vollmer and Lester W. Mackey},
  title = {{Measuring Sample Quality with Diffusions}},
  journal = {The Annals of Applied Probability},
  year = {2016},
  doi = {10.1214/19-aap1467},
}
Figure