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

Gradient-Free Kernel Stein Discrepancy

Matthew A Fisher, Chris J. OatesNeurIPS 2023

In modern statistics and machine learning, researchers frequently need to approximate a "target" probability distribution $p$—such as a posterior distribution in Bayesian inference—that is only known up to a normalization constant. Stein discrepancies have emerged as a powerful, go-to statistical tool for this challenge, aiding in tasks like goodness-of-fit testing and refining generated samples.

However, standard Stein discrepancies come with a significant catch: they require the computation of the target distribution's derivatives. A new method called Gradient-Free Kernel Stein Discrepancy (GF-KSD) bypasses this requirement, opening the door to applying Stein-based tools to complex, non-differentiable models.

The Gradient Bottleneck

The canonical versions of Stein discrepancies rely heavily on the score function, which is the gradient of the log-density of the target distribution ($\nabla \log p$). This reliance creates a major bottleneck in practice.

Many real-world statistical models are either non-differentiable (for instance, those using Laplace priors) or involve complex simulations, such as large-scale partial differential equations (PDEs). In these scenarios, computing gradients is often numerically unstable or orders of magnitude more computationally expensive than evaluating the model itself. While some gradient-free alternatives have been proposed in the past, they lacked the rigorous theoretical guarantees necessary to ensure that minimizing the discrepancy actually results in a better approximation of the target.

The GF-KSD Solution

To solve this, researchers introduced a non-canonical Stein operator that entirely replaces the difficult-to-compute gradient of the target $p$ with the gradient of a simpler, user-defined "proxy" distribution $q$.

The core mathematical engine of this approach is the operator: $$S_{p,q}h := \frac{q}{p} (\nabla \cdot h + h \cdot \nabla \log q)$$

By selecting a proxy $q$ that is easy to differentiate—like a Gaussian or a Laplace approximation—practitioners can compute the discrepancy without ever needing the derivatives of $p$.

To make this theoretically sound and practically computable, the authors embedded this operator into a Reproducing Kernel Hilbert Space (RKHS). This allows the discrepancy to be calculated using a closed-form "kernel trick," yielding the GF-KSD. Crucially, the paper provides the first theoretical proofs that GF-KSD can detect and control convergence. This means that if the GF-KSD approaches zero, the approximation is mathematically guaranteed to be converging toward the true target distribution.

Key Findings and Performance

The researchers evaluated GF-KSD across several synthetic and real-world-inspired benchmarks, including "banana-shaped" distributions for Variational Inference and the Lotka–Volterra predator-prey model (defined by differential equations) for Stein Importance Sampling.

  • The Power of the Proxy: The choice of the proxy distribution $q$ is the primary "degree of freedom" in GF-KSD. The authors found that a Laplace approximation (a Gaussian centered at the mode of $p$) serves as a remarkably robust default choice.
  • Lower-Order Requirements: In Variational Inference, standard Stein methods typically require second-order derivatives of the model. GF-KSD reduces this requirement to merely first-order derivatives of the variational map, significantly lowering the computational burden while achieving comparable results to standard KSD.
  • Stein Importance Sampling: When applied to the Lotka-Volterra model, GF-KSD successfully re-weighted samples and outperformed standard self-normalised importance sampling. It effectively reduced bias and Monte Carlo error without requiring any computationally expensive sensitivities (gradients) of the underlying differential equations.
Empirical assessment showing GF-KSD successfully detecting convergence (solid lines) vs. non-convergence (dashed lines) across different proxy choices.

Limitations and Failure Modes

While GF-KSD is a significant step forward, its performance is inherently tied to the quality of the proxy $q$.

One critical requirement is tail behavior. For the theoretical guarantees to hold, $q$ generally needs to have "heavier" tails than $p$. If $q$ decays much faster than $p$ in the extremes (i.e., $q \ll p$), the discrepancy can fail to detect when an approximation is inaccurate in those tail regions.

Analysis of failure modes, highlighting that if the proxy $q$ is substantially lighter than the target $p$ in the tails, convergence detection can become unreliable.

Additionally, if the target distribution $p$ is extremely complex, highly multimodal, or high-dimensional, finding an adequate proxy $q$ remains a challenge. Finally, the current formulation is not suitable for parameter estimation (where the target $p_\theta$ changes during optimization), because the normalization constant of the target cannot be treated as a constant in that specific context.

Future research will likely focus on automatically finding "optimal" proxy distributions and developing more robust optimization techniques for high-dimensional measure transport, further expanding the utility of gradient-free Stein discrepancies.

Summary updated

BibTeX
@inproceedings{fisher2023gradient,
  author = {Matthew A Fisher and Chris J. Oates},
  title = {{Gradient-Free Kernel Stein Discrepancy}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=9rmwPAjk9O},
}
Figure