Balancing Simulation-based Inference for Conservative Posteriors

Arnaud Delaunoy, Benjamin Kurt Miller, Patrick Forré, Christoph Weniger, Gilles Louppe

TL;DR

Simulation-based inference (SBI) algorithms frequently produce overconfident posterior approximations that can lead scientists to erroneously rule out true parameter values. This paper shows that the "balancing" regularization technique—previously restricted to binary Neural Ratio Estimation (NRE)—can be interpreted as a $\chi^2$-divergence minimization and generalized to any SBI model capable of evaluating posterior density, including Neural Posterior Estimation (BNPE) and Contrastive Neural Ratio Estimation (BNRE-C).

What Problem Does This Paper Address?

In many scientific domains (such as astrophysics, epidemiology, and particle physics), the likelihood function of a generative model is intractable, but forward simulations are feasible. Simulation-based inference (SBI) trains neural networks on simulated pairs of parameters and observations $(\theta, x)$ to approximate the true posterior $p(\theta \mid x)$.

However, commonly used SBI algorithms frequently yield overconfident posteriors: their estimated credibility intervals are too narrow, excluding plausible true parameters at a given nominal credibility level ($1 - \alpha$). In high-stakes science, overconfidence can lead to false discoveries. Practitioners strongly prefer conservative surrogates—approximations that may be slightly broader (underconfident), but avoid falsely ruling out viable hypotheses.

While balancing was previously introduced as a regularization trick to penalize overconfidence in binary Neural Ratio Estimation (Hermans et al., 2020; Delaunoy et al., 2022), it was unclear how to interpret it theoretically or apply it to density-estimation methods (NPE) or multi-class contrastive ratio methods (NRE-C).

Methods

The authors generalize balancing beyond binary classification by reframing and re-deriving the balance condition:

  • Balancing as $\chi^2$-Divergence: Delaunoy et al. (2022) defined a classifier $\varpi(y=1 \mid \theta, x)$ as balanced if: $$\mathbb{E}_{p(\theta)p(x)}[\varpi(y=1 \mid \theta, x)] + \mathbb{E}_{p(\theta, x)}[\varpi(y=1 \mid \theta, x)] = 1$$ This paper proves that the penalty term $B[\varpi]$ exactly equals the $\chi^2$-divergence $\chi^2(\pi(y) \parallel \varpi(y))$ between the true prior distribution over binary labels $\pi(y)$ and the classifier's marginal label prediction $\varpi(y)$.

  • Generalizing to Density Estimators: For any surrogate model $\hat{q}_w(\theta \mid x)$ capable of evaluating posterior densities (such as a normalizing flow), the likelihood-to-evidence ratio is implicitly approximated by $r(\theta, x) \approx \hat{q}_w(\theta \mid x) / p(\theta)$. The authors define an implied classifier: $$\varpi(y=1 \mid \theta, x; \hat{q}_w) := \frac{\hat{q}_w(\theta \mid x)/p(\theta)}{1 + \hat{q}_w(\theta \mid x)/p(\theta)}$$ and penalize the base loss $\mathcal{L}(w)$ with the balancing constraint: $$\mathcal{L}(w) + \lambda B(w)$$ where $\lambda = 100$. This formulation creates Balanced Neural Posterior Estimation (BNPE) and Balanced Contrastive NRE (BNRE-C).

  • Flow Initialization (BNPE Init): Unlike ratio estimators—which naturally integrate the ground-truth prior—normalizing flows must learn the prior density from scratch. The authors show that initializing Neural Spline Flows (NSF) close to the prior distribution (by initializing transforms near identity and explicitly mapping the Gaussian base distribution to the prior domain) significantly reduces balance error and prevents probability mass "leakage."

Datasets

The authors evaluated their methods across five established SBI simulation benchmarks:

  1. SLCP (Simple Likelihood Complex Posterior): 5 parameters (inferring a 2D marginal), 8D Gaussian observations parameterized non-linearly.
  2. Weinberg: High-energy physics simulation ($e^+e^- \to \mu^+\mu^-$ scattering) with 20 angular observables used to infer the Fermi constant $\theta$.
  3. Spatial SIR: Stochastic epidemic model on a $50 \times 50$ grid, inferring infection and recovery rates from snapshot observations.
  4. Lotka-Volterra: Predator-prey population dynamics; inferring predator parameters from 2001-step time series using a Markov Jump Process.
  5. Two Moons: A classic multimodal benchmark with a 2D parameter space producing crescent-shaped observations.

Key Insights and Ideas

  • Balancing pulls predictions toward the prior: By regularizing marginal predictions toward $\pi(y = 1) = 0.5$, balancing forces the likelihood-to-evidence ratio $\hat{r}(\theta, x)$ toward 1. This shrinks the posterior approximation toward the prior $p(\theta)$, which is mathematically guaranteed to be conservative.
  • Divergence hierarchy: Because $\text{KL}(P \parallel Q) \le \chi^2(P \parallel Q)$, minimizing the $\chi^2$-divergence on marginal classification directly upper-bounds and minimizes the marginal KL divergence gap, preventing biased empirical gradient updates that arise from taking logs of integrals.
  • Inductive bias asymmetry: Ratio estimators retain a structural advantage over normalizing flows because they incorporate the true prior $p(\theta)$ as an exact multiplicative factor. Flows struggle at low simulation counts unless explicitly initialized to the prior.

Key Results

  • Consistently Conservative Surrogates: Across SLCP, Weinberg, Spatial SIR, and Lotka-Volterra, empirical expected coverage curves for BNPE and BNRE-C shifted to or above the nominal diagonal (representing valid or conservative coverage) across varying simulation budgets ($10^3$ to $\sim 10^5$ samples), eliminating the severe overconfidence seen in unregularized NPE and NRE-C.
  • Preserved Informativeness: Although balanced posteriors are wider at low simulation counts (lower nominal log posterior), they contract as the simulation budget increases, matching the accuracy and sharpness of standard methods in the large-data limit.
  • Benchmark Anomaly: On the Two Moons benchmark, all algorithms (balanced and unbalanced alike) remained stubbornly overconfident, illustrating that severe multimodality remains an open calibration challenge.

Limitations and Future Work

  • Requires Density Evaluation: The framework requires evaluable posterior densities $\hat{q}_w(\theta \mid x)$. It cannot be directly applied to unnormalized ratio estimators or score-based/diffusion SBI models that only allow sampling. Formulating a sample-only balance condition remains an open problem.
  • Multiclass Balancing Untested: While the authors mathematically derived the multiclass extension of the $\chi^2$ balance condition for NRE-C (Appendix C), experiments used the binary projection $\varpi = \sigma \circ h_w(\theta, x)$. Testing full multiclass balancing is left for future research.

Summary updated

BibTeX
@inproceedings{delaunoy2023balancing,
  author = {Arnaud Delaunoy and Benjamin Kurt Miller and Patrick Forré and Christoph Weniger and Gilles Louppe},
  title = {{Balancing Simulation-based Inference for Conservative Posteriors}},
  booktitle = {AABI},
  year = {2023},
  url = {https://openreview.net/forum?id=KpoXZWuY2B},
}

Loading related content...

Figure