Introduction
Goodness-of-Fit (GOF) testing is a fundamental task in statistical inference, asking whether a given set of samples $\{x_i\}_{i=1}^n$ originates from a specific target distribution $p$. In modern machine learning and Bayesian statistics, this problem is complicated by the fact that many target distributions are only known up to a normalization constant. Kernelized Stein Discrepancy (KSD) has emerged as a powerful tool for this scenario because it utilizes the "score function"—the gradient of the log-density—which bypasses the need for the partition function.
Despite its popularity, KSD suffers from a significant theoretical and practical limitation: it is often "blind" to discrepancies in the relative weights of well-separated modes. This paper introduces a novel perturbation approach to address this blindness, significantly enhancing the power of KSD-based tests in complex, multi-modal distributions.
The Problem: Blindness to Isolated Components
KSD relies on the Stein operator, which essentially checks if the average gradient of a function under the data matches the expected gradient under the model. Because gradients are local operators, KSD is highly sensitive to local shifts in density but struggles with global structure.
If a distribution consists of two or more modes separated by regions of near-zero probability, the score function in the intervening space is effectively zero. Consequently, if a model expects a 50/50 split between two peaks but the observed data shows a 90/10 split, the KSD test often fails to detect the error. The paper formally demonstrates a "Power-Distance Tradeoff": for standard KSD, the sample size required to detect differences in mixing weights grows exponentially as the distance between modes increases. In practice, this means that as modes move apart, the test's power drops to the level of a random guess (roughly the significance level $\alpha$).
The Perturbed KSD (pKSD) Framework
To overcome this limitation, the authors propose Perturbed KSD (pKSD). The core idea is to transform the data using a Markov transition kernel before applying the Stein test. This process involves several key components:
1. Invariant Perturbation
The authors apply a Markov transition kernel $K$ to the data. Crucially, this kernel is designed to be invariant to the target distribution $p$. By ensuring $p$ is the stationary distribution of the kernel, the test maintains its "Type-I error" control; if the data truly came from $p$, the perturbation will not change the underlying distribution, and the test will correctly fail to reject the null hypothesis.
2. Inter-modal Jumps
To address the blindness issue, the perturbation is specifically designed to include "jump proposals." By estimating the locations of the modes in the target distribution (e.g., using BFGS optimization), the kernel can "shuffle" data points between these modes. If the data has incorrect mixing proportions, these jumps move samples from high-density areas in the data to areas that are low-density relative to the model's expectations. This creates a local discrepancy that the KSD’s score function can easily detect.
3. Test Variants: spKSD and ospKSD
The authors introduce two practical implementations:
- Sum-pKSD (spKSD): This variant combines multiple kernels, including the identity (no perturbation), to ensure the test remains sensitive to both local and global discrepancies.
- Optimized pKSD (ospKSD): This version uses a small training subset of the data to optimize the "jump scale" ($\theta$), maximizing the test's power before running the final evaluation.
Experimental Evaluation
The proposed methods were evaluated against standard KSD and other state-of-the-art variants like KSDAGG and FSSD across several benchmarks:
- Gaussian Mixtures: In both 1D and 50D scenarios, the authors moved modes apart to test the limits of the methods. While standard KSD power collapsed as distance increased, spKSD and ospKSD maintained nearly 100% power.
- Sensor Network Localisation: This real-world Bayesian problem involves inferring sensor locations. The pKSD framework was used to diagnose the quality of samples from a Repelling-Attracting Metropolis (RAM) algorithm. ospKSD was the only method capable of consistently detecting when the sampler missed entire modes of the posterior.
- Restricted Boltzmann Machines (RBM): The method proved robust in high-dimensional latent variable models, a standard benchmark for modern GOF tests.
Key Insights
A notable theoretical contribution of the paper is the reframing of non-irreducibility. While MCMC samplers require irreducibility to explore a space, the pKSD framework uses kernels that may not be irreducible. The goal is not exploration, but the intentional superposition of densities from different modes to highlight weight imbalances. This "mode aggregation" makes the error obvious to the Stein operator by effectively stacking the discrepancies on top of one another.
Limitations and Future Work
While pKSD offers a dramatic improvement in power, it introduces new requirements. The method relies on the ability to find the modes and Hessians of the target distribution. In extremely high-dimensional or highly complex "wiggly" distributions, this optimization step can be computationally expensive. Furthermore, the current jump proposals are optimized for elliptic distributions (like Gaussians); future work may involve developing kernels for more complex geometries, such as distributions constrained to manifolds.
Conclusion
By introducing invariant perturbations that specifically target inter-modal transitions, the pKSD framework resolves a long-standing weakness in Kernelized Stein Discrepancy. It provides a robust, high-power alternative for goodness-of-fit testing in multi-modal settings, ensuring that statistical tests are no longer blind to the global structure of the data.
Summary updated