Variational Inference with Coverage Guarantees

Yash P. Patel, Declan McNamara, Jackson Loper, Jeffrey Regier, Ambuj Tewari · DOI

Introduction

In modern scientific disciplines ranging from astrophysics to epidemiology, researchers frequently rely on Simulation-Based Inference (SBI) to estimate unknown parameters from complex data. While simulators (forward models) can generate realistic data, they often lack an explicit likelihood function, making traditional Bayesian methods computationally prohibitive.

To address this, Amortized Variational Inference (VI) has become a popular solution. By training neural networks to approximate posterior distributions, VI allows for near-instantaneous inference on new observations. However, VI suffers from a critical flaw: it is often "overconfident," producing narrow uncertainty regions that fail to contain the true parameters at the expected frequency. This lack of marginal coverage—the guarantee that a 95% confidence interval actually contains the truth 95% of the time—renders these fast methods unreliable for high-stakes scientific discovery.

The CANVI Framework

To bridge the gap between speed and reliability, researchers have introduced CANVI (Conformalized Amortized Neural Variational Inference). CANVI acts as a rigorous statistical wrapper around existing VI methods, leveraging the principles of Conformal Prediction to provide formal coverage guarantees.

The CANVI pipeline: starting from a prior and forward model, variational posteriors are generated and then calibrated using conformal scores to produce a guaranteed prediction set.

Methodology

The CANVI process involves four primary stages:

  1. Candidate Selection: The user starts with a set of candidate posterior approximators, which may be trained using different objectives (e.g., ELBO or FAVI).
  2. Conformal Scoring: Using a small "calibration dataset" of simulated parameter-observation pairs, CANVI calculates a score for each pair based on the model's predicted density.
  3. Quantile Calibration: A threshold (quantile) is determined such that a specific percentage of the calibration data falls within it. This threshold is then used to adjust future prediction regions, ensuring they meet the target coverage level regardless of the underlying model's initial bias.
  4. Predictive Efficiency: Since multiple models can be calibrated to provide the same coverage, CANVI introduces a novel "mixed sampler" algorithm to estimate the volume of these regions. It then selects the most "efficient" model—the one that provides the tightest, most informative bounds while still maintaining the mathematical guarantee.

Experimental Evaluation

The authors evaluated CANVI across a diverse suite of benchmarks, including ecology models (Lotka-Volterra), epidemiological simulations (Spatial SIR), and high-dimensional astrophysical tasks (Galaxy Spectral Energy Distributions).

Calibration plots across various benchmarks. The x-axis represents the desired credibility level, and the y-axis shows the actual expected coverage. CANVI (rightmost column) consistently follows the diagonal red dotted line, indicating perfect calibration.

Key Results

  • Guaranteed Reliability: As shown in the calibration plots, vanilla VI methods often deviate significantly from the ideal diagonal, indicating over- or under-confidence. In contrast, CANVI consistently achieves perfect marginal coverage across all tasks.
  • Scientific Scalability: In complex tasks like the 11-dimensional galaxy spectra simulation (PROVABGS), CANVI successfully identified the most efficient training objective, providing scientists with tight, trustworthy bounds on physical properties.
  • Computational Speed: The calibration step is highly efficient, typically requiring only a few thousand samples from the simulator. This overhead is negligible compared to the initial training time of the neural networks, making it a practical addition to any SBI workflow.

Discussion and Future Work

While CANVI provides robust marginal coverage (average performance across all data), it does not strictly guarantee conditional coverage (performance for a specific, individual observation). However, empirical results suggest it performs exceptionally well in practice.

Future research aims to extend these guarantees to scenarios involving model misspecification, where the simulator does not perfectly match reality. By incorporating distribution-shift techniques from the conformal prediction literature, the authors hope to make CANVI even more resilient for real-world applications where simulators are inherently imperfect approximations of nature.

Summary updated

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