Evaluating how well a set of samples—such as those generated by a Markov Chain Monte Carlo (MCMC) algorithm—represents a target probability distribution is a foundational challenge in Bayesian statistics. Standard distance measures, like the Kullback-Leibler (KL) divergence, are often impossible to compute directly because the target distribution is usually only known up to an intractable normalization constant.
Stein Discrepancies (SDs) bypass this issue by utilizing the "score function" (the gradient of the log-density), which does not require the normalization constant. Historically, the gold standard has been the Kernel Stein Discrepancy (KSD). While KSD boasts strong theoretical guarantees, it suffers from a massive computational bottleneck: its cost grows quadratically ($O(N^2)$) with the number of samples $N$. Existing linear-time alternatives, such as the Finite-Set Stein Discrepancy (FSSD), solve the speed issue but often suffer from a severe degradation in statistical power, frequently failing to detect poor samples in high-dimensional spaces.
To bridge this gap, researchers have introduced Random Feature Stein Discrepancies (RΦSDs), a new class of quality measures that achieve the high statistical power of quadratic-time methods while operating in near-linear time.
The RΦSD Approach
The core innovation is the introduction of Feature Stein Discrepancies (ΦSDs). Instead of relying on the implicit features used in standard kernel methods, the authors explicitly define a family of quality measures that can be represented as integrals over a feature space.
To make these computations tractable and fast, the method employs randomization via importance sampling. By drawing $M$ random features from a carefully chosen proposal distribution, the integral is approximated, resulting in the Random ΦSD (RΦSD).
Because the RΦSD only requires comparing $N$ samples against $M$ random features, the computational complexity drops dramatically to $O(NM)$. When $M$ is small and fixed, the algorithm effectively runs in linear time relative to the number of samples, breaking the notorious $O(N^2)$ curse of standard KSDs.
Key Insights: The Power of $L^1$
One of the most striking findings in the paper is the efficiency of using an $L^1$ norm for the features. Specifically, the L1 IMQ (Inverse Multi-Quadric) RΦSD proves to be exceptionally efficient.
As demonstrated in the research, the $L^1$ approach requires vastly fewer random features ($M$) to achieve high accuracy compared to the standard $L^2$ approach commonly used in kernel methods. For the importance sampling to remain robust, the proposal distribution must be "overdispersed" (heavier-tailed) relative to the feature function, ensuring that the random features adequately cover the target space without missing critical regions.
Key Results: Hyperparameter Selection and Efficiency
The authors evaluated RΦSDs on several standard benchmarks, including hyperparameter selection for Stochastic Gradient Langevin Dynamics (SGLD) on a Bimodal Gaussian Mixture Model, and goodness-of-fit testing for Restricted Boltzmann Machines (RBMs).
The results highlight three major advantages:
- Speed: RΦSDs are orders of magnitude faster than KSD. In experiments with 5,000 samples, RΦSDs computed results in a fraction of a second, whereas KSD took significantly longer.
- Statistical Power: In complex goodness-of-fit tests, the L1 IMQ RΦSD performed as well as or better than the quadratic-time KSD, and it significantly outperformed other linear-time methods like FSSD and Random Fourier Features (RFF).
- Efficiency: High-quality evaluations can be achieved using surprisingly few random features. The L1 IMQ RΦSD successfully identified optimal hyperparameters (tracking the KSD minimum perfectly) with as few as $M=10$ random features.
Limitations and Future Work
While RΦSDs offer a massive leap in scalability, they do come with practical considerations. Choosing the optimal proposal distribution and feature function for an unknown target distribution still requires some heuristic choices or manual tuning (such as the "median trick"). Furthermore, the strongest theoretical guarantees for goodness-of-fit testing currently require the feature functions to be real analytic.
Future work will likely explore extending this random feature logic beyond the Langevin operator (which is designed for continuous spaces) to discrete spaces and other types of Stein operators, potentially broadening the impact of near-linear time Stein discrepancies across all areas of probabilistic modeling.
Summary updated