Nyström Kernel Stein Discrepancy

Florian Kalinke, Zoltán Szabó, Bharath K. Sriperumbudur · DOI

Introduction

Goodness-of-Fit (GoF) testing is a fundamental task in statistics and machine learning, aimed at determining whether a given set of samples $\{x_i\}_{i=1}^n$ originates from a specific target distribution $P$. In modern applications such as Bayesian inference via Markov Chain Monte Carlo (MCMC) or deep generative modeling, the target distribution $P$ is often known only up to a normalization constant. The Kernel Stein Discrepancy (KSD) has emerged as a premier tool for this scenario, as it leverages the Stein operator to circumvent the need for the partition function.

Despite its theoretical elegance, the standard V-statistic or U-statistic estimators for KSD suffer from a quadratic computational complexity, $O(n^2)$. This scaling makes the test computationally prohibitive for large-scale datasets (e.g., $n > 10^5$). While linear-time estimators exist, they typically suffer from a significant loss in statistical power, failing to detect subtle deviations from the target distribution. This paper introduces Nyström-KSD, a method that utilizes Nyström approximation to bridge the gap between computational efficiency and statistical reliability.

Methodology: The Nyström-KSD Framework

The core innovation of this work is the application of the Nyström method to the Stein kernel. The Nyström method approximates a large kernel matrix by projecting it onto a lower-dimensional subspace defined by $m$ "landmark" points, where $m \ll n$.

Computational Efficiency

By selecting a subset of $m$ landmarks, the Nyström-KSD estimator reduces the runtime complexity from $O(n^2)$ to $O(mn + m^3)$. When the number of landmarks is chosen such that $m \approx \sqrt{n}$, the total cost becomes approximately $O(n^{1.5})$. This represents a significant speedup for large datasets while maintaining a more expressive representation of the kernel than linear-time alternatives like the Finite Set Stein Discrepancy (FSSD).

Accelerated Inference

Beyond the discrepancy calculation, the authors propose a Nyström-accelerated "wild bootstrap" procedure. This allows for the efficient computation of p-values, enabling researchers to perform hypothesis testing at scales previously considered unreachable for kernel-based Stein methods.

Theoretical Contributions: Handling Unbounded Kernels

A significant hurdle in applying Nyström methods to Stein discrepancies is the nature of the kernels involved. Standard Nyström analysis typically assumes that the kernel function is bounded. However, Stein kernels are inherently "unbounded"—they tend to grow as the data points move toward the tails of the distribution.

The authors provide the first theoretical guarantee for Nyström approximations in this unbounded setting. They demonstrate that if the data follows a sub-Gaussian distribution, the Nyström-KSD estimator remains $\sqrt{n}$-consistent. This proof ensures that the approximation converges to the true discrepancy at the optimal rate, providing a rigorous foundation for the method's empirical success.

Experimental Evaluation

The performance of Nyström-KSD was evaluated against several benchmarks, ranging from simple synthetic tests to complex high-dimensional models.

  • Synthetic Benchmarks: The method was tested on Laplace vs. Normal and Student-t vs. Normal distributions. These tests confirmed that Nyström-KSD maintains high power even when dealing with heavy-tailed distributions.
  • Restricted Boltzmann Machines (RBM): The most rigorous test involved an RBM with 50 visible and 40 hidden units. Because the normalization constant of an RBM is intractable, classical tests like the Kolmogorov-Smirnov test are inapplicable. Nyström-KSD, using $m = 4\sqrt{n}$ landmarks, achieved statistical power nearly identical to the full $O(n^2)$ KSD while operating at a fraction of the temporal cost.

Comparative Performance

The experiments highlighted that Nyström-KSD occupies a "sweet spot" in the complexity-power trade-off. It consistently outperformed Random Fourier Feature (RFF) approximations, which often struggle to distinguish between certain probability measures, and maintained significantly higher power than linear-time alternatives.

Discussion and Future Work

Nyström-KSD provides a scalable and theoretically grounded approach to goodness-of-fit testing. By proving consistency for unbounded kernels, the authors have expanded the utility of Nyström methods to the broader field of Stein statistics.

However, several avenues for future research remain:

  1. Assumption Verification: The reliance on sub-Gaussianity for the Stein feature map may be difficult to verify for highly complex or non-standard target distributions.
  2. Landmark Selection: While random sampling of landmarks is effective, "active" selection strategies or optimization of landmark locations could potentially enhance statistical power further.
  3. Hyperparameter Tuning: The choice of kernel bandwidth and the number of landmarks remains a critical factor in performance, suggesting a need for more automated selection heuristics.

In conclusion, Nyström-KSD offers a robust solution for large-scale Bayesian model criticism and generative model evaluation, providing the speed of an approximation with the statistical rigor of a full kernel method.

Summary updated

BibTeX
@inproceedings{kalinke2025nystrom,
  author = {Florian Kalinke and Zoltán Szabó and Bharath K. Sriperumbudur},
  title = {{Nyström Kernel Stein Discrepancy}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=iLM3CeY2zb},
}
Figure