NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Stein Π-Importance Sampling

Congye Wang, Wilson Ye Chen, Heishiro Kanagawa, Chris J. Oates

Abstract

Stein discrepancies have emerged as a powerful tool for retrospective improvement of Markov chain Monte Carlo output. However, the question of how to design Markov chains that are well-suited to such post-processing has yet to be addressed. This paper studies Stein importance sampling, in which weights are assigned to the states visited by a $\Pi$-invariant Markov chain to obtain a consistent approximation of $P$, the intended target. Surprisingly, the optimal choice of $\Pi$ is not identical to the target $P$; we therefore propose an explicit construction for $\Pi$ based on a novel variational argument. Explicit conditions for convergence of Stein $\Pi$-Importance Sampling are established. For $\approx 70\%$ of tasks in the PosteriorDB benchmark, a significant improvement over the analogous post-processing of $P$-invariant Markov chains is reported.

Introduction

In Bayesian inference, the primary goal is often to characterize a target distribution $P$ (the posterior), typically known only up to a normalization constant. Markov chain Monte Carlo (MCMC) methods are the standard tool for generating samples from $P$, but the resulting approximations can be noisy and inefficient. Recent advancements have introduced Stein discrepancies as a means to post-process MCMC output, re-weighting samples to minimize error.

A fundamental assumption in this pipeline has been that the Markov chain should target $P$ itself. This paper challenges that assumption, asking: if we intend to apply Stein post-processing, is $P$ truly the optimal distribution to sample from? The authors demonstrate that sampling from a specifically designed, "over-dispersed" distribution $\Pi$ yields significantly better results.

Methodology

The authors employ a variational argument to derive the optimal sampling distribution $\Pi$. They prove that to minimize the expected Stein discrepancy, $\Pi$ should have a density $\pi(x) \propto p(x) \sqrt{k_P(x,x)}$, where $k_P$ is the Stein kernel associated with the target.

To implement this, the authors propose S$\Pi$IS-MALA, which adapts the Metropolis-Adjusted Langevin Algorithm (MALA) to be invariant to $\Pi$ rather than $P$. For scenarios involving large datasets where re-weighting every sample is computationally prohibitive, they introduce Stein $\Pi$-Thinning, a greedy selection method that extracts a high-quality subset of samples from the $\Pi$-invariant chain. Crucially, the paper provides explicit, verifiable conditions for the strong consistency of these algorithms, ensuring theoretical convergence.

Key Insights and Ideas

The central insight of this work is the "over-dispersion" of the optimal $\Pi$. By sampling more heavily in the tails of the distribution, the Stein post-processing step has a richer set of "raw material" to accurately define the boundaries and weights of the target distribution.

Comparison of the target distribution $P$ and various optimal sampling distributions $\Pi$ derived from different Stein kernels.

The specific deviation of $\Pi$ from $P$ is kernel-dependent. For instance, a Langevin-Stein kernel leads to a $\Pi$ that focuses on regions where the target's gradient changes most rapidly. Interestingly, as the dimensionality $d$ increases, the optimal $\Pi$ tends to converge toward $P$, suggesting that the benefits of $\Pi$-sampling are most pronounced in low-to-medium dimensional problems.

Empirical Evaluation and Results

The method was rigorously tested using PosteriorDB, a benchmark containing 149 diverse Bayesian models. The authors focused on 40 models (dimensions $d=3$ to $66$) to compare $\Pi$-sampling against standard $P$-sampling.

Expected Kernel Stein Discrepancy (KSD) vs. sample size $n$, showing the convergence rates for different sampling strategies.

Key findings include:

  • Performance Gains: S$\Pi$IS-MALA outperformed standard Stein Importance Sampling in 73% of the benchmark tasks when using the Langevin-Stein kernel.
  • Superiority over Raw MCMC: In 100% of test cases for the Langevin kernel, the proposed method significantly improved upon raw, unprocessed MCMC output.
  • Computational Efficiency: The thinning variant (S$\Pi$T-MALA) achieved minimum error levels using only 10% to 50% of the total samples, providing a substantial speedup for storage-intensive applications.

Limitations and Future Work

Despite its strengths, the approach requires second-order derivatives (the Hessian) of the log-target density, which can be computationally demanding for complex models. Additionally, like other score-based Stein methods, it may struggle with multi-modal distributions, potentially miscalculating the relative weights between distant modes. Future research may explore extending this "optimal $\Pi$" framework to gradient-free Stein discrepancies to alleviate the need for second derivatives.

Summary updated

BibTeX
@inproceedings{wang2023stein,
  author = {Congye Wang and Wilson Ye Chen and Heishiro Kanagawa and Chris J. Oates},
  title = {{Stein Π-Importance Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
}
Figure