betaFeedback

WorksComputer Science

Training Calibrated Conditional Generative Models with a Sample-Only Coverage Loss

Abstract

Conditional generative models have become the tool of choice for sampling posteriors in scientific inverse problems, where we seek to sample images or signals conditioned on a set of indirect and noisy measurements. Yet they are often overconfident, which is a critical failure in scientific applications where accurate uncertainty quantification is essential. Existing regularizers fall short in complementary ways: differentiable coverage objectives require the model's density and do not identify the posterior, while strictly proper scoring rules such as the energy score need only samples but do not directly enforce coverage. We close this gap by introducing a differentiable loss function based on the expected coverage probability, estimated from samples alone. It applies to any conditional generative model, with no need for tractable densities or architectural changes. We prove that it is a strict divergence, vanishing if and only if the model equals the true posterior. On simulation-based inference benchmarks, it matches a density-based coverage loss without evaluating the density. On high-dimensional imaging inverse problems, it yields better-calibrated posteriors than scoring-rule regularizers, with little change in the reconstruction quality of point estimates.

Introduction

Inverse problems are ubiquitous across scientific domains, including medical imaging ([28]), astrophysics ([1, 36]), engineering ([30]), and economics ([20]). Measurements of the signal of interest are typically acquired indirectly, only partially, and corrupted by noise, making the recovery of the underlying parameters ill-posed. Many different parameters can explain the same observations, so we seek to sample from the full range of admissible signals; such samples enable uncertainty quantification.

Bayesian inference provides a principled framework for this, modeling the set of all plausible solutions through the posterior distribution of the parameters given the observations. Deep generative models have made it possible to learn this posterior from pairs of parameters and corresponding measurements. Normalizing Flows (NF, [37, 35]), generative adversarial networks (GANs, [15]), and more recently diffusion ([39, 41] (Ho et al. 2020)) and flow ([27, 2]) models have all been successful at conditional sampling. However, each of these models has known failure modes that produce unreliable posteriors. GANs are prone to mode collapse ([31]), and NFs have been shown to be frequently overconfident for posteriors ([17]). Diffusion models, while achieving remarkable sample quality, have also been found to under-represent the uncertainty of the true posterior ([44]). We seek models with valid conditional coverage: for every measurement yy and every level α\alpha, whenever the model assigns probability α\alpha to a region of signals, the true signal should fall in that region with probability α\alpha under the posterior p(θ∣y)p(\theta\mid y), that is, α⋅100%\alpha\cdot100\% of the time over hypothetical draws of the true signal conditioned on that measurement. Requiring conditional coverage for all regions is equivalent to the learned posterior estimate qϕ(⋅∣y)q_{\phi}(\cdot\mid y) equaling the true posterior p(⋅∣y)p(\cdot\mid y), but it cannot be checked directly, since a dataset typically contains a single ground-truth signal per measurement.

Two families of training objectives address this problem, each with a complementary weakness. Coverage objectives ([10, 13]) add to the training loss a differentiable measure of the estimator’s coverage, typically computed on its highest probability density (HPD) regions, or a constraint favoring conservative estimators. They target coverage directly, but they have two limitations. Computing HPD regions requires evaluating the estimator density, which restricts these methods to architectures with tractable likelihoods, such as NFs, and excludes diffusion models and GANs. Moreover, they enforce marginal coverage, which does not identify the posterior: many distributions, including the prior, have valid marginal coverage. Strictly proper scoring rules, such as the continuous ranked probability score (CRPS) or the energy score, require only samples and are uniquely minimized at the posterior, but they do not target coverage, and in practice they can yield poorly calibrated models due to finite-sample effects, model misspecification and the geometry of the loss landscape (§ 2).

The basic idea is to assess a conditional generative model by asking how much of its probability mass lies closer to a reference point than the true signal does. For a given measurement yy, choose a reference point ψ(y)\psi(y) and consider balls centered at this point. The model assigns a probability mass to each ball, and we can check how often the true signal falls inside it. If the model is correct, the two agree at every probability level, and we measure departures from this agreement with a Cramér–von Mises (CvM) discrepancy. This construction builds on TARP (Tests of Accuracy with Random Points, [26]), and we call the resulting loss TARP-CvM. The converse depends on how reference points are chosen. A reference rule assigns a reference point to every measurement, and a single rule is not enough, even one that depends on the measurement. Its coverage is averaged over measurements, so over-coverage at some measurements can balance under-coverage at others. We therefore compute the discrepancy separately for many rules and average the discrepancies, rather than pooling their coverage. Our main theoretical result shows that if the rules can place reference points anywhere and can differ across regions of measurement space, this average vanishes only when the model equals the true posterior. Our contributions are:

  • Theory: a sufficient condition on the distribution of measurement-dependent reference rules under which our TARP-CvM loss vanishes if and only if the model equals the true posterior.

  • Algorithm: a sample-only, differentiable estimator of TARP-CvM that applies to any conditional generative model, together with a practical construction of reference rules that satisfies this condition.

  • Experiments: on simulation-based inference, TARP-CvM matches a density-based coverage loss without evaluating the density; on high-dimensional imaging inverse problems, it is the only regularizer we tested that brings the posterior into the Mira null band on all three problems, with little change in the quality of point estimates.

Problem formulation. We seek to recover parameters θ∈Θ⊆Rdθ\theta\in\Theta\subseteq\mathbb{R}^{d_{\theta}} from indirect measurements y∈Y⊆Rdyy \in\mathcal{Y} \subseteq\mathbb{R}^{d_y}. Knowledge of the data likelihood p(y∣θ)p(y \mid\theta) may be used to generate training samples but is not otherwise required. There may exist a forward model A\mathcal{A} such that y=A(θ)+ϵy = \mathcal{A}(\theta) + \epsilon, where ϵ\epsilon is a noise vector, and together A\mathcal{A} and the distribution of ϵ\epsilon control the data likelihood p(y∣θ)p(y \mid\theta). This setting encompasses a wide range of problems: in inverse problems, θ\theta may be a high-dimensional medical image of a patient’s anatomy, yy the raw measurements collected by an MRI scanner, and A\mathcal{A} a model of the scanner’s measurement process; in simulation-based inference, θ\theta may be the parameters of a physics simulation, with A\mathcal{A} the simulator itself; in which case we seek to infer θ\theta from observations yy. We seek to sample from the posterior distribution p(θ∣y)p(\theta\mid y), but cannot evaluate the prior density p(θ)p(\theta). We have only samples, a training set {(θ1,y1),…,(θn,yn)}\{(\theta_1,y_1),\ldots,(\theta_n,y_n)\} of nn pairs drawn from the joint distribution p(θ,y)p(\theta,y), so that the θi\theta_i are samples from the prior. Our strategy is to train a conditional generative model, denoted qϕ(⋅∣y)q_{\phi}(\cdot\mid y), which takes as input a measurement vector yy and a random seed and generates a sample θ\theta, where ϕ∈Rp\phi\in\mathbb{R}^{p} is the vector of generative model parameters (e.g., neural network weights) to be learned.

Related work

Generative models for inverse problems Model-agnostic methods train a conditional generative model on paired samples (θi,yi)(\theta_i, y_i), without using the forward model A\mathcal{A}. Model-adaptive methods instead combine a generative prior over θ\theta, pre-trained without measurements, with knowledge of A\mathcal{A} at sampling time, as in Diffusion Posterior Sampling [6]. We focus on the model-agnostic setting, but the core ideas translate naturally to model-adaptive samplers.

Coverage tests Two standard approaches for empirically testing coverage of qϕq_\phi are Highest Posterior Density (HPD, Hermans et al., [17]) testing and Tests of Accuracy with Random Points (TARP, Lemos et al., [26]). HPD testing constructs, for each test point yy, the smallest region C⊂RdθC \subset\mathbb{R}^{d_\theta} under qϕ(⋅∣y)q_\phi(\cdot\mid y) that contains α\alpha probability mass, and then checks whether the true θ\theta falls inside that region at the expected rate. However, HPD requires evaluating the density of qϕq_\phi, which is often unavailable for generative models, and valid HPD coverage is not a sufficient condition for accuracy: a model can pass the HPD test while still differing from the posterior. Figure 1 illustrates the limitations of using HPD to train a conditional generative model vis-à-vis our proposed measure, TARP-CvM; details on this experiment are in § 5.1.

Figure 1. Gaussian linear inverse problem, θ∈R8\theta\in\mathbb{R}^{8}. (a) 2-d slice of 68% level sets of the prior, the true posterior, and models trained with the HPD loss and with TARP-CvM alone. (b) Expected KL to the true posterior during training. (c) HPD coverage error during training: it cannot distinguish the two models, although their KL differs strongly. Setup and details in § 5.1 and Appendix § 13.§ 1.

TARP instead constructs regions as balls centered at randomly chosen reference points, measuring coverage by the fraction of samples from qϕ(⋅∣y)q_\phi(\cdot\mid y) that fall closer to the reference point than the true θ\theta does. Lemos et al. [26] show that correct TARP coverage for every assignment of reference points to measurements is necessary and sufficient for the estimator to equal the posterior, so TARP can detect errors that HPD-based tests miss, while requiring only samples from qϕq_\phi rather than density evaluations. The key distinction is that HPD regions are implicitly centered by the geometry of the estimated density, whereas TARP regions can be centered at arbitrary reference points. This flexibility lets TARP probe aspects of the posterior that HPD coverage cannot capture. Which assignments are needed in practice is left open; we make this precise in § 3. The output of TARP is a coverage curve that plots the empirical coverage rate against the nominal credibility level α\alpha, with a perfectly calibrated model lying on the diagonal. Although correct TARP coverage for every possible assignment of reference points characterizes the posterior, this does not immediately provide a practical training objective. In particular, averaging coverage over randomly chosen reference points can conceal errors, because overcoverage and undercoverage may cancel. Our contribution is to identify a tractable family of reference rules whose individual coverage discrepancies can be averaged without losing the ability to identify the posterior.

Because TARP produces a coverage curve rather than a scalar, it does not directly support quantitative comparisons between models. Mira [38] provides such a scalar. Over many randomly drawn regions and joint samples (θ,y)∼p(θ,y)(\theta, y) \sim p(\theta, y), it estimates the probability that the true θ\theta falls in a region given the fraction of samples from qϕ(⋅∣y)q_\phi(\cdot\mid y) that fall in it. Under calibration, the Mira score equals 2/3, and values below this level indicate overconfidence. Since our loss is built on TARP, evaluating it with TARP coverage alone would be partly circular. We therefore use Mira as an independent metric: it relies on its own random regions, is not optimized by any of the methods we compare, and provides a calibrated reference value with a null band that accounts for sampling noise.

Energy Score and CRPS Using MSE as a loss function assesses a model’s ability to correctly estimate the conditional mean, but it does not reward modeling the spread of possibilities correctly and can prefer overconfident generators. The Energy Score (ES, Gneiting and Raftery, [14])

ES⁡(qϕ(⋅∣y),θ)=2Eθ^∼qϕ(⋅∣y)∥θ^−θ∥2−Eθ^,θ^′∼qϕ(⋅∣y)∥θ^−θ^′∥2,\operatorname{ES}(q_\phi(\cdot\mid y), \theta) = 2\mathbb{E}_{\hat{\theta}\sim q_\phi(\cdot\mid y)}\lVert\hat{\theta}-\theta\rVert_2-\mathbb{E}_{\hat{\theta},\hat{\theta}'\sim q_\phi(\cdot\mid y)}\lVert\hat{\theta}-\hat{\theta}'\rVert_2,

addresses this by penalizing samples far from the true θ\theta while rewarding spread. It is strictly proper on distributions with finite first moment, with expectation under p(⋅∣y)p(\cdot\mid y) uniquely minimized at qϕ(⋅∣y)=p(⋅∣y)q_\phi(\cdot\mid y) = p(\cdot\mid y), and it can be estimated from samples alone. Its univariate case is the continuous ranked probability score (CRPS). In high dimension, the CRPS is often summed over coordinates (pCRPS), which parallelizes across pixels, but only identifies the marginals of the posterior. Strict propriety says that the population objective has the true posterior as its unique global minimizer. It does not guarantee that training finds this minimizer. The loss is estimated on finite batches and minimized by gradient descent, which can stop at local minima, and if the model class does not contain the posterior, the guarantee says nothing about which approximation is found. Training with a strictly proper scoring rule therefore need not produce a calibrated model.

Two objectives can share the same global minimizer but have very different landscapes. In a Gaussian toy model, the energy score is much flatter than TARP-CvM in the direction of the posterior spread when the mean is biased, so that noisy gradients are less likely to correct the spread, whereas TARP-CvM penalizes miscoverage directly (Appendix § 12.§ 3). Our experiments reflect this difference; on most of our imaging inverse problems, ES and pCRPS improve coverage but remain overconfident, whereas TARP-CvM reaches calibration (§ 5.2).

Calibration objectives Several works have proposed training objectives that encourage calibration directly, including the HPD objective of Falkiewicz et al. [13], the rank-based statistics of Yao et al. [45], and the balanced NRE approach of Delaunoy et al. [10], which favors conservative rather than exactly calibrated estimators. These methods target marginal calibration, which does not ensure calibration conditionally on the measurement (Kuleshov et al., [25]). Conformal prediction (Angelopoulos and Bates, [3]) instead acts after training: using a held-out calibration set, it turns the predictions of any trained model into sets that contain the true value with a chosen probability, without assumptions on the data distribution and for any calibration set size. This guarantee is also marginal, since conditional coverage is unattainable in this distribution-free setting, and the procedure does not provide a loss or score that can be used to train the model. Conditioning the calibration statistic on yy gives a stronger notion of calibration, explored both as a diagnostic (Zhao et al., [47]) and for post-hoc recalibration (Dey et al., [11]). Our loss enforces it during training, at the population level.

The TARP-CvM loss: A strict divergence

This section builds the TARP-CvM loss in three stages. We first describe how the TARP coverage test of Lemos et al. [26] assesses a conditional generative model: it centers a ball at a reference point chosen from the measurement, measures how much of the estimator’s mass lies closer to the reference point than the true parameter does, and checks whether these masses are uniformly distributed (§ 3.1). We then relate this test to credible regions and to the expected coverage probability, which places TARP alongside HPD-based tests (§ 3.2). Finally, we turn the test into a population objective and give conditions under which it vanishes only at the true posterior (§ 3.3).

The TARP construction

TARP replaces the HPD level sets of the density (§ 2) by balls, whose mass can be estimated from samples alone. Given a pair (θ,y)(\theta,y) drawn from the joint distribution p(θ,y)p(\theta,y), for instance a training pair (θi,yi)(\theta_i,y_i), the construction proceeds in four steps.

Step 1: choose a reference point. For the measurement yy, choose a reference point ψ(y)∈Θ\psi(y) \in\Theta. Since this choice must be made for every measurement, we formalize it as a rule.

Definition 1 (Reference rule). A reference rule is a measurable map ψ:Y→Θ\psi:\mathcal{Y}\to\Theta that assigns to each measurement yy a single reference point ψ(y)\psi(y). A rule is deterministic and specifies the reference points of all measurements jointly. Randomness over reference points enters only through a distribution ρ\rho over rules (Definition 4).

Step 2: construct a ball. Center a ball at ψ(y)\psi(y), with radius chosen so that the ball just contains the true θ\theta, that is, the ball B(ψ(y),d(θ,ψ(y)))B(\psi(y),d(\theta,\psi(y))), where dd is a distance on Θ\Theta and B(c,r)={θ~:d(θ~,c)≤r}B(c,r)=\{\tilde{\theta}:d(\tilde{\theta},c)\le r\} is the closed ball.

Step 3: evaluate its mass under the estimator. Define the credibility value as the probability mass of this ball, where the probability is with respect to the distribution qϕ(⋅∣y)q_\phi(\cdot\mid y):

sψ(θ,y)=Pqϕ(θ~∣y)[d(θ~,ψ(y))≤d(θ,ψ(y))].s_\psi(\theta,y)=\mathbb{P}_{q_\phi(\tilde{\theta}\mid y)}\left[d(\tilde{\theta},\psi(y))\le d(\theta,\psi(y))\right].

In practice, it is the fraction of draws θ~∼qϕ(⋅∣y)\tilde{\theta}\sim q_\phi(\cdot\mid y) that fall inside the ball (see Figure 2b).

Figure 2. The reference sampler. (a) In measurement space, a hyperplane with random direction uu through a random measurement yjy_j splits the batch: measurements on the shaded side (●) receive the displacement ξ\xi, those on the other side (○) receive ξ′\xi'. (b) In signal space, for one measurement on the ξ\xi side. The adjoint reconstruction ATyA^{\mathsf{T}}y (+), the reference ψ(y)=ATy+ξ\psi(y)=A^{\mathsf{T}}y+\xi (×), the truth θ∗\theta^* (★), and the ball centered at ψ(y)\psi(y) with radius d(ψ(y),θ∗)d(\psi(y),\theta^*). Estimator draws inside the ball are filled (●), draws outside are hollow (○); the credibility value ss is the filled fraction. Grey ellipses are the posterior, the dotted ellipse the overconfident estimator.

Step 4: evaluate coverage. Repeating Steps 1–3 over pairs (θ,y)∼p(θ,y)(\theta,y)\sim p(\theta,y), with the same rule ψ\psi, gives a distribution of credibility values. The conditional coverage of rule ψ\psi at measurement yy and the marginal coverage, its average over measurements, are

Fψ(α∣y)=Pp(θ∣y)[sψ(θ,y)≤α]F_\psi(\alpha\mid y)=\mathbb{P}_{p(\theta\mid y)}\left[s_\psi(\theta,y)\le\alpha\right]

(conditional coverage), (1)

Fψ(α)=Ep(y)[Fψ(α∣y)]F_\psi(\alpha)=\mathbb{E}_{p(y)}\left[F_\psi(\alpha\mid y)\right]

(marginal coverage). (2)

Since Fψ(α∣y)F_\psi(\alpha\mid y) depends on ψ\psi only through the reference point ψ(y)\psi(y), we also write Fc(α∣y)F_c(\alpha\mid y) for the coverage at yy of balls centered at a point c∈Θc\in\Theta, so that Fψ(α∣y)=Fψ(y)(α∣y)F_\psi(\alpha\mid y)=F_{\psi(y)}(\alpha\mid y). If the estimated posterior is correct, the credibility values of the true parameters are uniformly distributed on [0,1][0,1] at every measurement, Fψ(α∣y)=αF_\psi(\alpha\mid y)=\alpha (Lemma 1 below). The original TARP test pools the credibility values over randomly drawn reference points. We instead compare them to the uniform distribution separately for each rule and average the resulting discrepancies (§ 3.3).

Credible regions and expected coverage

To relate TARP to HPD-based tests, we view the balls of § 3.1 as credible regions of the estimator and their marginal coverage Fψ(α)F_\psi(\alpha) as expected coverage probability.

Definition 2 (Adapted from Lemos et al. [26]). A credible region map of the estimator qϕq_\phi assigns to each level α∈[0,1]\alpha\in[0,1] and measurement yy, a set Rα(y)⊆ΘR_\alpha(y)\subseteq\Theta, such that Eθ∼qϕ(⋅∣y)[1θ∈Rα(y)]=∫Rα(y)qϕ(θ∣y)dθ=Pθ∼qϕ(⋅∣y)[θ∈Rα(y)]=α\mathbb{E}_{\theta\sim q_\phi(\cdot\mid y)}\left[\mathbf{1}_{\theta\in R_\alpha(y)}\right]=\int_{R_\alpha(y)}q_\phi(\theta\mid y)\mathrm{d}\theta=\mathbb{P}_{\theta\sim q_\phi(\cdot\mid y)}[\theta\in R_\alpha(y)]=\alpha.

In this paper, we compare two credible region maps. The HPD region is the level set of qϕ(⋅∣y)q_\phi(\cdot\mid y) (also the region with the smallest volume) with mass α\alpha ([5, 21]). Given a rule ψ\psi, the TARP region is a ball centered at reference point ψ(y)∈Θ\psi(y)\in\Theta, with radius ensuring the ball has mass α\alpha:

tα=inf⁡{r:Pqϕ(θ∣y)(θ∈B(ψ(y),r))≥α}t_\alpha=\inf\left\{r:\mathbb{P}_{q_\phi(\theta\mid y)}\left(\theta\in B(\psi(y),r)\right)\ge\alpha\right\}
Rα,ψTARP(y)=B(ψ(y),tα).R_{\alpha,\psi}^{\mathrm{TARP}}(y)=B(\psi(y),t_\alpha).

The credibility value sψ(θ,y)s_\psi(\theta,y) is the level at which θ\theta enters the TARP region: θ∈Rα,ψTARP(y)⟺sψ(θ,y)≤α\theta\in R_{\alpha,\psi}^{\mathrm{TARP}}(y)\Longleftrightarrow s_\psi(\theta,y)\le\alpha.

Definition 3 (Adapted from Lemos et al. [26]). For any credible region map RαR_\alpha, the expected coverage probability at level α\alpha is the probability that the true parameter falls in the region:

ECP⁡(qϕ,α,Rα)=Pp(θ,y)[θ∈Rα].\operatorname{ECP}(q_\phi,\alpha,R_\alpha)=\mathbb{P}_{p(\theta,y)}[\theta\in R_\alpha].

We say qϕq_\phi is calibrated for RαR_\alpha if ECP⁡(qϕ,α,Rα)=α\operatorname{ECP}(q_\phi,\alpha,R_\alpha)=\alpha for all α∈[0,1]\alpha\in[0,1].

By construction, Fψ(α)=ECP⁡(qϕ,α,Rα,ψTARP)F_{\psi}(\alpha)=\operatorname{ECP}(q_{\phi},\alpha,R_{\alpha,\psi}^{\mathrm{TARP}}). So qϕq_{\phi} is calibrated for the TARP region given by ψ\psi, when FψF_{\psi} is the identity, i.e., when the credibility values are uniformly distributed.

Assumption 1. Θ⊆Rdθ\Theta\subseteq\mathbb{R}^{d_{\theta}} is open, and for every yy, p(⋅∣y)p(\cdot\mid y) and qϕ(⋅∣y)q_{\phi}(\cdot\mid y) have continuous densities that are strictly positive on Θ\Theta.

Lemma 1. Under Assumption 1, if qϕ(⋅∣y)=p(⋅∣y)q_{\phi}(\cdot\mid y)=p(\cdot\mid y) for every yy, then Fψ(α∣y)=αF_{\psi}(\alpha\mid y)=\alpha for every rule ψ\psi, for every level α\alpha and every yy, and hence Fψ(α)=αF_{\psi}(\alpha)=\alpha.

In other words, a correct estimator is always calibrated, no matter how the regions are chosen (Proof in Appendix A). However the converse, calibration for a map implies qϕ=pq_{\phi}=p, depends on the choice of the map, and is the central question of § 3.3.

The population objective

Definition 4. For a distribution ρ\rho over reference rules, we introduce the loss function

Dρ(p,qϕ)=Eψ∼ρ∫01(Fψ(α)−α)2 dα.(1)D_{\rho}(p,q_{\phi})=\mathbb{E}_{\psi\sim\rho}\int_{0}^{1}(F_{\psi}(\alpha)-\alpha)^{2}\,\mathrm{d}\alpha. \tag*{(1)}

Dρ=0D_{\rho}=0 iff the estimator is calibrated for every rule ψ\psi in the support of ρ\rho. For a single rule, the integrand compares each credibility level α\alpha with the frequency Fψ(α)F_{\psi}(\alpha) at which the true parameter falls in the corresponding region. The inner integral is thus a continuous analogue of the expected calibration error used in classification ([33]), and closely resembles the calibration error of Kuleshov et al. [25] for regression. The outer expectation over rules is what distinguishes it from these per-model calibration scores, and the choice of ρ\rho determines the properties of DρD_{\rho}. We motivate the requirements on ρ\rho below and formalize them in Definition 6.

For a fixed rule ψ\psi, the integral is the Cramér–von Mises distance ([7]) DCvM(X1,X2)=∫01[P[X1≤α]−P[X2≤α]]2 dαD_{\mathrm{CvM}}(X_{1},X_{2})=\int_{0}^{1}\left[\mathbb{P}[X_{1}\leq\alpha]-\mathbb{P}[X_{2}\leq\alpha]\right]^{2}\,\mathrm{d}\alpha, where X1=sψ(θ,y)X_{1}=s_{\psi}(\theta,y), the credibility of the true parameters, whose CDF is FψF_{\psi}, and X2∼U[0,1]X_{2}\sim\mathcal{U}[0,1] is the uniform distribution. DρD_{\rho} is non-negative and, under Assumption 1 and for any admissible ρ\rho (Definition 6), vanishes if and only if qϕ=pq_{\phi}=p (Theorem 1); in this sense it is a divergence between conditional distributions. It is not a metric, since it is not symmetric in (p,qϕ)(p,q_{\phi}) and does not satisfy the triangle inequality, and it is not a scoring rule, since it is quadratic in the distribution of (θ,y)(\theta,y) rather than an average of per-example scores.

Constant reference points cannot identify the posterior. A rule that ignores the measurement lets the prior pass the coverage test. Let us consider a constant rule ψ(y)=c\psi(y)=c. If our estimator returns the prior, qϕ(θ∣y)=p(θ)q_{\phi}(\theta\mid y)=p(\theta), the TARP region Rα,ψTARP(y)=Rα,cTARPR_{\alpha,\psi}^{\mathrm{TARP}}(y)=R_{\alpha,c}^{\mathrm{TARP}} no longer depends on yy, since both its center and the distribution defining its radius are fixed. Then ECP⁡(qϕ,α,Rα,ψTARP)=Ep(θ,y)[1θ∈Rα,cTARP]=∫p(y)∫Rα,cTARPp(θ∣y) dθ dy=∫Rα,cTARP(∫p(θ∣y)p(y) dy)dθ=∫Rα,cTARPp(θ) dθ\operatorname{ECP}(q_{\phi},\alpha,R_{\alpha,\psi}^{\mathrm{TARP}})=\mathbb{E}_{p(\theta,y)}\left[\mathbf{1}_{\theta\in R_{\alpha,c}^{\mathrm{TARP}}}\right]=\int p(y)\int_{R_{\alpha,c}^{\mathrm{TARP}}}p(\theta\mid y)\,\mathrm{d}\theta\,\mathrm{d}y=\int_{R_{\alpha,c}^{\mathrm{TARP}}}\left(\int p(\theta\mid y)p(y)\,\mathrm{d}y\right)\mathrm{d}\theta=\int_{R_{\alpha,c}^{\mathrm{TARP}}}p(\theta)\,\mathrm{d}\theta. Since qϕ(θ∣y)=p(θ)q_{\phi}(\theta\mid y)=p(\theta) and by definition of a credible region, we get ECP⁡(qϕ,α,Rα,ψTARP)=α\operatorname{ECP}(q_{\phi},\alpha,R_{\alpha,\psi}^{\mathrm{TARP}})=\alpha, which evaluates the estimator as calibrated.

A single measurement-dependent rule is still insufficient. Reference points must depend on the measurement, but this alone does not guarantee that the loss identifies the posterior. A single rule gives each measurement its own reference point, but its coverage Fψ(α)=∫Fψ(α∣y)p(y) dyF_{\psi}(\alpha)=\int F_{\psi}(\alpha\mid y)p(y)\,\mathrm{d}y is an average over measurements, and errors at different measurements can cancel. Suppose there are two measurements y0y_{0} and y1y_{1}, each with probability 12\frac{1}{2}, and an estimator that is too wide at y0y_{0} and too narrow at y1y_{1}, with Fψ(α∣yl)=α+(−1)lδ α(1−α)F_{\psi}(\alpha\mid y_{l})=\alpha+(-1)^{l}\delta\,\alpha(1-\alpha) for l∈{0,1}l\in\{0,1\} and δ∈(0,1)\delta\in(0,1). The coverage curves at y0y_{0} and y1y_{1} deviate from the diagonal in opposite directions and average to it, so Fψ(α)=αF_{\psi}(\alpha)=\alpha at every level: the estimator is calibrated under ψ\psi yet wrong at both measurements. Choosing a better single rule does not help, since the counterexample holds for any ψ\psi.

Comparing rules requires local differences. For a wrong estimator, the conditional coverage Fψ(α∣y)F_{\psi}(\alpha\mid y) (Equation 1) depends on where the ball is centered, so errors can be revealed by comparing different reference points at the same measurement. The loss, however, only sees marginal coverages Fψ(α)F_{\psi}(\alpha), so this comparison must be made across several rules. It isolates a subset of measurements only if the collection contains pairs of rules that agree on most measurements and differ on that subset: the difference between their marginal coverages then depends only on the subset. If every pair of rules differs at all measurements, errors can still cancel within each marginal average.

For instance, a simpler reference would add noise to a point estimate b(y)b(y) at scale ς\varsigma (see § 4.2 for definitions), ψ(yi)=b(yi)+ςξi\psi(y_i) = b(y_i) + \varsigma\xi_i, with ξi\xi_i drawn either independently for each example or once for the whole batch. Neither is sufficient. With independent draws, the batch yields a single coverage curve, Fˉ(α)=∫Eξ[Fb(y)+ςξ(α∣y)]p(y) dy\bar{F}(\alpha) = \int\mathbb{E}_{\xi} [F_{b(y)+\varsigma\xi}(\alpha\mid y)]p(y)\,dy, and a single statistic ∫01(Fˉ(α)−α)2 dα\int_0^1 (\bar{F}(\alpha)-\alpha)^2\,d\alpha. The expectation over reference points then sits inside the square of Equation 4, and the examples where Fb(yi)+ςξi(α∣yi)>αF_{b(y_i)+\varsigma\xi_i}(\alpha\mid y_i) > \alpha can balance those where Fb(yi)+ςξi(α∣yi)<αF_{b(y_i)+\varsigma\xi_i}(\alpha\mid y_i) < \alpha, so that Fˉ(α)=α\bar{F}(\alpha) = \alpha even if Fb(yi)+ςξi(α∣yi)≠αF_{b(y_i)+\varsigma\xi_i}(\alpha\mid y_i) \ne\alpha for every example. If instead a single displacement ξr\xi_r is shared by the batch, each draw is a rule ψr(y)=b(y)+ςξr\psi_r(y) = b(y)+\varsigma\xi_r giving a statistic IψrI_{\psi_r}, and the rules satisfy (R1) below. But each IψrI_{\psi_r} constrains Fψr(α∣y)F_{\psi_r}(\alpha\mid y) only through an average over all measurements, so nothing prevents over-coverage at some measurements from balancing under-coverage at others for every ξr\xi_r at once, and Theorem 1 does not apply to these rules.

Patching rules resolves the problem. Given two reference rules, a patched rule uses the first rule for measurements on one side of a hyperplane and the second rule for measurements on the other side. Thus, we can change the reference points for one subset of measurements while leaving the rest unchanged. In the example above, with δ=0.8\delta= 0.8 and α=12\alpha= \frac{1}{2}, the coverages are 0.7 and 0.3 under ψ\psi; take a second calibrated rule ψ′\psi', centered elsewhere, with coverages 0.6 and 0.4. Switching rules across measurements, ψ\psi at y0y_0 and ψ′\psi' at y1y_1, gives 12(0.7+0.4)=0.55\frac{1}{2}(0.7+0.4)=0.55, and the miscalibration appears.

Definition 5. For rules ψ\psi, ψ′\psi' and a measurable set H⊆YH \subseteq\mathcal{Y}, the patched rule uses ψ\psi on HH and ψ′\psi' elsewhere, (ψ⊕Hψ′)(y)=ψ(y) 1y∈H+ψ′(y) 1y∉H(\psi\oplus_H \psi')(y) = \psi(y)\,1_{y\in H} + \psi'(y)\,1_{y\notin H}.

Patching along all half-spaces is enough (Lemma 5), which is condition (R2) below. The reference rules must have two properties. First, at every measurement, the available reference points must be sufficiently rich to probe the entire parameter space. Second, the collection of rules must allow reference points to be changed on arbitrary half-spaces of measurement space while remaining unchanged elsewhere. These two properties ensure that coverage errors cannot be hidden by averaging, and that the resulting coverage tests distinguish different conditional distributions.

Definition 6. A distribution ρ\rho over rules is admissible if there exists a countable family of rules Ψ⊆supp⁡ρ\Psi\subseteq\operatorname{supp}\rho (Appendix § 9.§ 1) such that

(R1) For every yy, the centers {ψ(y):ψ∈Ψ}\{\psi(y):\psi\in\Psi\} are dense in Θ\Theta.

(R2) For all ψ,ψ′∈Ψ\psi,\psi' \in\Psi and every half-space H={y:⟨u,y⟩≤t}H = \{y:\langle u,y\rangle\le t\}, with uu a unit vector of Rdy\mathbb{R}^{d_y} and t∈Rt \in\mathbb{R}, the patched rule ψ⊕Hψ′\psi\oplus_H \psi' is in supp⁡ρ\operatorname{supp}\rho.

With (R1), the loss can place reference points anywhere near the posterior mass at each measurement. With (R2), they may be used on the two sides of a hyperplane in measurement space, which is enough to tell measurements apart.

The switch rule of Equation 8 avoids both problems of the noisy point estimate above. Because each side of the hyperplane shares one displacement, each draw is a rule with its own statistic. Using one displacement on HH and another on its complement changes the reference points of the measurements in HH only, so errors inside HH can no longer be balanced by errors outside it. Calibration of every such rule, for every HH, forces the coverage at almost every measurement to be the same for every displacement (condition (R2) and Lemma 5).

Definition 7. The TARP-CvM loss is (1) for an admissible ρ\rho.

Theorem 1 (TARP-CvM is a strict divergence). Under Assumption 1 and for any admissible ρ\rho, Dρ(p,qϕ)=0D_{\rho}(p,q_{\phi}) = 0 if and only if qϕ(⋅∣y)=p(⋅∣y)q_{\phi}(\cdot\mid y) = p(\cdot\mid y) for almost all yy.

Proof in Appendix § 9. The direction qϕ=p⇒Dρ=0q_{\phi}=p \Rightarrow D_{\rho}=0 follows from Lemma 1. The converse proceeds in three steps. First, zero loss implies calibration for every rule in the support of ρ\rho. Second, patching (R2) implies that the conditional coverage at almost every measurement does not depend on the reference point. Third, since reference points are dense (R1), this invariance holds only if the estimated and true posteriors agree.

Lemos et al. [26] show that a posterior estimator is exact if its expected coverage is correct for every function assigning reference points to measurements. Their argument relies on a functional derivative with respect to this function. They do not specify how reference points should be selected from the measurement, and in their experiments reference points are drawn independently of it, a setting in which the prior also passes the test. Moreover, the original TARP pools coverage over randomly drawn reference points, and the pooled coverage can match the nominal level even when a distribution is miscalibrated with respect to an individual rule, because their errors can cancel in the average. Theorem 1 shows how our TARP-CvM addresses both issues. It gives an explicit sufficient condition on how reference points depend on the measurement (Definition 6). Our loss averages the miscalibration of a distribution with respect to each rule rather than pooling, so that zero loss implies calibration for every rule in the support.

Making the objective trainable

At each training iteration, we draw a batch of paired observations and ground-truth signals (θi,yi)(\theta_i, y_i), generate samples for each observation θ~i,m\tilde{\theta}_{i,m}, and construct several reference rules. For each rule, we compute the credibility of every ground-truth signal θi\theta_i relative to the corresponding generated samples. We then calculate a Cramér–von Mises discrepancy between the empirical distribution of these credibility values and the uniform distribution. The average discrepancy over reference rules is added to the base generative-model training loss.

The closed form estimator

The objective term in Equation (1) is the squared area Iψ=∫01(Fψ(α)−α)2 dαI_{\psi} = \int_{0}^{1} (F_{\psi}(\alpha)-\alpha)^2\,\mathrm{d}\alpha between the cumulative distribution function of the credibility values and the diagonal. FψF_{\psi} is empirically estimated with NN credibility values si=sψ(θi,yi)s_i=s_{\psi}(\theta_i,y_i) from pairs (θi,yi)(\theta_i,y_i) of the batch, F^ψ(α)≈1N∑i1si≤α\widehat{F}_{\psi}(\alpha) \approx\frac{1}{N}\sum_i \mathbf{1}_{s_i\leq\alpha}, computed with the same rule ψ\psi. IψI_{\psi} is a Cramér–von Mises statistic, and its derivative admits a closed-form expression ([45]). The statistic measures the squared discrepancy between the empirical distribution of the credibility values and the uniform distribution. The usual integral representation involves indicator functions and is not convenient for gradient-based optimization. By integrating analytically over the credibility levels, we obtain the following expression in terms of the sorted credibility values. See Appendix § 11 for details on deriving this empirical estimator:

CvM⁡(s1:N)=1N∑isi2−1N2∑k=1N(2k−1)s(k)+13(2)\operatorname{CvM}(s_{1:N}) = \frac{1}{N}\sum_i s_i^2 - \frac{1}{N^2}\sum_{k=1}^{N}(2k-1)s_{(k)} + \frac{1}{3} \tag*{(2)}

where s(1)≤⋯≤s(N)s_{(1)} \leq\cdots\leq s_{(N)} are the sorted credibility values. Writing rank⁡(i)\operatorname{rank}(i) for the position of sis_i in this ordering, so that si=s(rank⁡(i))s_i=s_{(\operatorname{rank}(i))}, the gradient is

∂CvM⁡∂si=2siN−2rank⁡(i)−1N2.(3)\frac{\partial\operatorname{CvM}}{\partial s_i} = \frac{2s_i}{N} - \frac{2\operatorname{rank}(i)-1}{N^2}. \tag*{(3)}

The closed form expression is what makes the statistic differentiable, by turning evaluation on a grid of levels α\alpha, where most indicator counts would have zero gradient, into a polynomial of the sorted values. Integrating over α\alpha first removes the indicators, and the resulting expression depends on sis_i values and rank. It was used by Yao et al. [45] to turn a rank-uniformity test into a differentiable objective for simulation-based inference. We differ in the choice of the statistic. Coordinate-wise ranks constrain only the one-dimensional marginals of the estimator, so the prior estimator also passes the test, whereas uniformity of the credibility value across admissible rules forces the estimator to equal the posterior as stated in Theorem 1.

Unbiased estimator. Equation Equation (2) is the plug-in estimate of the inner integral of Equation (1). Written as an average over all pairs (i,j)(i,j) of credibility values, it includes the diagonal pairs i=ji=j, so its expectation exceeds it by 1N∫01Fψ(1−Fψ) dα\frac{1}{N}\int_0^1 F_\psi(1-F_\psi)\,d\alpha, a term that does not vanish at the posterior. Excluding the diagonal pairs gives an unbiased U-statistic (Hoeffding, [19]),

CvM⁡U(s1:N)=1N∑isi2−2N(N−1)∑k=1N(k−1)s(k)+13.(4)\operatorname{CvM}_{U}(s_{1:N})=\frac{1}{N}\sum_i s_i^2-\frac{2}{N(N-1)}\sum_{k=1}^{N}(k-1)s_{(k)}+\frac{1}{3}. \tag*{(4)}

Equation Equation (4) is therefore preferable when an unbiased estimate of the population discrepancy is desired (Proposition 2, see Appendix § 11 for derivation). In our experiments, however, we use the simpler plug-in statistic in Equation (2). Its finite-sample bias is not removed, but the same estimator is used consistently throughout training.

Reference points

The objective Equation (1) is an average over reference rules. Each optimization step draws RR rules and applies each one to every pair in the batch. It then computes the CvM statistic of Equation (2) separately for each rule and averages the RR statistics. This keeps the expectation over rules outside the squared deviation, as in Equation (1). The rules are drawn from a mixture of three groups: switch rules, prior rules and posterior rules.

Switch rules. Figure 2 illustrates the construction. A switch rule needs a point estimate b(y)b(y) with nontrivial posterior likelihood. For a linear forward model y=Aθ+ϵy=A\theta+\epsilon, we take the adjoint reconstruction b(y)=ATyb(y)=A^{\mathsf{T}}y, or the pseudo-inverse A+yA^+y. Without an adjoint, bb can be a regressor of the posterior mean, trained beforehand on the same pairs (§ 5.3). A switch rule splits the measurements of the batch with a hyperplane and displaces the point estimate by one displacement on one side and by another on the other side, so that it is a single rule patched across a half-space (Definition 5). It is determined by two displacements ξ,ξ′\xi,\xi', a unit vector uu in measurement space that orients the hyperplane, and an example jj of the batch through which it passes, and assigns to every example yiy_i the reference point

ψ(yi)=b(yi)+ξ1⟨u,yi⟩≤⟨u,yj⟩+ξ′1⟨u,yi⟩>⟨u,yj⟩.(5)\psi(y_i)=b(y_i)+\xi\mathbf{1}_{\langle u,y_i\rangle\leq\langle u,y_j\rangle}+\xi'\mathbf{1}_{\langle u,y_i\rangle>\langle u,y_j\rangle}. \tag*{(5)}

where ς∈R>0db\varsigma\in\mathbb{R}^{d_b}_{>0} is a fixed reference scale, applied component-wise and treated as a constant. Drawing ξ,ξ′∼N(0,I)\xi,\xi' \sim\mathcal{N}(0,I), a random unit vector uu and a random example jj chooses a switch rule at random; once drawn, it is a fixed rule in the sense of Definition 1. In our experiments, we set ς\varsigma to the root-mean-square residual of bb on a held-out tenth of the training simulations,

ς=(E[(b(y)−θ)2])1/2,(6)\varsigma= \left(\mathbb{E}\left[(b(y)-\theta)^2\right]\right)^{1/2}, \tag*{(6)}

with the square and root taken element-wise, so that the reference displacements match the average posterior scale. bb and ς\varsigma are both frozen before the posterior estimator is trained.

The hyperplane splits the batch into two groups that receive different displacements, so within a rule each measurement receives one reference point. Across the RR rules of a step, each measurement receives RR reference points. The switch rules satisfy both admissibility conditions in Definition 6: their reference points are dense in parameter space, and they can implement arbitrary half-space patches. The displacements have positive densities, so reference points come arbitrarily close to every point of Θ\Theta (R1). Every rule is a patch of two rules across a half-space, and every patch can be drawn, since the displacements, the direction and the position of the hyperplane are all drawn from distributions with full support (R2).

Prior and posterior rules. Admissibility guarantees that the true posterior is the unique minimizer of the loss, but we observe that adding other rules helps training. A prior rule uses a single reference point drawn from the prior and shared by the batch. A posterior rule uses the MM posterior draws of each pair as reference points, detached from the computational graph. For the reference θ~m\tilde{\theta}_m, the credibility of θi\theta_i is computed from the M−1M-1 other draws. When a generated posterior sample is used as the reference point, that same sample must be excluded from the set of samples used to estimate the credibility value. Otherwise, the reference point would contribute a guaranteed zero-distance sample, changing the distribution of credibility values even when the estimator is correct.

Theorem 1 still applies. Every term of the loss is nonnegative, and the switch rules keep a fixed share of the mixture, so the loss can only vanish if the loss restricted to switch rules vanishes, which forces qϕ=pq_\phi=p. The switch rules are essential for the theoretical guarantee, and the other two are supplementary choices intended to help optimization.

Relaxation of the indicator

To differentiate the loss with respect to ϕ\phi, we backpropagate through the sampler. For a diffusion model, we draw all the noises of the sampler in advance and hold them fixed, so that the sampler becomes a deterministic function of ϕ\phi. This is the reparameterization trick [24]. The exact credibility value is the fraction of generated samples whose distance from the reference point is no greater than the distance of the true signal. The indicator in this definition is nondifferentiable, so we replace it with a sigmoid approximation σ\sigma at temperature τ>0\tau>0, for θ~m∼qϕ(⋅∣y)\tilde{\theta}_m \sim q_\phi(\cdot\mid y),

sϕ(θ,y)≈1M∑m=1Mσ(d(θ,ψ(y))−d(θ~m,ψ(y))τ).(7)s_{\phi}(\theta,y) \approx\frac{1}{M}\sum_{m=1}^{M}\sigma\left(\frac{d(\theta,\psi(y))-d(\tilde{\theta}_m,\psi(y))}{\tau}\right). \tag*{(7)}

Algorithm 1 summarizes one training step, and Appendix B details its complexity.

Experiments

TARP-CvM as training signal

We first consider a setting in which the true posterior is known analytically. This experiment isolates the distinction between marginal coverage and posterior accuracy, allowing us to directly compare the minimizers of the HPD and TARP-CvM objectives. We illustrate Theorem 1 on a Gaussian linear inverse problem y=Aθ+ϵy=A\theta+\epsilon, with a Gaussian prior and fewer measurements than parameters (Appendix E.1). The posterior is Gaussian, p(θ∣y)=N(W∗y,S∗)p(\theta\mid y)=\mathcal{N}(W^{*}y,S^{*}), and we fit a Gaussian estimator qϕ(θ∣y)=N(Wy,S)q_{\phi}(\theta\mid y)=\mathcal{N}(Wy,S) by gradient Algorithm 1 One training step with the TARP-CvM regularizer

Require: batch {(θi,yi)}i=1N\{(\theta_i,y_i)\}_{i=1}^{N}, posterior point estimator b:Y→Θb:\mathcal{Y}\to\Theta, reference scale ς\varsigma ((6)), base loss Lbase\mathcal{L}_{\mathrm{base}} of the generative model, weight λ\lambda, number of draws MM, numbers of switch, prior and posterior rules Rs,Rp,RpostR_s,R_p,R_{\mathrm{post}} with R=Rs+Rp+RpostR=R_s+R_p+R_{\mathrm{post}}, temperature τ\tau

  1. for i=1,…,Ni=1,\ldots,N do

  2. Draw θ~i,1,…,θ~i,M∼qϕ(⋅∣yi)\tilde{\theta}_{i,1},\ldots,\tilde{\theta}_{i,M}\sim q_\phi(\cdot\mid y_i) with the reparameterization trick

  3. end for

  4. for r=1,…,Rr=1,\ldots,R do

  5. Let k∈{switch,prior,posterior}k\in\{\text{switch},\text{prior},\text{posterior}\} be the group of rule rr

  6. Draw a rule ψr∼ρk\psi_r\sim\rho_k:

  7. if k=switchk=\text{switch} then

  8. Draw ξ,ξ′∼N(0,I)\xi,\xi'\sim\mathcal{N}(0,I), a unit vector uu and an index jj

  9. ψr(y)=b(y)+ς(ξ 1⟨u,y⟩≤⟨u,yj⟩+ξ′ 1⟨u,y⟩>⟨u,yj⟩)\psi_r(y)=b(y)+\varsigma\left(\xi\,\mathbf{1}_{\langle u,y\rangle\le\langle u,y_j\rangle}+\xi'\,\mathbf{1}_{\langle u,y\rangle>\langle u,y_j\rangle}\right)

  10. Mr←{1,…,M}\mathcal{M}_r\gets\{1,\ldots,M\}

  11. else if k=priork=\text{prior} then

  12. Draw c∼p(θ)c\sim p(\theta) and set ψr(y)=c\psi_r(y)=c

  13. Mr←{1,…,M}\mathcal{M}_r\gets\{1,\ldots,M\}

  14. else

  15. Draw an index m′m' and set ψr(yi)=sg⁡(θ~i,m′)\psi_r(y_i)=\operatorname{sg}(\tilde{\theta}_{i,m'})

  16. Mr←{1,…,M}∖{m′}\mathcal{M}_r\gets\{1,\ldots,M\}\setminus\{m'\}

  17. end if

  18. for i=1,…,Ni=1,\ldots,N do

  19. si←1∣Mr∣∑m∈Mrσ([d(θi,ψr(yi))−d(θ~i,m,ψr(yi))]/τ)s_i\gets\frac{1}{|\mathcal{M}_r|}\sum_{m\in\mathcal{M}_r}\sigma\left(\left[d(\theta_i,\psi_r(y_i))-d(\tilde{\theta}_{i,m},\psi_r(y_i))\right]/\tau\right)

  20. end for

  21. Lr←CvM⁡(s1:N)\mathcal{L}_r\gets\operatorname{CvM}(s_{1:N}) ▷ (2)

  22. end for

  23. Compute Lbase(ϕ)\mathcal{L}_{\mathrm{base}}(\phi) on its own batch ▷ e.g. DSM or NLL

  24. L←Lbase(ϕ)+λ1R∑r=1RLr\mathcal{L}\gets\mathcal{L}_{\mathrm{base}}(\phi)+\lambda\frac{1}{R}\sum_{r=1}^{R}\mathcal{L}_r

  25. Update ϕ\phi with a gradient step on L\mathcal{L}

descent on either an HPD-loss or TARP-CvM. The estimator is HPD-calibrated for every WW, provided that S=S∗+(W∗−W)Σy(W∗−W)⊤S=S^*+(W^*-W)\Sigma_y(W^*-W)^\top, where Σy\Sigma_y is the covariance of the measurements. Thus, an estimator with a biased conditional mean can still achieve correct HPD coverage if its covariance is sufficiently inflated. The HPD objective therefore admits a family of minimizers, including the prior, even though most of these distributions do not equal the true posterior. This manifold of minimizers contains the prior, at W=0W=0, and every point of it other than the posterior has a biased mean and a covariance wider than the posterior’s. Gradient descent on HPD coverage can therefore stop at any point of this manifold, not only at the posterior. With measurement-dependent references, TARP-CvM instead has the posterior as its unique minimizer (Theorem 1). In Figure 1, TARP-CvM recovers the posterior contours, whereas the HPD fit is biased and too conservative. The HPD coverage error cannot distinguish the two models, although their KL divergence to the posterior differs strongly.

Imaging inverse problems

We study posterior coverage calibration in high-dimensional posteriors on three inverse problems from InverseBench Zheng et al. [48]. Each has the form y=A(θ)+ϵy=A(\theta)+\epsilon. These are linear inverse scattering (IS) and compressed-sensing MRI (MRI), whose forward operators are linear, and Navier–Stokes (NS), whose forward operator is nonlinear and only available as a black-box solver (Appendix § 13.§ 3). For IS, ϵ\epsilon is additive Gaussian noise. For MRI and NS, ϵ≡0\epsilon\equiv0, so the posterior has no density on the full signal space. On MRI, TARP-CvM therefore measures distances in the null space of AA, where Theorem 1 applies (Appendix § 13.§ 3). Unlike the plug-and-play methods InverseBench was designed for, we train fully amortized conditional models on pairs (θ,y)(\theta,y). The measurement is concatenated to the network input, as its adjoint reconstruction A⊤yA^\top y for IS and MRI, and at its native 64×6464\times64 resolution for NS, which matches the resolution of the signal after 2×22 \times2 patching. All models are pretrained with denoising score matching (DSM, Song et al. [41]). They are then fine-tuned for 24k steps with one of four objectives, DSM alone (∅\varnothing), a control that isolates the effect of additional training, or DSM plus a calibration regularizer, which is the energy score (ES), the pixel-wise CRPS (pCRPS), or TARP-CvM. All three regularizers use the same calibration batch, the same number of posterior samples per measurement, and the same T=20T = 20-step DDIM sampler (Song et al. [40]), through which gradients are backpropagated (see Appendix § 13.§ 3 for details).

We measure coverage with the L1L^1 TARP coverage error, ∫01∣ECP⁡(qϕ,α,Rα,ψTARP)−α∣ dα\int_0^1 \lvert\operatorname{ECP}(q_\phi, \alpha, R^{\mathrm{TARP}}_{\alpha,\psi}) - \alpha\rvert\,d\alpha. We compute the coverage using standard binary indicators rather than the sigmoid relaxations used during training, and use the ℓ2\ell_2 distance to define the TARP balls. We also use the Mira score (Sharief et al. [38]), which equals 2/3 for a calibrated model; values below the null band indicate overconfidence. For quality, we report in Table 3 the PSNR, SSIM, and relative L2L^2 error of the posterior mean over K=32K = 32 samples, the PSNR of a single draw, and the posterior spread (the per-pixel standard deviation across the KK samples, in physical units), all computed on 64 held-out observations, together with the DSM loss on the full validation split, averaged over three seeds.

ProblemStagePosterior mean (MMSE)Draw
PSNR↑SSIM↑rel. L2L_2↓PSNRspreadDSM↓
NSDSM27.830.78510.236824.581.11690.0595
+ ∅28.22 ± 0.020.7969 ± 0.00040.2280 ± 0.000525.01 ± 0.011.0606 ± 0.00250.0594 ± 0.0000
+ ES29.26 ± 0.030.8246 ± 0.00090.2061 ± 0.000825.81 ± 0.040.9847 ± 0.00320.0590 ± 0.0000
+ pCRPS29.23 ± 0.040.8257 ± 0.00100.2067 ± 0.000825.79 ± 0.040.9843 ± 0.00370.0590 ± 0.0000
+ TCvM27.88 ± 0.050.7874 ± 0.00110.2354 ± 0.001324.22 ± 0.051.2178 ± 0.01010.0597 ± 0.0000
ISDSM29.620.92210.090627.930.01420.1159
+ ∅29.79 ± 0.010.9229 ± 0.00020.0898 ± 0.000028.23 ± 0.010.0131 ± 0.00000.1182 ± 0.0001
+ ES29.72 ± 0.020.9217 ± 0.00030.0908 ± 0.000228.21 ± 0.010.0128 ± 0.00000.1190 ± 0.0001
+ pCRPS29.71 ± 0.020.9216 ± 0.00040.0909 ± 0.000328.18 ± 0.010.0129 ± 0.00000.1194 ± 0.0002
+ TCvM29.64 ± 0.040.9224 ± 0.00010.0905 ± 0.000127.88 ± 0.110.0179 ± 0.00080.1186 ± 0.0000
MRIDSM37.110.88250.123235.100.02850.1916
+ ∅37.47 ± 0.000.8872 ± 0.00000.1186 ± 0.000035.41 ± 0.000.0280 ± 0.00000.1901 ± 0.0000
+ ES37.79 ± 0.010.8902 ± 0.00030.1150 ± 0.000134.71 ± 0.060.0320 ± 0.00030.1902 ± 0.0000
+ pCRPS37.75 ± 0.070.8905 ± 0.00070.1153 ± 0.000734.93 ± 0.340.0331 ± 0.00300.1902 ± 0.0000
+ TCvM36.68 ± 0.070.8751 ± 0.00170.1291 ± 0.001033.49 ± 0.370.0443 ± 0.00540.1910 ± 0.0001

Table 3. Quality metrics before and after calibration. Metrics on 64 held-out measurements with 32 posterior draws each (T=20T = 20). PSNR, SSIM and relative L2L_2 of the posterior mean (the MMSE reconstruction) and PSNR of a single posterior draw, each against the ground truth. Spread is the standard deviation of the 32 draws at each pixel, averaged over pixels, in physical units.

All pretrained models are strongly overconfident (Mira between 0.51 and 0.61, Figure 3). Additional DSM training does not fix this, so the gains below come from the regularizers. On NS and IS, TARP-CvM gives the lowest coverage error (0.11 and 0.28, against 0.17 and 0.35 for the best scoring rule). On NS all three regularizers reach the Mira null band, but on IS only TARP-CvM does (0.68, against 0.53 for ES and 0.57 for pCRPS). On MRI, the two metrics disagree. ES has the lowest coverage error, but remains overconfident according to Mira, while TARP-CvM is the only method inside the band.

Figure 3. Coverage before and after calibration.

Increasing posterior variance can reduce the PSNR of individual posterior draws even when the posterior mean remains unchanged. This is not necessarily a deterioration in reconstruction accuracy: it can reflect the fact that the model is representing uncertainty that was previously missing. Calibration has little effect on the quality of generated samples. The validation DSM loss stays within 1% of the control for every method. Posterior-mean PSNR is unchanged on IS and NS and drops by 0.8 dB on MRI. Per-draw PSNR drops more, by 0.35 to 1.9 dB, but this reflects the metric rather than accuracy. The expected squared error of a draw θ~∼q(⋅∣y)\tilde{\theta} \sim q(\cdot\mid y) decomposes as E[∥θ~−θ∗∥2]=∥Eq[θ~]−θ∗∥2+Var⁡q(θ~)\mathbb{E}[\lVert\tilde{\theta} - \theta^*\rVert^2] = \lVert\mathbb{E}_q[\tilde{\theta}] - \theta^*\rVert^2 + \operatorname{Var}_q(\tilde{\theta}), where Var⁡q(θ~)=tr⁡Cov⁡q(θ~)\operatorname{Var}_q(\tilde{\theta}) = \operatorname{tr}\operatorname{Cov}_q(\tilde{\theta}) denotes the total variance, so a model that collapses its variance gains per-draw PSNR without improving its mean. Correct coverage requires nonzero variance, and TARP-CvM widens the posterior by 15 to 58% relative to the control, which lowers per-draw PSNR accordingly. On NS, the scoring rules instead improve the posterior mean by about 1 dB while slightly reducing the spread. This suggests that the pretrained model had errors due to both a biased mean, which the scoring rules correct, and insufficient spread, which TARP-CvM corrects. The wider spread of TARP-CvM may also partly compensate for residual error in the posterior mean.

Sampler depth. Because the calibration term backpropagates through the sampler, training fixes the sampler depth, but any depth can be used at inference. We train with T=20T = 20 and evaluate at T∈{20,100,500}T \in\{20, 100, 500\} (Figure 4). On NS and IS, Mira stays inside the null band at all depths, so calibration learned with a short chain survives at longer ones. On MRI, however, Mira decreases and leaves the null band at higher TT. At T=100T = 100 and 500 it even falls below the DSM-only model, whose Mira improves with TT. This suggests that on MRI part of the learned calibration compensates for the discretization error of the 20-step sampler rather than correcting the underlying score, so the correction no longer matches a finer discretization. In practice, the model should be sampled at the depth it was calibrated for, or calibrated at the depth used for inference, at a training cost that grows linearly with TT.

Figure 4. Coverage under varying sampler depth. TARP-CvM was trained at T=20T = 20.

SBI benchmark

In contrast to the imaging experiments, the SBI benchmarks are low-dimensional problems for which standard NPE is already relatively well calibrated. Our objective is to establish that TARP-CvM can match a density-based calibration method while requiring only posterior samples. We evaluate our method on four problems from the SBI benchmark introduced in Hermans et al. [17], namely SLCP, Weinberg, Spatial SIR and Lotka–Volterra, each at three simulation budgets {210,213,216}\{2^{10}, 2^{13}, 2^{16}\}. We compare conditional normalizing flows trained with Neural Posterior Estimation (NPE, Papamakarios and Murray, [34]; Lueckmann et al., [29]; Deistler et al., [9]; Greenberg et al., [16]), with the HPD-based regularizer of CalNPE (Falkiewicz et al., [13]), and with TARP-CvM. In SBI, we usually only have access to samples from the simulator, and cannot evaluate the adjoint operator of the forward model. In order to get a point estimate b(y)b(y) close to the posterior for reference points when only pairs of (θ,y)(\theta, y) are available, we train a multilayer perceptron (MLP) network targeting the posterior mean y↦Ep(θ∣y)[θ]y \mapsto E_{p(\theta\mid y)}[\theta], with a mean-square-error loss, and freeze it during calibration of the posterior generative model. All methods share the same training protocol, with the same simulation budgets, validation set and checkpoint selection (Appendix § 13.§ 2).

Under this matched protocol, NPE is already nearly calibrated on these low-dimensional problems. On the two TARP coverage maps, log posterior density and joint MMD on (θ,b(y))(\theta, b(y)), a single method is significantly better than the other two in only two of the 48 comparisons: TARP-CvM on the switch map for Weinberg at 2102^{10}, and CalNPE on log density for Spatial SIR at 2102^{10} (Table 1, Appendix § 13.§ 2).

ProblemnnHPD error ↓\downarrow NPEHPD error ↓\downarrow CalNPEHPD error ↓\downarrow OursTARP error, yy-indep. ↓\downarrow NPETARP error, yy-indep. ↓\downarrow CalNPETARP error, yy-indep. ↓\downarrow OursTARP error, switch ↓\downarrow NPETARP error, switch ↓\downarrow CalNPETARP error, switch ↓\downarrow Ours
SLCP2102^{10}.096±\pm.017.086±\pm.014.101±\pm.018.015±\pm.004.012±\pm.002.015±\pm.005.013±\pm.003.012±\pm.002.014±\pm.004
2132^{13}.047±\pm.013.029±\pm.007.038±\pm.013.010±\pm.003.010±\pm.004.013±\pm.004.009±\pm.003.009±\pm.003.013±\pm.004
2162^{16}.013±\pm.007.006±\pm.004.018±\pm.007.007±\pm.002.008±\pm.002.006±\pm.002.007±\pm.002.008±\pm.002.006±\pm.001
Weinberg2102^{10}.021±\pm.005.010±\pm.004.031±\pm.011.011±\pm.003.010±\pm.003.014±\pm.004.047±\pm.003.050±\pm.004.041±\pm.004
2132^{13}.034±\pm.005.007±\pm.005.031±\pm.007.012±\pm.002.012±\pm.004.013±\pm.003.015±\pm.002.019±\pm.004.016±\pm.003
2162^{16}.016±\pm.006.008±\pm.003.013±\pm.005.009±\pm.003.008±\pm.003.009±\pm.002.009±\pm.003.011±\pm.002.008±\pm.002
Spatial SIR2102^{10}.081±\pm.024.045±\pm.021.093±\pm.012.029±\pm.008.027±\pm.006.034±\pm.003.041±\pm.010.041±\pm.016.027±\pm.003
2132^{13}.053±\pm.021.017±\pm.006.041±\pm.016.025±\pm.006.020±\pm.006.027±\pm.004.021±\pm.004.022±\pm.005.021±\pm.005
2162^{16}.031±\pm.009.026±\pm.014.031±\pm.013.020±\pm.007.011±\pm.003.016±\pm.006.015±\pm.003.011±\pm.003.015±\pm.005
Lotka–Volterra2102^{10}.082±\pm.016.064±\pm.008.081±\pm.008.016±\pm.003.015±\pm.005.013±\pm.006.067±\pm.004.067±\pm.005.067±\pm.003
2132^{13}.024±\pm.014.014±\pm.006.015±\pm.008.017±\pm.005.011±\pm.005.012±\pm.005.030±\pm.005.032±\pm.006.033±\pm.004
2162^{16}.014±\pm.007.010±\pm.004.013±\pm.010.014±\pm.008.014±\pm.005.012±\pm.004.014±\pm.007.017±\pm.002.013±\pm.003
ProblemnnE[log⁡qϕ]↑\mathbb{E}[\log q_{\phi}] \uparrow NPEE[log⁡qϕ]↑\mathbb{E}[\log q_{\phi}] \uparrow CalNPEE[log⁡qϕ]↑\mathbb{E}[\log q_{\phi}] \uparrow OursMMD zz, (θ,b(y))↓(\theta,b(y)) \downarrow NPEMMD zz, (θ,b(y))↓(\theta,b(y)) \downarrow CalNPEMMD zz, (θ,b(y))↓(\theta,b(y)) \downarrow Ours∣MIRA−2/3∣↓|\mathrm{MIRA}-2/3|\downarrow NPE∣MIRA−2/3∣↓|\mathrm{MIRA}-2/3|\downarrow CalNPE∣MIRA−2/3∣↓|\mathrm{MIRA}-2/3|\downarrow Ours
SLCP2102^{10}-2.34±\pm.05-2.32±\pm.08-2.32±\pm.0311.1±\pm4.112.2±\pm3.814.0±\pm6.2.0017±\pm.0009.0033±\pm.0010.0022±\pm.0013
2132^{13}-1.41±\pm.08-1.38±\pm.02-1.35±\pm.065.5±\pm2.76.3±\pm3.05.6±\pm2.4.0034±\pm.0010.0040±\pm.0014.0027±\pm.0016
2162^{16}-0.87±\pm.03-0.88±\pm.01-0.86±\pm.021.3±\pm1.01.9±\pm.62.1±\pm1.1.0045±\pm.0004.0051±\pm.0008.0048±\pm.0006
Weinberg2102^{10}-0.11±\pm.01-0.10±\pm.01-0.11±\pm.0156.3±\pm6.259.3±\pm13.658.2±\pm8.9.0050±\pm.0017.0068±\pm.0015.0028±\pm.0015
2132^{13}0.02±\pm.010.02±\pm.010.01±\pm.018.0±\pm4.814.9±\pm9.18.1±\pm4.3.0014±\pm.0008.0039±\pm.0010.0013±\pm.0008
2162^{16}0.10±\pm.000.09±\pm.010.09±\pm.013.8±\pm3.17.1±\pm5.35.3±\pm3.4.0034±\pm.0012.0071±\pm.0009.0043±\pm.0006
Spatial SIR2102^{10}0.82±\pm.020.86±\pm.030.77±\pm.05114.2±\pm11.6106.4±\pm26.1115.5±\pm14.9.0023±\pm.0019.0055±\pm.0030.0059±\pm.0019
2132^{13}1.31±\pm.031.33±\pm.021.26±\pm.0443.8±\pm15.239.3±\pm15.355.0±\pm18.5.0033±\pm.0018.0031±\pm.0022.0023±\pm.0005
2162^{16}1.63±\pm.011.66±\pm.031.64±\pm.0318.4±\pm12.410.7±\pm6.010.0±\pm4.3.0011±\pm.0009.0063±\pm.0018.0016±\pm.0017
Lotka–Volterra2102^{10}-2.59±\pm.01-2.57±\pm.03-2.60±\pm.0177.1±\pm4.183.7±\pm15.983.1±\pm24.2.0060±\pm.0012.0064±\pm.0013.0054±\pm.0006
2132^{13}-2.18±\pm.02-2.17±\pm.02-2.20±\pm.0238.1±\pm13.729.9±\pm2.430.4±\pm6.2.0065±\pm.0012.0071±\pm.0012.0065±\pm.0009
2162^{16}-1.98±\pm.02-1.99±\pm.02-2.00±\pm.0118.3±\pm16.123.0±\pm15.418.3±\pm11.7.0053±\pm.0012.0068±\pm.0016.0050±\pm.0016

Table 1.

TARP-CvM thus matches CalNPE using only posterior samples, without evaluating the density. Its log density does not differ significantly from that of NPE in any setting, but is lower than that of CalNPE on Spatial SIR at the two smaller budgets. CalNPE achieves a lower HPD coverage error, the statistic it optimizes, with a significant difference in four settings. On the independent Mira score, TARP-CvM is closest to the calibrated value 2/32/3 in half of the settings, and CalNPE deviates most from it in 10 of 12 settings, consistent with its conservativeness objective, a one-sided penalty on under-coverage that leaves over-coverage unpenalized, which we used to match the configuration reported by Falkiewicz et al. [13].

None of these differences is significant.

Conclusion

We introduced TARP-CvM, a differentiable coverage loss that vanishes if and only if the learned conditional distribution equals the true posterior. It requires only samples from the model, applies to any generative architecture, and is a strict divergence (Theorem 1). On SBI benchmarks, it matches a density-based coverage loss with the same number of model evaluations, without evaluating the density. On imaging inverse problems, including one with a nonlinear black-box forward model, it is the only regularizer that brings the posterior into the Mira null band on all three problems, with little change in the quality of point estimates. The main practical design choice is the construction of reference points, which are built around a point estimate b(y)b(y). For linear forward models, the adjoint ATyA^{\mathsf{T}}y works well. Without an adjoint, an auxiliary regressor of the posterior mean can be trained at extra cost, as in our SBI experiments. Future work includes other nonlinear inverse problems, such as full waveform inversion and black hole imaging, and SBI problems in cosmology, where the forward model is a physics simulator and posteriors are often multimodal.

AI use statement

In this work, we used generative AI tools for formulating mathematical claims, assisting in the writing and checking of proofs, providing feedback on the design of the method and experiments, and assisting in implementing the method and experiments. Additionally, we used generative AI tools to edit and rewrite the manuscript for clarity. We have reviewed all AI-assisted work. All theorems and proofs were checked line by line by the authors. AI-generated code was reviewed and tested by the authors. Results were interpreted and conclusions drawn by the authors, and all edited text was reviewed by the authors. We take responsibility for the final content of this work, including text, claims, or artifacts produced with the aid of generative AI.

Acknowledgments

All authors gratefully acknowledge the support of the NSF-Simons AI-Institute for the Sky (SkAI) via grants NSF AST-2421845 and Simons Foundation MPS-AI-00010513. RW further gratefully acknowledges the support of the NSF-Simons National Institute for Theory and Mathematics in Biology (NITMB), via grants NSF DMS-2235451 and Simons Foundation MP-TMPS-00005320, and AFOSR FA9550-18-1-0166. This research used the DeltaAI advanced computing and data resource, which is supported by the National Science Foundation (award OAC 2320345) and the State of Illinois. DeltaAI is a joint effort of the University of Illinois Urbana-Champaign and its National Center for Supercomputing Applications.

Proofs

This section proves Theorem 1. Section A.1 defines the support of a distribution over rules, Section A.2 recalls the notation, and Section A.3 collects preliminary facts: the regularity of the radial mass function, the calibration of the true posterior for every rule, and a Cramér–Wold argument showing that integrals over half-spaces determine a function of the measurement. The direction “qϕ=pq_{\phi}=p implies Dρ=0D_{\rho}=0” holds for any ρ\rho and follows from Lemma 1. The converse is proved in three steps, one per subsection:

  1. if Dρ=0D_{\rho}=0, every rule in the support of ρ\rho is calibrated (Section A.4)

  2. by patching (R2), the coverage at each measurement then does not depend on the reference point (Section A.5)

  3. since reference points are dense (R1), this invariance forces p(⋅∣y)=qϕ(⋅∣y)p(\cdot\mid y)=q_{\phi}(\cdot\mid y) (Section A.6).

Section A.7 assembles the three steps.

Rules, their topology and the support of ρ\rho

A reference rule is a measurable map ψ:Y→Θ\psi:\mathcal{Y}\to\Theta. We define how far apart two rules ψ\psi and ψ′\psi' are by

d0(ψ,ψ′)=Ey∼p(y)[min⁡{1,∥ψ(y)−ψ′(y)∥}].d_0(\psi,\psi')=\mathbb{E}_{y\sim p(y)}\left[\min\{1,\|\psi(y)-\psi'(y)\|\}\right].

the metric of convergence in probability. Two rules are close if their reference points are close for most measurements. The support of a distribution ρ\rho over rules is the set of rules that ρ\rho approaches arbitrarily closely with positive probability: ψ\psi is in the support if, for every ν>0\nu>0, a rule drawn from ρ\rho is within distance ν\nu of ψ\psi with positive probability,

supp⁡ρ={ψ:Pψ′∼ρ[d0(ψ′,ψ)<ν]>0 for every ν>0}.\operatorname{supp}\rho=\left\{\psi:\mathbb{P}_{\psi'\sim\rho}\left[d_0(\psi',\psi)<\nu\right]>0\text{ for every }\nu>0\right\}.

A rule in supp⁡ρ\operatorname{supp}\rho need not be drawn with positive probability. For the switch sampler, any particular rule has probability zero, but rules arbitrarily close to it are drawn with positive probability.

Conventions

Throughout the appendix we write qq for qϕq_{\phi}. The distance dd on Θ\Theta is induced by a norm, B(c,t)={θ:d(θ,c)≤t}B(c,t)=\{\theta:d(\theta,c)\le t\} is the closed ball, and vol⁡\operatorname{vol} is the Lebesgue measure on Rdθ\mathbb{R}^{d_{\theta}}. By Assumption 1, Θ\Theta is open and, for every yy, p(⋅∣y)p(\cdot\mid y) and q(⋅∣y)q(\cdot\mid y) have continuous densities that are strictly positive on Θ\Theta. We recall the objects of the main text. For a reference point c∈Θc\in\Theta, the radial mass function of the estimator is

mc(t∣y)=Pθ~∼q(⋅∣y)[θ~∈B(c,t)],t≥0.m_c(t\mid y)=\mathbb{P}_{\widetilde{\theta}\sim q(\cdot\mid y)}[\widetilde{\theta}\in B(c,t)],\qquad t\ge0.

For a rule ψ\psi, the credibility value is sψ(θ,y)=mψ(y)(d(θ,ψ(y))∣y)s_{\psi}(\theta,y)=m_{\psi(y)}(d(\theta,\psi(y))\mid y), the conditional coverage is Fψ(α∣y)=Pθ∼p(⋅∣y)[sψ(θ,y)≤α]F_{\psi}(\alpha\mid y)=\mathbb{P}_{\theta\sim p(\cdot\mid y)}[s_{\psi}(\theta,y)\le\alpha], and the expected coverage is Fψ(α)=∫Fψ(α∣y)p(y) dyF_{\psi}(\alpha)=\int F_{\psi}(\alpha\mid y)p(y)\,dy. For a constant rule ψ≡c\psi\equiv c we write Fc(α∣y)F_c(\alpha\mid y). Finally,

Iψ=∫01(Fψ(α)−α)2 dα,Dρ(p,q)=Eψ∼ρ[Iψ].I_{\psi}=\int_{0}^{1}(F_{\psi}(\alpha)-\alpha)^2\,d\alpha,\qquad D_{\rho}(p,q)=\mathbb{E}_{\psi\sim\rho}[I_{\psi}].

Two remarks are used repeatedly. First, the conditional coverage at yy depends on the rule only through its reference point at yy: Fψ(α∣y)=Fψ(y)(α∣y)F_{\psi}(\alpha\mid y)=F_{\psi(y)}(\alpha\mid y). Second, α↦Fψ(α∣y)\alpha\mapsto F_{\psi}(\alpha\mid y) and α↦Fψ(α)\alpha\mapsto F_{\psi}(\alpha) are cumulative distribution functions, hence non-decreasing and right-continuous.

Preliminary facts

We restate and prove Lemma 1.

Under Assumption 1, if q(⋅∣y)=p(⋅∣y)q(\cdot\mid y) = p(\cdot\mid y) for every yy, then Fψ(α∣y)=αF_{\psi}(\alpha\mid y) = \alpha for every rule ψ\psi, every level α∈[0,1]\alpha\in[0,1] and every yy, and hence Fψ(α)=αF_{\psi}(\alpha) = \alpha.

Proof. A correct estimator is calibrated, no matter how the regions are chosen. Let RαR_{\alpha} be any credible region map of qq. Factoring the joint density as p(θ,y)=p(y) p(θ∣y)p(\theta,y) = p(y)\,p(\theta\mid y) and exchanging the order of integration, we obtain

ECP⁡(q,α,Rα)=P(θ,y)∼p[θ∈Rα(y)]=∬1θ∈Rα(y)p(θ,y) dθ dy=∫p(y)(∫1θ∈Rα(y)p(θ∣y) dθ)dy=∫p(y)(∫Rα(y)q(θ∣y) dθ)dy=∫p(y) α dy=α.\begin{aligned} \operatorname{ECP}(q,\alpha,R_{\alpha}) = \mathbb{P}_{(\theta,y)\sim p}[\theta\in R_{\alpha}(y)] = \iint\mathbb{1}_{\theta\in R_{\alpha}(y)}p(\theta,y)\,\mathrm{d}\theta\,\mathrm{d}y \\ &= \int p(y)\left(\int\mathbb{1}_{\theta\in R_{\alpha}(y)}p(\theta\mid y)\,\mathrm{d}\theta\right)\mathrm{d}y = \int p(y)\left(\int_{R_{\alpha}(y)}q(\theta\mid y)\,\mathrm{d}\theta\right)\mathrm{d}y \\ &= \int p(y)\,\alpha\,\mathrm{d}y = \alpha. \end{aligned}

where the fourth equality uses p(⋅∣y)=q(⋅∣y)p(\cdot\mid y) = q(\cdot\mid y), and the fifth uses the definition of a credible region. The inner integral equals α\alpha for every yy, so the statement holds at each measurement, before averaging over yy. For the TARP region of a rule ψ\psi, the event θ∈Rα,ψTARP(y)\theta\in R_{\alpha,\psi}^{\mathrm{TARP}}(y) is the event sψ(θ,y)≤αs_{\psi}(\theta,y) \leq\alpha (§ 3.2): the credibility value of θ\theta is the mass of the ball where θ\theta is at the border, so it is at most α\alpha exactly when θ\theta lies in the ball of mass α\alpha. Hence Fψ(α∣y)=Pθ∼p(⋅∣y)[θ∈Rα,ψTARP(y)]=αF_{\psi}(\alpha\mid y) = \mathbb{P}_{\theta\sim p(\cdot\mid y)}[\theta\in R_{\alpha,\psi}^{\mathrm{TARP}}(y)] = \alpha for every yy, and averaging over p(y)p(y) gives Fψ(α)=αF_{\psi}(\alpha) = \alpha. □

Lemma 2 (Radial mass function). Under Assumption 1, for every yy:

(i) (c,t)↦mc(t∣y)(c,t) \mapsto m_c(t \mid y) is continuous on Θ×[0,∞)\Theta\times[0,\infty);

(ii) for every c∈Θc \in\Theta there is tc>0t_c > 0 such that t↦mc(t∣y)t \mapsto m_c(t \mid y) is strictly increasing on [0,tc][0,t_c], with mc(0∣y)=0m_c(0 \mid y) = 0.

Proof. (i) Since Θ×[0,∞)\Theta\times[0,\infty) is a metric space, it suffices to check continuity along sequences. Let (cn,tn)n∈N(c_n,t_n)_{n\in\mathbb{N}} be a sequence converging to (c,t)(c,t). For every θ\theta with d(θ,c)≠td(\theta,c) \ne t, the indicator 1d(θ,cn)≤tn\mathbb{1}_{d(\theta,c_n)\leq t_n} converges to 1d(θ,c)≤t\mathbb{1}_{d(\theta,c)\leq t}. The sphere {θ:d(θ,c)=t}\{\theta: d(\theta,c) = t\} has zero volume, hence zero mass under q(⋅∣y)q(\cdot\mid y), so the convergence holds qq-almost everywhere and dominated convergence gives mcn(tn∣y)→mc(t∣y)m_{c_n}(t_n \mid y) \to m_c(t \mid y). (ii) Since Θ\Theta is open, there is tc>0t_c > 0 with B(c,tc)⊆ΘB(c,t_c) \subseteq\Theta. For 0≤t<t′≤tc0 \leq t < t' \leq t_c, the difference mc(t′∣y)−mc(t∣y)m_c(t' \mid y) - m_c(t \mid y) is the qq-mass of the shell B(c,t′)∖B(c,t)B(c,t') \setminus B(c,t), which has positive volume and lies in Θ\Theta, where q(⋅∣y)>0q(\cdot\mid y) > 0. Hence it is positive. Finally mc(0∣y)m_c(0 \mid y) is the mass of the point cc, which is zero. □

Proposition 1 (Half-spaces detect functions). Let ff be a bounded function on Rdy\mathbb{R}^{d_y} such that

∫Hf(y)p(y) dy=0for every half-space H={y:⟨u,y⟩≤t},\int_H f(y)p(y)\,\mathrm{d}y = 0 \quad\text{for every half-space } H = \{y : \langle u,y\rangle\leq t\},

with uu a unit vector and t∈Rt \in\mathbb{R}. Then f(y)=0f(y) = 0 for p(y)p(y)-almost every yy.

Proof. The idea is that integrals over half-spaces determine all integrals of functions of a projection ⟨u,y⟩\langle u,y\rangle, and these in turn determine the Fourier transform of fpfp. Write g(y)=f(y)p(y)g(y) = f(y)p(y), which is integrable since ff is bounded, and fix a unit vector uu.

Slabs. Letting t→∞t \to\infty in the hypothesis gives ∫g=0\int g = 0. Subtracting the hypothesis at two thresholds a<ba < b gives ∫{a<⟨u,y⟩≤b}g(y) dy=0\int_{\{a < \langle u,y\rangle\leq b\}} g(y)\,\mathrm{d}y = 0. Hence ∫h(⟨u,y⟩)g(y) dy=0\int h(\langle u,y\rangle)g(y)\,\mathrm{d}y = 0 for every step function hh, that is, every finite combination of indicators of intervals (a,b](a,b].

Trigonometric functions. Fix λ∈R\lambda\in\mathbb{R}, κ>0\kappa> 0 and n≥1n \geq1. Let hnh_n be the step function equal to cos⁡(λs)\cos(\lambda s) on each interval (a,a+1/n](a,a+1/n] of a regular grid of [−κ,κ][-\kappa,\kappa], and to 00 outside [−κ,κ][-\kappa,\kappa]. Then ∣cos⁡(λs)−hn(s)∣≤∣λ∣/n|\cos(\lambda s)-h_n(s)| \leq|\lambda|/n for ∣s∣≤κ|s| \leq\kappa, and ≤1\leq1 otherwise, so

∣∫cos⁡(λ⟨u,y⟩)g(y) dy∣=∣∫(cos⁡(λ⟨u,y⟩)−hn(⟨u,y⟩))g(y) dy∣≤sup⁡∣f∣(∣λ∣n+Py∼p[∣⟨u,y⟩∣>κ]).\left|\int\cos(\lambda\langle u,y\rangle)g(y)\,\mathrm{d}y\right| = \left|\int\left(\cos(\lambda\langle u,y\rangle)-h_n(\langle u,y\rangle)\right)g(y)\,\mathrm{d}y\right| \leq\sup|f|\left(\frac{|\lambda|}{n} + \mathbb{P}_{y\sim p}[|\langle u,y\rangle| > \kappa]\right).

Letting n→∞n \to\infty and then κ→∞\kappa\to\infty shows that the left-hand side is zero. The same argument applies to sin, so ∫eiλ⟨u,y⟩g(y) dy=0\int e^{i\lambda\langle u,y\rangle}g(y)\,dy=0.

Conclusion. Every vector v∈Rdyv \in\mathbb{R}^{d_y} is of the form λu\lambda u, so the Fourier transform g^(v)=∫ei⟨v,y⟩g(y) dy\hat{g}(v)=\int e^{i\langle v,y\rangle}g(y)\,dy vanishes everywhere. An integrable function whose Fourier transform vanishes is zero almost everywhere, so f(y)p(y)=0f(y)p(y)=0 for almost every yy, that is, f(y)=0f(y)=0 for p(y)p(y)-almost every yy. This is the Cramér–Wold argument [8].

Half-spaces are used only through Proposition 1: any other family of sets for which this proposition holds can replace them in (R2).

From zero loss to calibration on the support

Lemma 3 (Continuity). Under Assumption 1, the map ψ↦Iψ\psi\mapsto I_\psi is continuous for the metric d0d_0.

Proof. Let ψn→ψ\psi_n \to\psi for d0d_0, that is, in p(y)p(y)-probability. It suffices to show that every subsequence has a further subsequence along which Iψn→IψI_{\psi_n} \to I_\psi. Convergence in probability gives a subsequence, still denoted ψn\psi_n, such that ψn(y)→ψ(y)\psi_n(y) \to\psi(y) for p(y)p(y)-almost every yy. For such yy and every θ\theta,

sψn(θ,y)=mψn(y)(d(θ,ψn(y))∣y)⟶mψ(y)(d(θ,ψ(y))∣y)=sψ(θ,y).s_{\psi_n}(\theta,y)=m_{\psi_n(y)}(d(\theta,\psi_n(y))\mid y)\longrightarrow m_{\psi(y)}(d(\theta,\psi(y))\mid y)=s_\psi(\theta,y).

by continuity of dd and joint continuity of the radial mass function (Lemma 2). So sψn→sψs_{\psi_n}\to s_\psi almost surely under p(θ,y)p(\theta,y), hence in distribution, and Fψn(α)→Fψ(α)F_{\psi_n}(\alpha)\to F_\psi(\alpha) at every continuity point of FψF_\psi, that is, for all but countably many α\alpha. Since ∣Fψn(α)−α∣≤1\lvert F_{\psi_n}(\alpha)-\alpha\rvert\le1, bounded convergence gives Iψn→IψI_{\psi_n}\to I_\psi.

Lemma 4. Under Assumption 1, if Dρ(p,q)=0D_\rho(p,q)=0, then Fψ(α)=αF_\psi(\alpha)=\alpha for every ψ∈supp⁡ρ\psi\in\operatorname{supp}\rho and every α∈[0,1]\alpha\in[0,1].

Proof. Since Iψ≥0I_\psi\ge0 and Eψ∼ρ[Iψ]=0\mathbb{E}_{\psi\sim\rho}[I_\psi]=0, we have Iψ=0I_\psi=0 for ρ\rho-almost every ψ\psi. The set Z={ψ:Iψ=0}Z=\{\psi:I_\psi=0\} is closed by Lemma 3, and ρ(Z)=1\rho(Z)=1. If some ψ∈supp⁡ρ\psi\in\operatorname{supp}\rho were outside ZZ, a small ball around ψ\psi would lie in the open complement of ZZ and have positive probability under ρ\rho, a contradiction. Hence Iψ=0I_\psi=0 on supp⁡ρ\operatorname{supp}\rho, so Fψ(α)=αF_\psi(\alpha)=\alpha for almost every α\alpha, and for every α\alpha by right-continuity of both sides.

From calibration to invariance to the reference point

Every rule in supp⁡ρ\operatorname{supp}\rho is now calibrated, but calibration is an average over measurements, in which errors at different measurements can cancel. This step obtains a statement at each measurement: the coverage curve at yy does not depend on the reference point. As in the main-text example, it compares a rule ψ′\psi' with the rule patched from ψ\psi on a half-space, which isolates what happens on that half-space.

Lemma 5 (Invariance to the reference point). Let ρ\rho be admissible with family Ψ\Psi, and suppose that every rule in supp⁡ρ\operatorname{supp}\rho is calibrated. Then, for p(y)p(y)-almost every yy, the coverage curve at yy does not depend on the rule of Ψ\Psi:

Fψ⊕Hψ′(α∣y)=Fψ′(α∣y)for all ψ,ψ′∈Ψ and all α∈[0,1].F_{\psi\oplus_H\psi'}(\alpha\mid y)=F_{\psi'}(\alpha\mid y)\qquad\text{for all }\psi,\psi'\in\Psi\text{ and all }\alpha\in[0,1].

Proof. Step 1: coverage of a patched rule. Fix ψ,ψ′∈Ψ\psi,\psi'\in\Psi, a level α\alpha, and a half-space HH. The coverage at a measurement yy depends on the rule only through its reference point at yy. The patched rule ψ⊕Hψ′\psi\oplus_H\psi' has reference point ψ(y)\psi(y) for y∈Hy\in H and ψ′(y)\psi'(y) for y∉Hy\notin H, so its coverage curve at yy is Fψ(α∣y)F_\psi(\alpha\mid y) on HH and Fψ′(α∣y)F_{\psi'}(\alpha\mid y) outside HH. Averaging over measurements,

Fψ⊕Hψ′(α)=∫HFψ(α∣y)p(y) dy+∫y∉HFψ′(α∣y)p(y) dy.F_{\psi\oplus_H\psi'}(\alpha)=\int_H F_\psi(\alpha\mid y)p(y)\,dy+\int_{y\notin H}F_{\psi'}(\alpha\mid y)p(y)\,dy.

Subtracting Fψ′(α)=∫Fψ′(α∣y)p(y) dyF_{\psi'}(\alpha)=\int F_{\psi'}(\alpha\mid y)p(y)\,dy, the part outside HH cancels and

Fψ⊕Hψ′(α)−Fψ′(α)=∫HΔ(y)p(y) dy,Δ(y)=Fψ(α∣y)−Fψ′(α∣y).F_{\psi\oplus_H\psi'}(\alpha)-F_{\psi'}(\alpha)=\int_H\Delta(y)p(y)\,dy,\qquad\Delta(y)=F_\psi(\alpha\mid y)-F_{\psi'}(\alpha\mid y).

Here Δ(y)\Delta(y) is the difference of coverage at yy between the two reference points ψ(y)\psi(y) and ψ′(y)\psi'(y), and $\lvert\Delta\rvert\le 1.

Step 2: both rules are calibrated. The rule ψ′\psi' is in supp⁡ρ\operatorname{supp}\rho because Ψ⊆supp⁡ρ\Psi\subseteq\operatorname{supp}\rho, and the patched rule ψ⊕Hψ′\psi\oplus_H\psi' is in supp⁡ρ\operatorname{supp}\rho by (R2). Both are calibrated, so both coverages equal α\alpha and the left-hand side of Step 1 is zero:

∫HΔ(y)p(y) dy=0for every half-space H.\int_H \Delta(y)p(y)\,\mathrm{d}y=0 \qquad\text{for every half-space }H.

Step 3: from half-spaces to each measurement. By Proposition 1, applied to f=Δf=\Delta, we get Δ(y)=0\Delta(y)=0 for p(y)p(y)-almost every yy. In other words, Fψ(α∣y)=Fψ′(α∣y)F_{\psi}(\alpha\mid y)=F_{\psi'}(\alpha\mid y) for every measurement yy except those in a set Nψ,ψ′,αN_{\psi,\psi',\alpha} that has probability zero under p(y)p(y).

Step 4: all pairs and all levels at once. The exceptional set of Step 3 depends on ψ\psi, ψ′\psi' and α\alpha. Let NN be the union of these sets over all pairs ψ,ψ′∈Ψ\psi,\psi'\in\Psi and all rational levels α∈[0,1]∩Q\alpha\in[0,1]\cap\mathbb{Q}. There are countably many of them, so NN still has probability zero. For y∉Ny\notin N, the two coverage curves agree at every rational level. Both are distribution functions, hence right-continuous, and every α∈[0,1)\alpha\in[0,1) is a limit of rationals from the right, so they agree at every level; at α=1\alpha=1 both equal one.

From invariance to the reference point to equal densities

Lemma 6. Fix yy such that the reference points {ψ(y):ψ∈Ψ}\{\psi(y):\psi\in\Psi\} are dense in Θ\Theta and Fψ(⋅∣y)F_{\psi}(\cdot\mid y) is the same function GyG_y for all ψ∈Ψ\psi\in\Psi. Then p(⋅∣y)=q(⋅∣y)p(\cdot\mid y)=q(\cdot\mid y).

Proof. Let c=ψ(y)c=\psi(y) for some ψ∈Ψ\psi\in\Psi, write m=mc(⋅∣y)m=m_c(\cdot\mid y), and take tct_c from Lemma 2. For 0<t<tc0<t<t_c, mm is strictly increasing on [0,tc][0,t_c] and non-decreasing beyond, so m(D)≤m(t)m(D)\le m(t) if and only if D≤tD\le t. Applying this to D=d(θ,c)D=d(\theta,c) with θ∼p(⋅∣y)\theta\sim p(\cdot\mid y),

Gy(m(t))=Fc(m(t)∣y)=Pθ∼p(⋅∣y)[θ∈B(c,t)].G_y(m(t))=F_c(m(t)\mid y)=\mathbb{P}_{\theta\sim p(\cdot\mid y)}[\theta\in B(c,t)].

Since m(t)=Pθ∼q(⋅∣y)[θ∈B(c,t)]m(t)=\mathbb{P}_{\theta\sim q(\cdot\mid y)}[\theta\in B(c,t)], dividing gives

Gy(α)α=Pθ∼p(⋅∣y)[θ∈B(c,t)]Pθ∼q(⋅∣y)[θ∈B(c,t)],α=m(t).\frac{G_y(\alpha)}{\alpha}= \frac{\mathbb{P}_{\theta\sim p(\cdot\mid y)}[\theta\in B(c,t)]} {\mathbb{P}_{\theta\sim q(\cdot\mid y)}[\theta\in B(c,t)]}, \qquad\alpha=m(t).

As t↓0t\downarrow0, both densities are continuous and positive at cc, so each probability equals the density at cc times vol⁡(B(c,t))\operatorname{vol}(B(c,t)), up to a factor 1+o(1)1+o(1). The volumes cancel and the right-hand side tends to p(c∣y)/q(c∣y)p(c\mid y)/q(c\mid y). On the left, mm is a continuous increasing bijection from (0,tc)(0,t_c) onto (0,m(tc))(0,m(t_c)), so α↓0\alpha\downarrow0 exactly when t↓0t\downarrow0. Therefore L=lim⁡α↓0Gy(α)/αL=\lim_{\alpha\downarrow0}G_y(\alpha)/\alpha exists and

p(c∣y)=Lq(c∣y).p(c\mid y)=Lq(c\mid y).

The limit LL depends on GyG_y only, not on cc, so this identity holds at every reference point c=ψ(y)c=\psi(y), ψ∈Ψ\psi\in\Psi, a dense subset of Θ\Theta. Both densities are continuous, so it holds on all of Θ\Theta. Integrating over Θ\Theta gives L=1L=1, hence p(⋅∣y)=q(⋅∣y)p(\cdot\mid y)=q(\cdot\mid y).

Proof of Theorem 1

Under Assumption 1 and for any admissible ρ\rho,

Dρ(p,q)=0⟺q(⋅∣y)=p(⋅∣y) for p(y)-almost every y.D_{\rho}(p,q)=0\Longleftrightarrow q(\cdot\mid y)=p(\cdot\mid y)\text{ for }p(y)\text{-almost every }y.

Proof. (⇐)(\Leftarrow) By Lemma 1, Fψ(α)=αF_{\psi}(\alpha)=\alpha for every rule ψ\psi and every α\alpha, so Iψ=0I_{\psi}=0 for every ψ\psi and Dρ=0D_{\rho}=0. This direction holds for any ρ\rho.

(⇒)(\Rightarrow) Suppose Dρ=0D_{\rho}=0. By Lemma 4, every rule in supp⁡ρ\operatorname{supp}\rho is calibrated. By Lemma 5, there is a null set N2N_2 outside which Fψ(⋅∣y)F_{\psi}(\cdot\mid y) is the same function for all ψ∈Ψ\psi\in\Psi. By (R1), there is a null set N1N_1 outside which the reference points {ψ(y):ψ∈Ψ}\{\psi(y):\psi\in\Psi\} are dense in Θ\Theta. For every y∉N1∪N2y\notin N_1\cup N_2, Lemma 6 applies and gives p(⋅∣y)=q(⋅∣y)p(\cdot\mid y)=q(\cdot\mid y). Since N1∪N2N_1\cup N_2 is null, this holds for p(y)p(y)-almost every yy.

Training algorithm

Algorithm 1 summarizes one training step with the TARP-CvM regularizer. The base loss Lbase\mathcal{L}_{\mathrm{base}} is the training objective of the generative model, such as denoising score matching for diffusion models or the negative log-likelihood for normalizing flows.

Complexity For each rule, computing the NN credibility values requires NMNM distance evaluations, and the closed-form statistic of Equation (2) only requires sorting them, at cost O(Nlog⁡N)O(N \log N). Its gradient follows analytically from the ranks, so no differentiable sorting operator is needed. One step therefore costs O(RN(M+log⁡N))O(RN(M+\log N)) operations on top of drawing the NMNM posterior samples. In practice, the cost is dominated by sampling. For a diffusion model with a TT-step sampler, a step requires NMTNMT network evaluations, and backpropagating through the chains that carry gradient multiplies their cost, and the memory they require, by a factor proportional to TT. Training cost thus grows linearly with the sampler depth, which is why we train with T=20T=20 (§ 5.2, Appendix § 13.§ 3).

Unbiased estimator of the Cramér–von Mises statistic

For a fixed rule ψ\psi, the inner integral of Equation (1) is

Iψ=∫01(Fψ(α)−α)2 dα.I_\psi= \int_0^1 \left(F_\psi(\alpha)-\alpha\right)^2\,\mathrm{d}\alpha.

Given the credibility values s1,…,sNs_1,\ldots,s_N of a batch, Equation (2) replaces FψF_\psi by the empirical CDF F^ψ(α)=1N∑i1si≤α\widehat{F}_\psi(\alpha)=\frac{1}{N}\sum_i \mathbf{1}_{s_i\leq\alpha}, so that CvM⁡(s1:N)=∫01(F^ψ(α)−α)2 dα\operatorname{CvM}(s_{1:N})=\int_0^1\left(\widehat{F}_\psi(\alpha)-\alpha\right)^2\,\mathrm{d}\alpha. Writing gi(α)=1si≤α−αg_i(\alpha)=\mathbf{1}_{s_i\leq\alpha}-\alpha, we have F^ψ(α)−α=1N∑igi(α)\widehat{F}_\psi(\alpha)-\alpha=\frac{1}{N}\sum_i g_i(\alpha), and

CvM⁡(s1:N)=1N2∑i=1N∑j=1Nh(si,sj),h(s,s′)=∫01(1s≤α−α)(1s′≤α−α) dα.\operatorname{CvM}(s_{1:N})=\frac{1}{N^2}\sum_{i=1}^{N}\sum_{j=1}^{N}h(s_i,s_j),\qquad h(s,s')=\int_0^1\left(\mathbf{1}_{s\leq\alpha}-\alpha\right)\left(\mathbf{1}_{s'\leq\alpha}-\alpha\right)\,\mathrm{d}\alpha.

This is an average over all N2N^2 pairs (i,j)(i,j), including the NN diagonal pairs i=ji=j, that is, a V-statistic ([32]). The U-statistic ([19]) CvM⁡U\operatorname{CvM}_{U} of Equation (4) averages hh over the N(N−1)N(N-1) pairs with i≠ji\ne j only.

Proposition 2 (Bias of the plug-in estimator). Let s1,…,sNs_1,\ldots,s_N, with N≥2N\geq2, be independent with common CDF FψF_\psi on [0,1][0,1]. Then

E[CvM⁡U(s1:N)]=Iψ,E[CvM⁡(s1:N)]=Iψ+1N∫01Fψ(α)(1−Fψ(α)) dα.\mathbb{E}\left[\operatorname{CvM}_{U}(s_{1:N})\right]=I_\psi,\qquad\mathbb{E}\left[\operatorname{CvM}(s_{1:N})\right]=I_\psi+\frac{1}{N}\int_0^1F_\psi(\alpha)\left(1-F_\psi(\alpha)\right)\,\mathrm{d}\alpha.

Proof. Fix a level α\alpha. For i≠ji\ne j, the values sis_i and sjs_j are independent, so

E[gi(α)gj(α)]=E[gi(α)]E[gj(α)]=(Fψ(α)−α)2,\mathbb{E}\left[g_i(\alpha)g_j(\alpha)\right]=\mathbb{E}\left[g_i(\alpha)\right]\mathbb{E}\left[g_j(\alpha)\right]=\left(F_\psi(\alpha)-\alpha\right)^2,

which is the integrand of IψI_\psi. For i=ji=j, we obtain the second moment instead,

E[gi(α)2]=Var⁡(1si≤α)+(Fψ(α)−α)2=Fψ(α)(1−Fψ(α))+(Fψ(α)−α)2.\mathbb{E}\left[g_i(\alpha)^2\right]=\operatorname{Var}\left(\mathbf{1}_{s_i\leq\alpha}\right)+\left(F_\psi(\alpha)-\alpha\right)^2=F_\psi(\alpha)\left(1-F_\psi(\alpha)\right)+\left(F_\psi(\alpha)-\alpha\right)^2.

By Fubini’s theorem, E[h(si,sj)]\mathbb{E}[h(s_i,s_j)] is the integral over α\alpha of these expectations. Averaging over the N(N−1)N(N-1) off-diagonal pairs gives E[CvM⁡U]=Iψ\mathbb{E}[\operatorname{CvM}_{U}]=I_\psi, and averaging over all N2N^2 pairs, of which NN are diagonal, gives the expectation of CvM⁡\operatorname{CvM}.

It remains to check that Equation (4) is the off-diagonal average of hh. Using ∫011max⁡(s,s′)≤α dα=1−max⁡(s,s′)\int_0^1\mathbf{1}_{\max(s,s')\leq\alpha}\,\mathrm{d}\alpha=1-\max(s,s'), ∫01α1s≤α dα=(1−s2)/2\int_0^1\alpha\mathbf{1}_{s\leq\alpha}\,\mathrm{d}\alpha=(1-s^2)/2 and ∫01α2 dα=1/3\int_0^1\alpha^2\,\mathrm{d}\alpha=1/3,

h(s,s′)=12(s2+s′2)−max⁡(s,s′)+13.h(s,s')=\frac{1}{2}\left(s^2+s'^2\right)-\max(s,s')+\frac{1}{3}.

Summing over the ordered pairs i≠ji\ne j, the first term sums to (N−1)∑isi2(N-1)\sum_i s_i^2, and the kk-th smallest value s(k)s_{(k)} is the maximum of the 2(k−1)2(k-1) ordered pairs it forms with the smaller values. Dividing by N(N−1)N(N-1) gives Equation (4). ▫

Note that the bias term does not vanish at the posterior. When Fψ(α)=αF_{\psi}(\alpha)=\alpha, it equals 1N∫01α(1−α) dα=16N\frac{1}{N}\int_{0}^{1}\alpha(1-\alpha)\,d\alpha=\frac{1}{6N}. It also shifts the minimizer of the expected loss.

Scoring rules and loss landscapes

Definitions

The continuous ranked probability score (CRPS) compares the cumulative distribution function (CDF) of the model with the CDF of a point mass at the observation. Part of its appeal is that CDFs are easy to estimate from an ensemble of generated samples. For models that are easy to sample from but have no closed-form CDF, the CRPS admits the energy form

CRPS⁡(qϕ(⋅∣y),θ)=2Eθ^∼qϕ(⋅∣y)∣θ^−θ∣−Eθ^,θ^′∼qϕ(⋅∣y)∣θ^−θ^′∣\operatorname{CRPS}(q_{\phi}(\cdot\mid y),\theta)=2\mathbb{E}_{\hat{\theta}\sim q_{\phi}(\cdot\mid y)}\lvert\hat{\theta}-\theta\rvert-\mathbb{E}_{\hat{\theta},\hat{\theta}'\sim q_{\phi}(\cdot\mid y)}\lvert\hat{\theta}-\hat{\theta}'\rvert

The first term penalizes a model whose samples are far from the true θ\theta on average, and the second rewards samples that are spread out, so that a model cannot minimize the CRPS by collapsing to a point prediction. Unlike CDFs, this energy form generalizes directly to several dimensions by replacing the absolute value with the Euclidean norm, which gives the energy score of § 2. On the class of distributions with finite first moment, the energy score is strictly proper:

Eθ∼p(⋅∣y)[ES⁡(qϕ(⋅∣y),θ)]≥Eθ∼p(⋅∣y)[ES⁡(p(⋅∣y),θ)]\mathbb{E}_{\theta\sim p(\cdot\mid y)}[\operatorname{ES}(q_{\phi}(\cdot\mid y),\theta)]\ge\mathbb{E}_{\theta\sim p(\cdot\mid y)}[\operatorname{ES}(p(\cdot\mid y),\theta)]

with equality if and only if qϕ(⋅∣y)=p(⋅∣y)q_{\phi}(\cdot\mid y)=p(\cdot\mid y). Like CRPS, it can be evaluated from samples of a generative model alone.

In high dimension, the CRPS is often computed for each coordinate separately rather than replaced by the energy score. We call this the pixel-wise CRPS,

pCRPS⁡(qϕ(⋅∣y),θ)=∑j=1dθCRPS⁡(qϕ(⋅∣y)(j),θ(j))\operatorname{pCRPS}(q_{\phi}(\cdot\mid y),\theta)=\sum_{j=1}^{d_{\theta}}\operatorname{CRPS}(q_{\phi}(\cdot\mid y)^{(j)},\theta^{(j)})

where the superscript jj denotes restriction to the jj-th coordinate. Its motivation is often computational, since it parallelizes across pixels. It is however minimized by any model with the correct one-dimensional marginals, and therefore does not constrain the dependence between coordinates.

Strict propriety and training

Strict propriety is a statement about the global minimizer of the population loss, and two gaps separate it from what training achieves. First, the loss is minimized over a finite training set, and the minimizer of this empirical approximation need not be the minimizer of the population loss. Second, gradient descent generally finds local rather than global minima. Two strictly proper scoring rules share the same global minimizer, but they can have very different loss landscapes, with different local minima, so that training with one can yield much better coverage than training with the other. Section D.3 illustrates this on a Gaussian model.

Loss landscapes

We examine the same setting as the inverse problem in Figure 1, setting θ\theta to have dimension 8 and YY dimension 4.

We identify the true parameters of the posterior distribution θ∣Y\theta\mid Y and perturb them by deviating the mean in the direction of largest variance and the scale of the variance in that same direction. See the equation below for this perturbation model:

qa,b(θ∣y)=Normal⁡(W∗y+h(a)λjvj,  Vdiag⁡(λ1,…,e2bλj,…,λD)VT)q_{a,b}(\theta\mid y)=\operatorname{Normal}\left(W^{*}y+h(a)\sqrt{\lambda_j}v_j,\;V\operatorname{diag}\left(\lambda_1,\ldots,e^{2b}\lambda_j,\ldots,\lambda_D\right)V^{\mathsf{T}}\right)

where a,ba,b are the mean and scale perturbation parameters, respectively. h(a)=a3−3a−4.048h(a)=a^3-3a-4.048 parameterizes the mean perturbation and vanishes at a=2.2a=2.2. The scale perturbation vanishes at b=0b=0. We see in Figure 5 the loss landscapes for Energy Score and TARP-CvM in terms of aa and bb.

Figure 5. Loss landscapes for the toy model described in Section D.3.

In Figure 6, we have slices of the loss functions at the local and global minima of aa, the mean parameter. We see that TARP-CvM has much more sensitivity to changing the spread parameter, bb, when aa is at the local minimum than energy score does. In other words, we are comparing the steepness of the blue lines in each plot.

Figure 6. A slice of the loss landscape described in Section D.3.

Intuitively, when one gets stuck in a local minimum for the mean parameter, TARP-CvM recovers correct coverage by pushing the conditional distribution toward wider spread to compensate for the bias in the mean. In contrast, the energy score’s loss function is relatively flat with respect to the spread parameter in this local optimum. So, when noisy gradients provide imperfect optimization of this population loss, the energy score is less likely to correct coverage when gradient descent is near a local minimum for the conditional mean, since the signal in the loss is too flat to overcome gradient noise.

Experiments

Toy model

Setup. The parameters have a Gaussian prior θ∼N(0,Σ0)\theta\sim\mathcal{N}(0, \Sigma_0), and the measurements follow y=Aθ+ϵy = A\theta+ \epsilon, with ϵ∼N(0,σ2I)\epsilon\sim\mathcal{N}(0, \sigma^2 I), dy=4d_y = 4, and dθ=8d_\theta= 8, so that AA cannot be inverted. The posterior is Gaussian,

p(θ∣y)=N(W∗y,S∗),W∗=Σ0ATΣy−1,S∗=Σ0−W∗AΣ0,p(\theta\mid y) = \mathcal{N}(W^*y, S^*), \qquad W^* = \Sigma_0 A^{\mathsf{T}}\Sigma_y^{-1}, \qquad S^* = \Sigma_0 - W^*A\Sigma_0,

where Σy=AΣ0AT+σ2I\Sigma_y = A\Sigma_0 A^{\mathsf{T}} + \sigma^2 I is the covariance of the measurements. The estimator is qϕ(θ∣y)=N(Wy,S)q_\phi(\theta\mid y) = \mathcal{N}(Wy, S), where ϕ=(W,S)\phi= (W, S) are parameters to fit.

HPD calibration does not identify the posterior. The density of qϕ(⋅∣y)q_\phi(\cdot\mid y) is a decreasing function of the Mahalanobis norm m(θ)=(θ−Wy)TS−1(θ−Wy)m(\theta) = (\theta- Wy)^{\mathsf{T}}S^{-1}(\theta- Wy), so its HPD regions are the ellipsoids {θ:m(θ)≤tα}\{\theta: m(\theta) \le t_\alpha\} with mass α\alpha under qϕ(⋅∣y)q_\phi(\cdot\mid y). Under p(θ,y)p(\theta, y), the residual e=θ−Wye = \theta- Wy decomposes as (θ−W∗y)+(W∗−W)y(\theta- W^*y) + (W^* - W)y. The first term has distribution N(0,S∗)\mathcal{N}(0, S^*) given yy, hence is independent of yy, and the second has covariance (W∗−W)Σy(W∗−W)T(W^* - W)\Sigma_y(W^* - W)^{\mathsf{T}}, so that marginally

e∼N(0,CW),CW=S∗+(W∗−W)Σy(W∗−W)T.e \sim\mathcal{N}(0, C_W), \qquad C_W = S^* + (W^* - W)\Sigma_y(W^* - W)^{\mathsf{T}}.

If S=CWS = C_W, the residual of the true parameter has the same distribution as θ~−Wy\tilde{\theta} - Wy for a draw θ~∼qϕ(⋅∣y)\tilde{\theta} \sim q_\phi(\cdot\mid y). The true parameter then falls in each HPD region with probability α\alpha, so the estimator is HPD-calibrated, for every WW.

Points of the manifold. At W=W∗W = W^*, S=S∗S = S^* is the true posterior. At W=0W = 0, S=S∗+W∗ΣyW∗T=S∗+W∗AΣ0=Σ0S = S^* + W^*\Sigma_yW^{*\mathsf{T}} = S^* + W^*A\Sigma_0 = \Sigma_0, so the prior is HPD-calibrated. For every W≠W∗W \ne W^*, the mean WyWy is biased and S−S∗=(W∗−W)Σy(W∗−W)TS - S^* = (W^* - W)\Sigma_y(W^* - W)^{\mathsf{T}} is positive semi-definite and nonzero, so the estimator is wider than the posterior at every measurement: marginal calibration is reached by trading the bias of the mean for extra spread.

Simulation Based Inference

Problems. We use the simulators of Hermans et al. [17] with the problem settings of Falkiewicz et al. [13]. For each problem we generate up to 2162^{16} simulations for training, with 10410^4 for validation, and 10410^4 held-out pairs for evaluation.

  • SLCP (simple likelihood, complex posterior) is used in the marginal variant of Hermans et al. [17], in which only two parameters are inferred and the likelihood becomes intractable. The parameters are θ∈[−3,3]2\theta\in[-3, 3]^2. The observation y∈R8y \in\mathbb{R}^8 consists of four draws from a bivariate Gaussian with fixed mean (0.7,−2.9)(0.7, -2.9), standard deviations θ1\theta_1 and θ2\theta_2, and correlation tanh⁡(ρ)\tanh(\rho), where nuisance parameter ρ∼U(−3,3)\rho\sim\mathcal{U}(-3, 3) is marginalized out. Since θ\theta enters only through its squares, the posterior has four symmetric modes.

  • Weinberg infers the Fermi constant, normalized to its nominal value, θ∈[0.25,2]\theta\in[0.25, 2], from y∈[−1,1]20y \in[-1, 1]^{20}. The observation contains the cosines of the scattering angle of twenty e+e−→μ+μ−e^+e^- \to\mu^+\mu^- events drawn by rejection sampling from the differential cross-section at a beam energy of 40 GeV.

  • Spatial SIR infers the infection and recovery rates θ=(β,γ)∈[0,1]2\theta= (\beta, \gamma) \in[0, 1]^2 of a stochastic epidemic on a 50×5050 \times50 lattice. The epidemic is seeded with 1+Poisson⁡(3)1 + \operatorname{Poisson}(3) infected cells at random positions and propagated through 3×33 \times3 neighborhoods. The observation y∈{0,1}3×50×50y \in\{0, 1\}^{3 \times50 \times50} records the susceptible, infected and recovered state of every cell at time t=1t = 1.

  • Lotka–Volterra is a predator-prey Markov jump process started from 50 predators and 100 prey. The parameters θ∈[−4,1]2\theta\in[-4, 1]^2 are the log-rates of the two predator reactions. The two prey log-rates are drawn from the same prior and marginalized out. The observation y∈R2×1001y \in\mathbb{R}^{2 \times1001} is the trajectory of both populations.

Architecture and training. Neural posterior estimation (NPE, Papamakarios and Murray, [34]; Lueckmann et al., [29]; Deistler et al., [9]; Greenberg et al., [16]) fits a conditional density estimator qϕ(θ∣y)q_\phi(\theta\mid y) by maximum likelihood on simulated pairs, minimizing −(1/N)∑ilog⁡qϕ(θi∣yi)-(1/N)\sum_i \log q_\phi(\theta_i \mid y_i). This is equivalent to minimizing the forward KL divergence to the posterior, averaged over p(y)p(y). We use the architecture of Falkiewicz et al. [13], implemented with the SBI library (Tejero-Cantero et al., [42]). It is a conditional neural spline flow (Durkan et al., [12]), with rational-quadratic spline transforms (10 bins, hidden width 64) and a Gaussian base distribution. There are three transforms, each a coupling layer followed by a linear layer, except for the one-dimensional Weinberg problem, which uses a single transform whose spline parameters depend on the conditioning only. The flow is conditioned on an embedding of yy given by an MLP with three hidden layers of width 64, SELU activations and a 10-dimensional output. The 7500-dimensional Spatial SIR observations and the 2002-dimensional Lotka-Volterra trajectories are flattened before embedding.

Parameters and observations are standardized per coordinate using the training data. We train with Adam, using a learning rate of 10−310^{-3}, a batch size of 128, gradient-norm clipping at 5, for 50 epochs without early stopping. We keep the checkpoint with the lowest validation loss on the 10410^4 validation simulations. All three objectives of Table 1 share this training recipe.

For CalNPE, we use the conservativeness objective of Falkiewicz et al. [13], which penalizes only coverage below the nominal level, with weight λ=100\lambda= 100, the default of their released code, instead of the published λ=5\lambda= 5, which gave worse results in our experiments. HPD credibilities are estimated from the density of the estimator at 16 draws from the prior, with straight-through gradients for the indicators and differentiable sorting (Blondel et al., [4]).

TARP-CvM uses weight λ=30\lambda= 30 and M=16M = 16 reparameterized posterior draws per pair, so that both regularizers use 16 flow evaluations per pair: CalNPE evaluates the density at 16 prior draws, TARP-CvM draws 16 posterior samples. Each step uses R=48R = 48 references in three groups of 16, described below. The indicators are relaxed with a sigmoid at temperature τ=0.05\tau= 0.05 times the median sample-to-reference distance of each reference, treated as a constant, and the loss is the closed-form CvM statistic of Equation (2), computed per reference and averaged over the RR references.

Reference points without a forward operator Without access to the forward operator to estimate b(y)b(y), we resort to regressing the posterior mean. The point estimate b(y)b(y) is an MLP (two hidden layers of width 128, SELU) trained beforehand on the flow’s own training pairs with a mean-squared-error loss, with Adam (learning rate 10−310^{-3}, weight decay 10−410^{-4}, batch 256). The R=48R = 48 references of a step form three groups of 16: (1) switch-rule references, (2) points drawn from the prior distribution and shared by the batch, and (3) the posterior draws of each pair, detached from the computation graph. The credibility of a posterior reference is computed from the 15 other draws, so that sis_i remains uniform when qϕ=pq_\phi= p, by exchangeability.

Imaging inverse problems

Problems We selected three inverse problems introduced in InverseBench (Zheng et al., [48]). They all have the form y=A(θ)+εy = \mathcal{A}(\theta) + \varepsilon, where yy are measurements, A\mathcal{A} is a forward model, θ\theta is the signal we seek to reconstruct and ε\varepsilon additive noise.

  • Navier–Stokes (NS). θ\theta is the initial vorticity of a 2D incompressible flow on (0,2π)2(0, 2\pi)^2 with periodic boundary conditions (128 × 128 pixels, Reynolds number 200, forcing f(x)=−4cos⁡(4x2)f(x) = -4\cos(4x_2)), obtained by evolving a draw from N(0,(−Δ+9I)−4)\mathcal{N}(0, (-\Delta+ 9I)^{-4}) for five time units. The forward operator is A=P∘L\mathcal{A} = P \circ L, where the solution operator LL, computed with a black-box pseudo-spectral solver, maps θ\theta to the vorticity at time T=1T = 1 and is nonlinear. The subsampling operator PP keeps one grid point out of two in each direction, giving 64 × 64 noise-free observations.

  • Linear inverse scattering (IS). θ\theta is a 128 × 128 permittivity contrast map of HL60 cell nuclei, generated with the simulator of Wiesner et al. [43]. Under the first Born approximation, A=A\mathcal{A} = A is linear, with 20 transmitters and 360 receivers on a circle of radius 1.6 m, and noise level σy=10−4\sigma_y = 10^{-4}, resampled at every training batch.

  • Compressed sensing MRI (MRI). θ\theta is a complex 320 × 320 knee image from fastMRI (Zbontar et al., [46]), a coil-combined minimum-variance unbiased estimate (Jalal et al., [22]), stored as two real

Table 1: SBI benchmark results for NPE, CalNPE (λ=100\lambda= 100, Falkiewicz et al. [13]) and TARP-CvM (Ours, λ=30\lambda= 30, M=16M = 16), all trained with the same protocol, for simulation budgets n∈{210,213,216}n \in\{2^{10}, 2^{13}, 2^{16}\}. Mean ±\pm standard deviation over five independently trained estimators per cell. Bold marks the best mean when it is significantly better than both other methods. HPD and TARP errors are the L1L^{1} coverage errors under each credible-region map, E[log⁡qϕ]\mathbb{E}[\log q_{\phi}] is the expected log posterior density of the true parameters, MMD zz the zz-score of an MMD test on the pairs (θ,b(y))(\theta, b(y)), and ∣Mira−2/3∣|\mathrm{Mira} - 2/3| the deviation of the Mira score from its calibrated value.

channels. Since these images have no coil sensitivity maps, we use the single-coil operator A=PF\mathcal{A} = PF, with FF the orthonormal 2D Fourier transform and PP a ×4\times4 subsampling mask that keeps 80 of the 320 vertical k-space lines (25 central lines and 55 random outer lines, redrawn for every example). The measurements are noise-free.

We did not select the Black hole imaging problem because no training set of images is publicly available, and we did not select Full waveform inversion, because it did not fit the shared setup of conditioning architecture with fixed image-shape. Our method is nonetheless applicable to these problems as well.

Noise-free measurements On MRI and NS, measurements are noise-free, so the posterior is supported on the set {θ:A(θ)=y}\{\theta: \mathcal{A}(\theta) = y\} and has no density on Rdθ\mathbb{R}^{d_{\theta}}, which Assumption 1 requires. For the linear MRI operator, writing θ=A+y+z\theta= A^{+}y + z with z=(I−A+A)θz = (I - A^{+}A)\theta, the range component A+yA^{+}y is fixed by the measurement, and the posterior is a distribution over the null-space component zz, which has a density on the null space of AA. Restricted to this subspace, the null-space distance d(θ,θ′)=∥(I−A+A)(θ−θ′)∥d(\theta,\theta') = \lVert(I-A^{+}A)(\theta-\theta')\rVert is a norm, so Theorem 1 applies to the posterior of zz given yy, with Θ\Theta replaced by the null space. This is why TARP-CvM uses this distance on MRI. On NS, the solution set of the nonlinear operator has no such linear parametrization, and Theorem 1 does not strictly apply. There, the experiment tests the loss beyond its assumptions, and the Mira score, which requires no density, still measures coverage. On IS, the measurement noise gives the posterior a density, as Assumption 1 requires.

Diffusion models Diffusion models ([39] (Ho et al. 2020)) map the target distribution p(x)p(x) to white Gaussian noise by progressively perturbing the data xx through a diffusion process. Following Song et al. [41], we express the continuous diffusion process as a stochastic differential equation (SDE):

dxt=f(xt,t)dt+g(t)dwt\mathrm{d}x_t = f(x_t,t)\mathrm{d}t + g(t)\mathrm{d}w_t

where xt∈RNx_t \in\mathbb{R}^{N} is the perturbed data at time tt, f(xt,t)∈RNf(x_t,t) \in\mathbb{R}^{N} is the drift coefficient, g(t)∈R+g(t) \in\mathbb{R}_{+} is the diffusion coefficient, and wt∈RNw_t \in\mathbb{R}^{N} is a standard Wiener process. This SDE admits a reverse process, mapping noise to the target distribution:

dxt=[f(xt,t)−1+η22g(t)2∇xtlog⁡pt(xt)]dt+ηg(t)dwˉt\mathrm{d}x_t = \left[f(x_t,t) - \frac{1+\eta^2}{2}g(t)^2\nabla_{x_t}\log p_t(x_t)\right]\mathrm{d}t + \eta g(t)\mathrm{d}\bar{w}_t

where wˉ\bar{w} is a standard Wiener process when time flows backward. Among the different kinds of diffusion processes, we used the Variance Exploding schedule, which parametrizes the noising kernel xt∼N(αtx,σt2IN)x_t \sim\mathcal{N}(\alpha_t x,\sigma_t^2 I_N), with αt=1\alpha_t = 1, log⁡σt=(1−t)log⁡σmin⁡+tlog⁡σmax⁡\log\sigma_t = (1-t)\log\sigma_{\min} + t\log\sigma_{\max}, with σmin⁡=10−3\sigma_{\min}=10^{-3} and σmax⁡=102\sigma_{\max}=10^2. We also adopt the preconditioning strategy of Karras et al. [23], which parametrizes a denoising network dϕd_\phi instead of the score function.

Our target distribution is the conditional distribution of x=θ∣yx = \theta\mid y, where yy are measurements and θ\theta is the signal we aim to recover. The measurement yy enters as a fixed image, concatenated channel-wise to the noisy input of the network. For both MRI and IS, we compute the adjoint solution to transform measurement into images A⊤yA^\top y. NS observations are already 64×6464 \times64 images, the resolution of the signal after 2×22 \times2 patching, so they are concatenated to the patched input without resampling. NS has no linear adjoint, so the switch rules use the nearest-neighbor upsampled observation as the point estimate b(y)b(y). We describe all our choices for the network architectures and training strategies in Table 2. All fine-tuning runs share the calibration batch (16 pairs per step on NS, 8 otherwise), the sampler depth (T=20T = 20), the optimizer, the number of steps, and the sampler chains that carry gradients (Mgrad=2M_{\mathrm{grad}} = 2 per pair on NS and MRI, 8 on inverse scattering). λ\lambda is tuned once on Navier–Stokes and reused for IS and MRI (λ=10\lambda= 10 for TARP-CvM and λ=0.003\lambda= 0.003 for ES and pCRPS).

Navier–StokesInverse scatteringMRI
Data
Signal xx shape(128, 128, 1)(128, 128, 1)(320, 320, 2)
Conditioningyy, (64, 64, 1)ATyA^{\mathsf{T}}y, (128, 128, 1)[ATy, mask][A^{\mathsf{T}}y,\ \mathrm{mask}], (320, 320, 3)
Train / validation images19,456 / 1,0248,500 / 1,50022,964 / 2,048
Architecture
ArchitectureU-NetU-NetU-Net
Patch size224
Input shape(64, 64, 5)(64, 64, 8)(80, 80, 80)
Residual blocks per level(2, 2, 2, 2)(2, 2, 2, 2)(3, 3, 3, 3, 3)
Channels per level(64, 128, 256, 256)(64, 128, 256, 256)(128, 256, 384, 512, 512)
Kernel size333
ActivationSiLUSiLUSiLU
NormalizationLayerNormLayerNormLayerNorm
Noise embedding256256256
Dropout0.10.10.1
Parameters16.9 M16.9 M106.9 M
Diffusion
Noise scheduleVE, σ∈[10−3,102]\sigma\in[10^{-3}, 10^{2}], EDM preconditioning
Training time distributiont∼Beta⁡(3,3)t \sim\operatorname{Beta}(3, 3)
SamplerDDIM (η=0\eta= 0), 20 steps
Pretraining (DSM)
OptimizerAdamAdamAdam
Weight decay0.00.00.0
Learning rate10−410^{-4}10−410^{-4}10−410^{-4}
Gradient norm clipping1.01.01.0
EMA decay0.9990.9990.999
Augmentationnonenoneh-flip, roll ±4\pm4 px
Batch size256512256
Epochs (2 passes each)560580204
Optimizer steps85,12018,56036,312
Early-stopping patience101020
Fine-tuning
OptimizerAdamWAdamWAdamW
Weight decay0.00.00.0
Learning rate2×10−52 \times10^{-5}2×10−52 \times10^{-5}2×10−52 \times10^{-5}
Gradient norm clipping1.01.01.0
EMA decay0.9990.9990.999
DSM batch size646464
Optimizer steps24,00024,00024,000
Calibration weight λ\lambda, ES and pCRPS0.0030.0030.003
Calibration weight λ\lambda, TARP-CvM101010
Calibration batch NN1688
Posterior samples MM (grad. + value)2 + 328 + 162 + 16
References RR (mixed)1286464
Temperature τ\taucosine, 0.1 →\to 0.01×\times median pairwise posterior distance
TARP distancepixel, 2×\times avg-pooledpixelnull space of AA
Seeds333

Table 2. Architecture and training of the conditional diffusion posteriors. Fine-tuning starts from the converged networks from pretraining. All four fine-tuning objectives share every setting except the calibration weight λ\lambda.

On one NVIDIA GH200, a fine-tuning step takes 1.9 s with TARP-CvM against 0.7 s with the energy score or pCRPS on NS, 1.0 s against 0.7 s on IS, and 3.7 s against 2.6 s on MRI, a 1.4 to 2.7×2.7\times increase in training time with respect to the ES and pCRPS, and an 18 to 33×33\times increase with respect to DSM alone. Figure 7 shows example observations and target ground truth signals for the three inverse problems.

Figure 7. Examples of observations and target ground truth signals for the three inverse problems.

The fastMRI data are used under the NYU fastMRI Dataset Sharing Agreement. All other code we use is available under open-source licenses (Apache 2.0, BSD 3-Clause or MIT), and the remaining datasets are publicly available.

References

  1. [1]Adam, A., Coogan, A., Malkin, N., Legin, R., Perreault-Levasseur, L., Hezaveh, Y., and Bengio, Y. (2022). Posterior samples of source galaxies in strong gravitational lenses with score-based priors. arXiv preprint arXiv:2211.03812.arxiv.org/abs/2211.03812
  2. [2]Albergo, M., Boffi, N. M., and Vanden-Eijnden, E. (2025). Stochastic interpolants: A unifying framework for flows and diffusions. Journal of Machine Learning Research, 26(209):1–80.
  3. [3]Angelopoulos, A. N. and Bates, S. (2023). Conformal prediction: A gentle introduction. Foundations and Trends in Machine Learning, 16(4):494–591.
  4. [4]Blondel, M., Teboul, O., Berthet, Q., and Djolonga, J. (2020). Fast differentiable sorting and ranking. In International conference on machine learning, pages 950–959. PMLR.arxiv.org/abs/2002.08871
  5. [5]Box, G. E. and Tiao, G. C. (1973). Bayesian inference in statistical analysis, volume 80. Addison-Wesley Reading, MA.
  6. [6]Chung, H., Kim, J., McCann, M. T., Klasky, M. L., and Ye, J. C. (2022). Diffusion posterior sampling for general noisy inverse problems. ICLR 2023; arXiv preprint arXiv:2209.14687.arxiv.org/abs/2209.14687
  7. [7]Cramér, H. (1928). On the composition of elementary errors. Scandinavian Actuarial Journal, 1928(1):13–74.
  8. [8]Cramér, H. and Wold, H. (1936). Some theorems on distribution functions. Journal of the London Mathematical Society, 1(4):290–294.
  9. [9]Deistler, M., Goncalves, P. J., and Macke, J. H. (2022). Truncated proposals for scalable and hassle-free simulation-based inference. Advances in Neural Information Processing Systems, 35:23135–23149.arxiv.org/abs/2210.04815
  10. [10]Delaunoy, A., Hermans, J., Rozet, F., Wehenkel, A., and Louppe, G. (2022). Towards reliable simulation-based inference with balanced neural ratio estimation. Advances in Neural Information Processing Systems, 35:20025–20037.arxiv.org/abs/2208.13624
  11. [11]Dey, B., Zhao, D., Andrews, B. H., Newman, J. A., Izbicki, R., and Lee, A. B. (2025). Towards instance-wise calibration: local amortized diagnostics and reshaping of conditional densities (ladar). Machine Learning: Science and Technology, 6(4):045058.arxiv.org/abs/2205.14568
  12. [12]Durkan, C., Bekasov, A., Murray, I., and Papamakarios, G. (2019). Neural spline flows. Advances in Neural Information Processing Systems, 32.arxiv.org/abs/1906.04032
  13. [13]Falkiewicz, M., Takeishi, N., Shekhzadeh, I., Wehenkel, A., Delaunoy, A., Louppe, G., and Kalousis, A. (2023). Calibrating neural simulation-based inference with differentiable coverage probability. In Oh, A., Naumann, T., Globerson, A., Saenko, K., Hardt, M., and Levine, S., editors, Advances in Neural Information Processing Systems, volume 36, pages 1082–1099. Curran Associates, Inc.
  14. [14]Gneiting, T. and Raftery, A. E. (2007). Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102(477):359–378.
  15. [15]Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. Advances in Neural Information Processing Systems, 27.
  16. [16]Greenberg, D., Nonnenmacher, M., and Macke, J. (2019). Automatic posterior transformation for likelihood-free inference. In Chaudhuri, K. and Salakhutdinov, R., editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 2404–2414. PMLR.arxiv.org/abs/1905.07488
  17. [17]Hermans, J., Delaunoy, A., Rozet, F., Wehenkel, A., Begy, V., and Louppe, G. (2022). A crisis in simulation-based inference? beware, your posterior approximations can be unfaithful. Transactions on Machine Learning Research.
  18. [19]Hoeffding, W. (1948). A Class of Statistics with Asymptotically Normal Distribution. The Annals of Mathematical Statistics, 19(3):293 – 325.
  19. [20]Horowitz, J. L. (2014). Ill-posed inverse problems in economics. Annu. Rev. Econ., 6(1):21–51.
  20. [21]Hyndman, R. J. (1996). Computing and graphing highest density regions. The American Statistician, 50(2):120–126.DOI
  21. [22]Jalal, A., Arvinte, M., Daras, G., Price, E., Dimakis, A., and Tamir, J. (2021). Robust compressed sensing MRI with deep generative priors. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W., editors, Advances in Neural Information Processing Systems.arxiv.org/abs/2108.01368
  22. [23]Karras, T., Aittala, M., Aila, T., and Laine, S. (2022). Elucidating the design space of diffusion-based generative models. Advances in Neural Information Processing Systems, 35:25655–25677.arxiv.org/abs/2206.00364
  23. [24]Kingma, D. P. and Welling, M. (2013). Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114.arxiv.org/abs/1312.6114
  24. [25]Kuleshov, V., Fenner, N., and Ermon, S. (2018). Accurate uncertainties for deep learning using calibrated regression. In Dy, J. and Krause, A., editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 2796–2804. PMLR.arxiv.org/abs/1807.00263
  25. [26]Lemos, P., Coogan, A., Hezaveh, Y., and Perreault-Levasseur, L. (2023). Sampling-based accuracy testing of posterior estimators for general inference. In International Conference on Machine Learning, pages 19256–19273. PMLR.arxiv.org/abs/2302.03026
  26. [27]Lipman, Y., Chen, R. T., Ben-Hamu, H., Nickel, M., and Le, M. (2022). Flow matching for generative modeling. ICLR 2023; arXiv preprint arXiv:2210.02747.arxiv.org/abs/2210.02747
  27. [28]Liu, T., Spincemaille, P., De Rochefort, L., Kressler, B., and Wang, Y. (2009). Calculation of susceptibility through multiple orientation sampling (cosmos): a method for conditioning the inverse problem from measured magnetic field map to susceptibility source image in mri. Magnetic Resonance in Medicine: An Official Journal of the International Society for Magnetic Resonance in Medicine, 61(1):196–204.DOI
  28. [29]Lueckmann, J.-M., Gonçalves, P. J., Bassetto, G., Öcal, K., Nonnenmacher, M., and Macke, J. H. (2017). Flexible statistical inference for mechanistic models of neural dynamics. Advances in Neural Information Processing Systems, 30.arxiv.org/abs/1711.01861
  29. [30]Melia, O., Tsang, O., Charisopoulos, V., Khoo, Y., Hoskins, J., and Willett, R. (2025). Multi-frequency progressive refinement for learned inverse scattering. Journal of Computational Physics, 527:113809.DOI
  30. [31]Metz, L., Poole, B., Pfau, D., and Sohl-Dickstein, J. (2016). Unrolled generative adversarial networks. ICLR 2017; arXiv preprint arXiv:1611.02163.arxiv.org/abs/1611.02163
  31. [32]Mises, R. v. (1947). On the asymptotic distribution of differentiable statistical functions. The annals of mathematical statistics, 18(3):309–348.DOI
  32. [33]Naeini, M. P., Cooper, G., and Hauskrecht, M. (2015). Obtaining well calibrated probabilities using Bayesian binning. In Proceedings of the AAAI conference on artificial intelligence, volume 29.pubmed.ncbi.nlm.nih.gov/25927013
  33. [34]Papamakarios, G. and Murray, I. (2016). Fast ε-free inference of simulation models with Bayesian conditional density estimation. Advances in Neural Information Processing Systems, 29.arxiv.org/abs/1605.06376
  34. [35]Papamakarios, G., Nalisnick, E., Rezende, D. J., Mohamed, S., and Lakshminarayanan, B. (2021). Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64.
  35. [36]Remy, B., Lanusse, F., Jeffrey, N., Liu, J., Starck, J.-L., Osato, K., and Schrabback, T. (2023). Probabilistic mass-mapping with neural score estimation. Astronomy & Astrophysics, 672:A51.
  36. [37]Rezende, D. and Mohamed, S. (2015). Variational inference with normalizing flows. In Bach, F. and Blei, D., editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 1530–1538, Lille, France. PMLR.arxiv.org/abs/1505.05770
  37. [38]Sharief, S. N., Zeghal, J., Barco, G. M., Lemos, P., Hezaveh, Y., and Perreault-Levasseur, L. (2026). MIRA: A score for conditional distribution accuracy and model comparison. In Forty-third International Conference on Machine Learning.arxiv.org/abs/2605.02014
  38. [39]Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. (2015). Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pages 2256–2265. pmlr.
  39. [40]Song, J., Meng, C., and Ermon, S. (2021a). Denoising diffusion implicit models. In International Conference on Learning Representations.arxiv.org/abs/2010.02502
  40. [41]Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. (2021b). Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations.
  41. [42]Tejero-Cantero, A., Boelts, J., Deistler, M., Lueckmann, J.-M., Durkan, C., Gonçalves, P. J., Greenberg, D. S., and Macke, J. H. (2020). sbi: A toolkit for simulation-based inference. Journal of Open Source Software, 5(52):2505.
  42. [43]Wiesner, D., Svoboda, D., Maška, M., and Kozubek, M. (2019). Cytopacq: a web-interface for simulating multi-dimensional cell imaging. Bioinformatics, 35(21):4531–4533.DOI
  43. [44]Yao, J., Hsu, Z.-S., Deng, X., Gupta, A., Ju, X., Benson, S. M., Wen, G., and Anandkumar, A. (2026). Posteriorbench: From point estimates to posterior matching in evaluating generative inverse solvers. arXiv preprint arXiv:2609.20794.arxiv.org/abs/2609.20794
  44. [45]Yao, Y., Régaldo-Saint Blancard, B., and Domke, J. (2024). Simulation-based stacking. In international conference on artificial intelligence and statistics, pages 4267–4275. PMLR.arxiv.org/abs/2310.17009
  45. [46]Zbontar, J., Knoll, F., Sriram, A., Murrell, T., Huang, Z., Muckley, M. J., Defazio, A., Stern, R., Johnson, P., Bruno, M., et al. (2018). fastmri: An open dataset and benchmarks for accelerated mri. arXiv preprint arXiv:1811.08839.arxiv.org/abs/1811.08839
  46. [47]Zhao, D., Dalmasso, N., Izbicki, R., and Lee, A. B. (2021). Diagnostics for conditional density models and Bayesian inference algorithms. In *Uncertainty in Artificial Intelligence*, pages 1830–1840. PMLR.arxiv.org/abs/2102.10473
  47. [48]Zheng, H., Chu, W., Zhang, B., Wu, Z., Wang, A., Feng, B., Zou, C., Sun, Y., Kovachki, N. B., Ross, Z. E., Bouman, K., and Yue, Y. (2025). Inversebench: Benchmarking plug-and-play diffusion models for scientific inverse problems. In *The Thirteenth International Conference on Learning Representations*.DOI

Paper details

vlnc:W_u8bq2u3c
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 5

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents