A Kernelised Stein Statistic for Assessing Implicit Generative Models

Wenkai Xu, Gesine Reinert

Abstract

Implicit generative models, such as Generative Adversarial Networks (GANs), allow for sample generation but lack an explicit probability density function, complicating formal statistical evaluation. We introduce the Non-Parametric Kernelised Stein Discrepancy (NP-KSD), a novel test that assesses model quality by estimating conditional score functions from synthetic samples. Our method exploits the availability of large synthetic datasets to construct a powerful test that outperforms existing benchmarks like MMDAgg and provides a rigorous p-value for model assessment.

Introduction

The evaluation of deep generative models has historically relied on heuristic metrics such as the Inception Score (IS) and Fréchet Inception Distance (FID). While these metrics offer a relative measure of quality, they lack the statistical grounding of a formal goodness-of-fit test. Specifically, they do not provide a p-value to determine if a model's generated distribution is statistically consistent with the target data distribution. This gap is primarily due to the "implicit" nature of these models, which do not provide the explicit log-density gradients (score functions) required by standard tests like the Kernelised Stein Discrepancy (KSD).

The NP-KSD Framework

To overcome the lack of explicit densities, NP-KSD employs a non-parametric approach to estimate the Stein operator. The core innovation lies in three areas:

  1. Conditional Score Estimation: Rather than estimating a high-dimensional joint density, the method estimates univariate conditional score functions. This reduces the complexity of the estimation task and mitigates the curse of dimensionality.
  2. Summary Statistics: To handle high-dimensional data like images, the conditioning is performed on low-dimensional summary statistics (e.g., local pixel means) rather than the raw values of every other dimension.
  3. Asymmetric Sample Sizes: In typical model assessment, the number of real observations $n$ is small, while the number of generated samples $N$ can be arbitrarily large. NP-KSD uses the large $N$ to simulate the null distribution directly via Monte Carlo testing, providing higher accuracy than traditional wild bootstrap methods.

Experimental Evaluation

The authors tested NP-KSD against synthetic distributions—Gaussian Variance Difference (GVD) and Mixture of Gaussians (MoG)—and real-world datasets including MNIST and CIFAR-10.

NP-KSD performance across various synthetic perturbations and sample sizes.

As shown in the synthetic experiments, NP-KSD (particularly the NP-KSD_mean variant) demonstrates significantly higher rejection rates as the discrepancy between distributions increases, outperforming the state-of-the-art MMDAgg test. The test gains power as the generated sample size $N$ increases, effectively exploiting the asymmetry of the model assessment task.

Results and Discussion

On benchmark datasets like MNIST and CIFAR-10, NP-KSD revealed that many popular models, despite producing visually appealing results, fail rigorous statistical tests.

Rejection rates for various deep generative models on MNIST.

The table above illustrates that NP-KSD and its variants consistently reject models like DCGAN and VAE with high confidence (rejection rates near 1.00), whereas the rejection rate for real data remains near the expected significance level (e.g., 0.01-0.06). This indicates that NP-KSD is highly sensitive to the subtle distributional mismatches that heuristics like FID often overlook, suggesting that even visually convincing models often fail to capture the full statistical complexity of the underlying data.

Conclusion

NP-KSD provides a principled, powerful, and scalable framework for the statistical assessment of implicit generative models. By moving beyond heuristic scores to formal hypothesis testing, it offers researchers a more reliable tool for verifying the fidelity of modern AI generators. Future work will focus on optimizing the computational cost and refining the selection of summary statistics for even more complex data modalities.

Summary updated

BibTeX
@inproceedings{xu2022kernelised,
  author = {Wenkai Xu and Gesine Reinert},
  title = {{A Kernelised Stein Statistic for Assessing Implicit Generative Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=t4vTbQnhM8},
}
Figure