Measuring Sample Quality with Kernels

Jackson Gorham, Lester W. MackeyarXiv 2017

Abstract

Approximate Markov chain Monte Carlo (MCMC) methods offer faster sampling at the cost of potential bias. Standard MCMC diagnostics often fail to detect these biases, necessitating the use of computable Stein discrepancy measures that can provably determine convergence. Kernel Stein Discrepancy (KSD) is a popular choice due to its closed-form evaluation. However, this work identifies a significant limitation: commonly used KSDs, such as those based on Gaussian kernels, fail to detect non-convergence in dimensions greater than two. We provide a theoretical framework for weak convergence of KSDs and demonstrate that kernels with slowly decaying tails, specifically the Inverse Multiquadric (IMQ) kernel, are necessary to reliably determine convergence. Our findings show that IMQ-based KSDs are robust, computationally efficient, and superior for tasks like sampler hyperparameter selection and hypothesis testing.

Introduction

Bayesian inference increasingly relies on biased MCMC methods to handle large-scale datasets. While these methods are fast, they lack the asymptotic guarantees of exact MCMC. Traditional diagnostics like trace plots or effective sample size (ESS) are insufficient for detecting systematic biases. Stein discrepancies offer a solution by measuring the distance between a sample and a target distribution without requiring the normalizing constant. KSDs are particularly attractive for their simplicity, yet their reliability in high-dimensional spaces was previously unproven.

The High-Dimensional Blind Spot of Light-Tailed Kernels

The core contribution of this research is the discovery that "light-tailed" kernels, such as Gaussian or Matérn kernels, are blind to mass escaping to infinity in dimensions $d \ge 3$. If sample points diverge faster than the kernel's influence decays, the KSD can erroneously approach zero, suggesting convergence when the sampler has failed.

Figure 2: Comparison of KSDs across different kernels and dimensions. In high dimensions (d=20), Gaussian and Matérn KSDs fail to detect off-target samples, while the IMQ KSD remains robust.

As shown in Figure 2, for off-target samples in 20 dimensions, the Gaussian and Matérn KSDs decrease as if the sample were converging to the target. In contrast, the IMQ KSD correctly identifies the discrepancy.

A Robust Solution: The IMQ Kernel

To address this, we propose using the Inverse Multiquadric (IMQ) kernel: $k(x,y) = (c^2 + \|x-y\|^2)^\beta$ with $\beta \in (-1, 0)$. The slow decay of the IMQ kernel ensures that points far from the target are adequately penalized, making it a "convergence-determining" metric. This property is essential for ensuring the "tightness" of the sample sequence, preventing mass from vanishing at infinity undetected.

Practical Applications and Results

The IMQ KSD is not only theoretically sound but also practically advantageous. It is $O(n^2)$ and easily parallelizable, making it significantly faster than alternative Stein discrepancies like Graph Stein Discrepancy.

In hyperparameter selection for approximate slice sampling, standard metrics like ESS can be misleading. Figure 5 illustrates a scenario where ESS suggests that the most biased setting is optimal. The KSD, however, correctly identifies the setting that minimizes bias.

Figure 5: Comparison of Effective Sample Size (ESS) and KSD for hyperparameter selection. ESS incorrectly favors higher bias, whereas KSD identifies the optimal tolerance parameter.

Furthermore, in one-sample goodness-of-fit tests, IMQ-based KSDs maintain high power even as dimensionality increases, whereas Gaussian-based tests lose power rapidly.

Conclusion

This work highlights a critical failure mode in existing sample quality metrics and provides a theoretically grounded alternative. By adopting heavy-tailed kernels like the IMQ, researchers can reliably diagnose the convergence of biased MCMC samplers in high-dimensional settings. Future work will explore extending these measures to constrained supports and improving the scalability of $O(n^2)$ computations for massive datasets.

Summary updated

BibTeX
@misc{gorham2017measuring,
  author = {Jackson Gorham and Lester W. Mackey},
  title = {{Measuring Sample Quality with Kernels}},
  year = {2017},
  eprint = {1703.01717},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.01717},
}
Figure