An end-to-end framework for uncertainty-aware validation of generative models
Authors: Giada Badaracco, Sean Benevedes, Christina Reissel, Philip Harris, Gaia Grosso
Organizations: ETH Zürich, Zürich, CH · NSF AI Institute for Artificial Intelligence and Fundamental Interactions, Cambridge, MA, USA · School of Physics, Georgia Institute of Technology, Atlanta, GA, USA · MIT Center for Theoretical Physics – a Leinweber Institute, Cambridge, MA, USA · MIT Laboratory for Nuclear Science, Cambridge, MA, USA
Density estimation with generative models is a common task in the physical sciences, for example in background estimation in particle physics. Existing machine learning techniques, however, lack methods to quantify uncertainties that can be propagated into a statistical test. That limits the validation of generative models to standard goodness-of-fit tests, in which the generative model is treated as exact (point-null hypothesis). But a model fitted to a finite training set is never exact, so if its uncertainties are neglected, any sufficiently powerful goodness-of-fit test will eventually reject it once the test set is large enough to resolve this estimation error. We propose SIGMA, an end-to-end framework combining density estimation with principled uncertainty quantification. We use Gaussian mixture models, for which uncertainties are tractable, and further construct a new goodness-of-fit test in which these uncertainties are profiled as nuisance parameters to account for the statistical error of the fit, promoting the conventional point-null test to a composite one. A rejection then signals genuine mismodeling rather than a test set large enough to resolve the error of the fit, provided the propagated uncertainties faithfully cover that error. We demonstrate the framework on a controlled two-dimensional toy model and on a collider physics benchmark modeling the QCD background process. With uncertainties included, the same model can be trusted on test sets up to an order of magnitude larger than the standard test allows. Our work thus provides a statistically grounded basis for a robust use of generative models in the physical sciences.
Figures & tables
Figure 1: When uncertainty quantification matters. Representative uses of generative models in the physical sciences, classified by whether the error of the fit should be propagated into a quantitative claim. For the uses on the left (blue), a wrong model costs efficiency or statistical power but not validity of the claim, and qualitative validation suffices. For the uses on the right (red), the fitted density is the reference model of a statistical inference: its error is indistinguishable from a signal, so it must be propagated into the test (Sec. IV ).
Figure 2: Impact of fit uncertainties on goodness-of-fit tests of generative models. A Gaussian N(μ,σ) is fitted by maximum likelihood to Ntrain samples drawn from N(0,1) , with Ntrain=103 , 104 and 105 (left to right). The fitted model is then tested on Ntest fresh samples from the ground truth, using either the point-null (gray), which takes the fit as exact, or the Gaussian composite-null (blue), which includes the fit uncertainties. For each Ntrain , the fit is repeated with 10 independent training samples and each fit is tested on 100 test samples. Markers show the median p -value across trainings, and error bars show the 68% spread of the per-training medians. If the tested null hypothesis holds, p -values are uniformly distributed with median 0.5 (horizontal dotted line). Although the model family contains the ground truth, the fitted model never coincides with it exactly. The point-null, which ignores this estimation error, is therefore eventually rejected once Ntest≳Ntrain (vertical dashed line). The composite-null accounts for it and remains satisfied up to the largest test size probed, Ntest=106 , i.e. between 10 and 103 times the training-set size.
Figure 3: Schematic overview of the method. (A) The generative model pθ^ is fitted by maximum likelihood and linearized around the best fit, so that parameter shifts act through the fixed score ψ(x) . (B) The Fisher information sets the uncertainty of the fit, and standardized coordinates measure parameter shifts in units of that uncertainty. (C) The test compares a null family gv (green band), in which the model moves within its uncertainty, with an alternative hv,α (orange dashed) that also switches on localized Gaussian kernels. (D) The null distribution of the test statistic is obtained from pseudo-experiments following the Gaussian or bootstrap prescription.
Figure 4: The marginal distribution of the two features in the 2D toy problem . The black crosses show the binned density evaluated with 105 held-out events. The solid line shows the marginals of a GMM with K=64 components fit to Ntrain=100,000 events, and the colorful envelopes are uncertainties corresponding to the calibration prescriptions of Sec. IV.4 . Specifically, the blue envelope corresponds to the propagated Gaussian uncertainties on the best-fit parameters, and the red envelope is obtained as the 0.16 and 0.84 quantiles of the refit models obtained using a parametric bootstrap.
Figure 5: Closure test for the 2D toy problem. Median null p -value for the three goodness-of-fit tests of Sec. IV.3 versus test-set size Ntest , for K=16,32,64,128 (left to right) at fixed Ntrain=105 . A calibrated test gives median p=0.5 (horizontal dotted line); the vertical dashed line marks Ntest=Ntrain . Error bars are 68% confidence intervals on the median.
Figure 6: Calibrated uncertainties make the goodness-of-fit test cover. Distribution of the test statistic t for a GMM fit with K=64 components at Ntrain=Ntest=105 to the 2D toy model. The observed point statistic of Eq. ( 17 ) (dashed gray step histogram) lies almost entirely above its point-null (gray filled histogram), which treats the fitted density as exact, so the point-null test rejects the ground truth essentially always. The observed composite statistic of Eq. ( 16 ) (dashed red step histogram) is instead reproduced by its bootstrap null (red filled histogram), which propagates the uncertainty of the fit, so the composite test closes. Each distribution is estimated using 20 model fits, each of which is used to evaluate the point and composite test statistic on 100 test datasets for each fit. The point-null is then estimated with 250 point-null toys and the bootstrap null is estimated with 100 bootstrap toys for each fit.
Figure 7: Particle jets embedded in a 4D space. Corner plot of the four-dimensional jet embedding learned with a supervised contrastive (SupCon) objective [ 52 ] . Diagonal panels show the one-dimensional marginal distributions of each embedding coordinate (α,β,γ,δ) ; off-diagonal panels show the pairwise joint densities as contours. The QCD multijet density (red) is highlighted because it is the density we apply our framework to; other classes are used to obtain the embedding and are shown for reference only.
Figure 8: The marginal distribution of the four features in the 4D particle jets problem. The black crosses show the binned density evaluated with 105 held-out events. The solid line shows the marginals of a GMM with K=256 components fit to Ntrain=100,000 events, and the colorful envelopes are uncertainties corresponding to the calibration prescriptions of Sec. IV.4 . Specifically, the blue envelope corresponds to the propagated Gaussian uncertainties on the best-fit parameters, and the red envelope is obtained as the 0.16 and 0.84 quantiles of the refit models obtained using a parametric bootstrap.
Figure 9: Closure test for the 4D particle jets problem. Median null p -value for the three goodness-of-fit tests of Sec. IV.3 versus test-set size Ntest , for K=128,256,512 (left to right) at fixed Ntrain=105 . A calibrated test gives median p=0.5 (horizontal dotted line); the vertical dashed line marks Ntest=Ntrain . Error bars are 68% confidence intervals on the median.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 10: Two-dimensional toy: fitted marginals of features x1 (top) and x2 (bottom) for ensembles of M=1,32,128 flows (columns). Points are held-out data ( N=105 ); the gray line is the fitted ensemble density g^=∑iw^ifi , taken as the median over the ten ensemble choices (Sec. B.1 ); the blue band is the 68% weight-uncertainty g^±σg^ of Eq. ( 29 ), averaged over the ten choices and shown in the ratio-to-fit sub-panels. The single flow ( M=1 ) carries no fitted weights and hence no band. As M grows the fit tightens onto the target (most visibly the bimodal valley of x1 ) and the band, narrow in the bulk, widens in the low-statistics tails.
Figure 11: Four-dimensional jet embedding: fitted marginals of x1 – x4 (rows) for M=1,32,128 flows (columns), constructed as in Fig. 10 ; held-out data N=1.9×106 . The fitted marginals deviate from the data around the sharp peaks, while the weight-uncertainty band remains negligible at every M , so the propagated uncertainty does not cover the discrepancy.
Figure 12: Closure test for the 2D toy problem with NF ensemble. Median test p -value versus Ntest for ensembles of M=32 (left) and M=128 (right) flows, Ntrain=105 . Each panel shows the single-flow baseline (black), the point-null (gray), and the composite “Gaussian” null that propagates the weight uncertainty (blue). Error bars are the 95% confidence interval of the pooled median, from a hierarchical bootstrap over the ten ensemble choices and their null/test toys; the dotted line marks the nominal p=0.5 and the dashed vertical Ntest=Ntrain . Only at M=128 does the composite test stay near nominal up to and beyond Ntest=Ntrain .
Figure 13: Closure test for the 4D particle jets problem with NF ensemble. Median test p -value versus Ntest for M=32 (left) and M=128 (right) flows, constructed as in Fig. 12 . At every M the composite (Gaussian) null tracks the point-null to within the pseudo-experiment scatter: propagating the weight uncertainty does not help, and all constructions reach the floor 1/(B+1) by Ntest=Ntrain=105 .
Figure 14: Λmax scan for the 2D case study. Median test p -value versus Ntest for K=64 SIGMA with the bootstrap (left) and Gaussian (right) calibration prescription. The bootstrap calibration is largely robust to Λmax , while the results for the Gaussian calibration vary strongly with Λmax . Each shade corresponds to a different value of Λmax , and the point null is independent of this hyperparameter.
Figure 15: Empirical distributions of the test statistics for the 4D particle jets problem , for a GMM with K=256 fitted to Ntrain=105 points. Columns: test-set size Ntest=1000 , 20000 , 100000 . Rows: composite statistic with bootstrap calibration (red), composite statistic with Gaussian calibration (blue), point-null statistic (gray). Filled histograms: empirical null from 2500 pseudo-experiments for Gaussian and point-null and 1000 pseudo-experiments for bootstrap; black outline: observed statistic on 1 000 test sets, 100 drawn from the held-out pool for each of 10 independently trained models; gray dotted: best-fit χν^2 .
Figure 16: Closure test for the 2D toy problem with σ=0.1 . As with Fig. 5 , median null p -value for the three goodness-of-fit tests of Sec. IV.3 versus test-set size Ntest for K=16,32 . Unlike Fig. 5 , however, the width of the test kernels is taken to be σ=0.1 , which is substantially finer than the natural scale of the data.
Generative machine learning has become an essential tool in theoretical and experimental physics, especially in the context of fast surrogates and density estimators. In this work, we first introduce the underlying framework of modern generative networks and then discuss challenges in quantifying their accuracy, precision, and statistical power.
Sascha Diefenbacher, Sofia Palacios Schweitzer, Gregor Kasieczka
Institut für Theoretische Physik, Universität Heidelberg, Germany · Physics Division, Lawrence Berkeley National Laboratory, Berkeley, USA · NHETC, Department of Physics & Astronomy, Rutgers University, Piscataway, NJ, USA +1
Statistical evaluation aims to estimate the generalization performance of a model using held-out i.i.d. test data sampled from the ground-truth distribution. In supervised learning settings such as classification, performance metrics such as error rate are well-defined, and test error reliably approximates population error given sufficiently large datasets. In contrast, evaluation is more challenging for generative models due to their open-ended nature: it is unclear which metrics are appropriate and whether such metrics can be reliably evaluated from finite samples. In this work, we introduce a theoretical framework for evaluating generative models and establish evaluability results for commonly used metrics. We study two categories of metrics: test-based metrics, including integral probability metrics (IPMs), and Rényi divergences. We show that IPMs with respect to any bounded test class can be evaluated from finite samples up to multiplicative and additive approximation errors. Moreover, when the test class has finite fat-shattering dimension, IPMs can be evaluated with arbitrary precision. In contrast, Rényi and KL divergences are not evaluable from finite samples, as their values can be critically determined by rare events. We also analyze the potential and limitations of perplexity as an evaluation method.
Shashaank Aiyer, Yishay Mansour, Shay Moran +1
University of Maryland · Tel Aviv University and Google Research · Technion and Google Research
Generative models are increasingly deployed as substitutes for real data in downstream scientific workflows, yet standard evaluation criteria remain focused on marginal distribution matching. We argue that this represents a fundamental gap: downstream inference is rarely a marginal operation, and a model that passes every univariate diagnostic can still produce structurally unreliable synthetic data. We introduce covariance-level dependence fidelity, measured by D_Sigma(P,Q) = ||Sigma_P - Sigma_Q||_F, as a principled, computable criterion for evaluating whether a generative model preserves the joint structure of data beyond its univariate marginals. Three results formalise this criterion. First, marginal fidelity provides no constraint on dependence structure: D_Sigma can be made arbitrarily large while all univariate marginals match exactly. Second, covariance divergence induces quantifiable downstream instability, including sign reversals in population regression coefficients. Third, bounding D_Sigma provides positive stability guarantees for dependence-sensitive procedures such as PCA via Davis-Kahan-type bounds. Empirical validation across three domains, image data (Fashion-MNIST VAE, n = 60,000), bulk RNA-seq (TCGA-BRCA, n = 1,111), and a small-sample stress test (Alzheimer's gene expression, n = 113), shows that D_Sigma/delta consistently distinguishes structure-discarding from structure-preserving generators in cases where standard marginal diagnostics show little separation, confirming that covariance-level fidelity provides information orthogonal to existing evaluation metrics across domains and sample sizes.