Variational Inference with Coverage Guarantees in Simulation-Based Inference

Yash Patel, Declan McNamara, Jackson Loper, Jeffrey Regier, Ambuj Tewari

In fields ranging from astrophysics to epidemiology, researchers increasingly rely on Simulation-Based Inference (SBI). When dealing with complex simulators—such as models of galaxy formation—where no explicit formula for the likelihood of data exists, scientists train neural networks to "learn" the posterior distribution.

Amortized Variational Inference (VI) is a popular choice for this task because of its speed; once trained, it can evaluate new observations in milliseconds. However, VI suffers from a notorious "honesty" problem: it is frequently overconfident. A model might produce a 95% credible interval that, in reality, only contains the true parameters 50% of the time. For high-stakes scientific discovery, this lack of calibration is a dealbreaker. Researchers need a way to ensure that their "95% confidence" actually means 95%.

To address this, researchers have introduced CANVI (Conformalized Amortized Neural Variational Inference), a framework that bridges the gap between fast neural approximations and rigorous statistical guarantees.

The CANVI Framework

CANVI acts as a mathematically rigorous "wrapper" for variational inference. It ensures that predicted uncertainty regions contain the true parameters with a user-specified probability, combining the speed of modern deep learning with the reliability of classical frequentist guarantees.

The CANVI pipeline: From prior and forward models to variational posteriors, conformal scores, and the final guaranteed prediction set.

The methodology relies on several key components:

  1. Conformal Wrapping: CANVI uses a small "calibration" dataset of simulated parameter-observation pairs. It calculates a "score" for these pairs based on the approximate posterior density. By analyzing the distribution of these scores, CANVI finds a precise threshold that guarantees marginal coverage. This means that across many future observations, the predicted regions will contain the truth at the requested rate (e.g., 95%).
  2. Approximator Selection: Not all neural posteriors are created equal. CANVI can take a collection of candidate models—trained with different objectives or at different training stages—and automatically select the most "efficient" one.
  3. Predictive Efficiency: Efficiency is defined as the inverse volume of the prediction region. A "good" model isn't just one that is calibrated (which CANVI guarantees for any model), but one that provides the smallest possible region while remaining calibrated.
  4. Mixed Sampling (VolumeEst): To compare candidate models, the authors developed a novel importance-sampling-based volume estimator. This allows them to accurately measure how "tight" a high-dimensional uncertainty region is, even when the distribution is complex or multimodal.

Experimental Validation and Key Results

The authors evaluated CANVI across a suite of standard SBI benchmark tasks, including Lotka-Volterra (population dynamics), Two Moons (a multimodal distribution), and SLCP (Simple Likelihood Complex Posterior). They also applied it to a high-dimensional (11D) scientific task: analyzing Galaxy Spectral Energy Distributions (SED) using the PROVABGS simulator.

Calibration curves across various benchmark datasets. Notice how CANVI (far right) perfectly aligns with the expected y=x diagonal, unlike standard uncalibrated methods.

The results highlight the critical advantage of the CANVI approach:

  • Perfect Calibration: Across all benchmark tasks, CANVI produced calibration curves that sat perfectly on the $y=x$ diagonal. In contrast, standard neural posteriors frequently underestimated uncertainty.
  • Speed: The calibration step is incredibly efficient, typically completing in under one second for the benchmark tasks.
  • Scientific Utility: In the 11D galaxy spectra task, CANVI successfully produced uncertainty regions with guaranteed coverage, correcting traditional VI methods that failed to contain the true galaxy parameters.

Key Insights

A striking insight from the paper is that calibration is "free," but efficiency is earned. Conformalization can make any model calibrated. However, if the underlying model is poor, the resulting "guaranteed" region might be uselessly large. CANVI’s true power lies in its ability to pick the model that yields the most informative (smallest) valid regions.

Furthermore, the training objective matters significantly. Models trained with the Forward-Amortized Variational Inference (FAVI) objective were found to be significantly more efficient than those trained with the standard Evidence Lower Bound (ELBO). ELBO-based models were often so under-dispersed that the conformal "fix" required expanding the regions to near-infinite size to meet the coverage guarantee. Ultimately, CANVI is agnostic to the neural network architecture; as long as you can sample from your simulator, you can apply this wrapper.

Limitations and Future Work

While powerful, CANVI has limitations. It guarantees marginal coverage (correct 95% of the time on average) rather than strict conditional coverage (correct 95% of the time for a specific, difficult observation), though it performs well empirically. Additionally, like all SBI methods, CANVI assumes the simulator is a faithful representation of nature. If there is a "sim-to-real" gap, the guarantees may not hold, making conformal prediction under distribution shift a vital next step. Finally, scaling these guarantees to hundreds or thousands of parameters remains an open frontier for future research.

Summary updated

BibTeX
@inproceedings{patel2024variational,
  author = {Yash Patel and Declan McNamara and Jackson Loper and Jeffrey Regier and Ambuj Tewari},
  title = {{Variational Inference with Coverage Guarantees in Simulation-Based Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=Wn4QwCrDvH},
}
Figure