Fast and Scalable Score-Based Kernel Calibration Tests

Pierre Glaser, David Widmann, Fredrik Lindsten, Arthur Gretton · DOI

Abstract

Assessing the calibration of probabilistic models is crucial for reliable uncertainty quantification, yet existing methods often struggle with unnormalized models requiring expensive Markov Chain Monte Carlo (MCMC) sampling. We present the Kernel Calibration Conditional Stein Discrepancy (KCCSD) test, which utilizes the model's score function to bypass the need for normalizing constants or simulations. Our results show that KCCSD maintains rigorous Type-I error control and high statistical power across various synthetic benchmarks, offering a scalable and robust alternative to traditional kernel calibration errors.

Introduction

In machine learning, calibration ensures that a model's predicted probabilities reflect actual frequencies—an "honest" model. While essential, testing for calibration in modern, complex models is computationally intensive. This is particularly true for unnormalized models common in Simulation-Based Inference (SBI), used in fields like particle physics and neuroscience. In these scenarios, standard tests like the Squared Kernel Calibration Error (SKCE) require expensive expectations over predicted distributions, often necessitating MCMC sampling that can introduce significant bias if not perfectly tuned.

Methodology: The KCCSD Framework

The proposed Kernel Calibration Conditional Stein Discrepancy (KCCSD) test reframes calibration as a conditional goodness-of-fit problem. By leveraging Stein’s Method, the authors derive a test statistic that depends solely on the model's "score" (the gradient of its log-density). This innovation completely bypasses the need to calculate normalizing constants.

Key components of the method include:

  1. Score-Based Kernels: The introduction of the Generalized Fisher Divergence (GFD) and its kernelized version (KGFD). These allow similarity measures to be estimated using samples from a simple "base measure" (e.g., a standard Gaussian) rather than the complex model itself.
  2. Diffusion Link: A theoretical connection showing these kernels relate to how distributions evolve over time, linking them to traditional measures like Maximum Mean Discrepancy (MMD).

Experimental Evaluation

The authors evaluated KCCSD against several synthetic benchmarks: Mean Gaussian (MGM), Linear Gaussian (LGM), Heteroscedastic Gaussian (HGM), and Quadratic Gaussian (QGM) models. These benchmarks test the sensitivity of the kernels to various forms of miscalibration, such as shifted means or input-dependent variance.

Rejection rates across different models and sample sizes. KCCSD methods maintain low Type-I error under H0 and high power under H1.

Key Results

Statistical Power and Error Control

As shown in Figure 1, KCCSD methods (Fisher and Kernelized Fisher) effectively control the Type-I error rate when the model is calibrated ($H_0$). When the model is miscalibrated ($H_1$), the statistical power—the ability to correctly reject the null hypothesis—increases consistently with the number of samples, performing comparably to or better than state-of-the-art SKCE-based tests.

Robustness to Sampling Bias

A significant advantage of KCCSD is its independence from MCMC sampling. Traditional SKCE tests are highly sensitive to the quality of the sampler. As illustrated in Figure 2, when MCMC warm-up steps are insufficient, SKCE-based methods suffer from extremely high false-positive rates, incorrectly rejecting well-calibrated models. KCCSD avoids this failure mode entirely by bypassing the sampling process.

Sensitivity of SKCE-based tests to MCMC warm-up steps. Insufficient warm-up leads to high false-positive rejection rates, a bottleneck KCCSD avoids.

Conclusion and Future Work

KCCSD provides a fast, scalable, and robust solution for calibration testing, particularly for unnormalized models. By relying on the score function, it eliminates the computational burden and potential biases of MCMC. Future research may explore using KCCSD as a regularizer during the training process, allowing models to be optimized for calibration directly within the loss function.

Summary updated

BibTeX
@inproceedings{glaser2023fast,
  author = {Pierre Glaser and David Widmann and Fredrik Lindsten and Arthur Gretton},
  title = {{Fast and Scalable Score-Based Kernel Calibration Tests}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=bEKo5bsV77U},
}
Figure