Robust Amortized Simulation-Based Inference via Learned Error Models

Matthew O'Callaghan, Kaisey Mandel, Gerard GilmoreNeurIPS 2026

TL;DR

Scientists use neural networks to reverse-engineer physical parameters from complex simulations, a powerful technique that unfortunately falls apart when real-world data doesn't quite match the idealized simulator. This paper introduces RVNP, a method that uses unlabeled real-world observations to explicitly learn a "reality-gap" error model alongside the inference network. Instead of warping the physical meaning of your parameters to force a fit, RVNP isolates the simulator's blind spots, giving you fast, trustworthy, and well-calibrated uncertainty estimates.

What Problem Does This Paper Address?

Across science—from modeling epidemics to analyzing starlight—we rely on stochastic simulators to mimic nature. Because we usually can't write down a neat mathematical equation for the likelihood of a simulator's output, we use Simulation-Based Inference (SBI): we generate thousands of simulated parameter-data pairs $(\boldsymbol{\theta}, \boldsymbol{x})$ and train a neural network to invert the process, predicting underlying parameters $\boldsymbol{\theta}$ from observed data $\boldsymbol{x}_{\text{obs}}$. Better yet, we can make this amortized—train the network once, and infer parameters for thousands of new observations in a single forward pass.

Here is the catch: all models are wrong. Whether it’s unaccounted-for sensor noise or simplified physics, real data rarely comes from the exact distribution of your simulator. Under this model misspecification (the "simulation-to-reality gap"), standard neural SBI methods become dangerously overconfident, concentrating tightly around the wrong answers.

Existing fixes force an unpleasant choice. You can use explicit error models with Markov Chain Monte Carlo (MCMC), which is interpretable but ruins amortization (requiring slow, per-observation sampling). Alternatively, you can use domain adaptation to mash simulated and real data distributions together in a shared feature space—keeping things fast, at the risk of quietly corrupting the physical meaning of $\boldsymbol{\theta}$. How do we get fast, amortized inference and preserve parameter interpretability without requiring labeled real-world calibration data?

Methods

The authors propose Robust Variational Neural Posterior Estimation (RVNP), which bridges the simulation-to-reality gap by treating real-world data $\boldsymbol{x}_{\text{obs}}$ as a corrupted version of idealized simulator outputs $\boldsymbol{x}$, governed by a learnable error model $p_{\boldsymbol{\alpha}}(\boldsymbol{x}_{\text{obs}} \mid \boldsymbol{x}, \boldsymbol{\theta})$.

Figure 1: RVNP training and inference workflow. A simulator likelihood and posterior are pretrained on simulated pairs. The error model and posterior are then fitted jointly using unlabeled observations, followed by posterior fine-tuning with the learned correction fixed.

RVNP operates in three stages:

  1. Pretrain on Simulations (Standard): Using purely simulated pairs, they train a surrogate likelihood network $p_{\boldsymbol{\Psi}}(\boldsymbol{x} \mid \boldsymbol{\theta})$ via Neural Likelihood Estimation, and warm-start a normalizing flow posterior $q_{\boldsymbol{\phi}}(\boldsymbol{\theta} \mid \boldsymbol{x})$ via standard Neural Posterior Estimation (NPE).
  2. Joint Variational Fit (Novel): Freezing the simulator surrogate, they bring in a set of unlabeled real observations. They use an Importance-Weighted Autoencoder (IWAE) objective (specifically, a stabilized variant called PIWAE) to jointly optimize the posterior $q_{\boldsymbol{\phi}}$ (acting as the encoder) and the error model $p_{\boldsymbol{\alpha}}$ (acting as part of the decoder). Maximizing the marginal likelihood of the real data here is mathematically equivalent to minimizing the KL divergence between reality and the error-adjusted simulator. The authors test two Gaussian error families: a Global covariance matrix (RVNP-G) and a Local, $\boldsymbol{\theta}$-dependent covariance network (RVNP-L).
  3. Fine-Tuning: Freezing the newly learned error model, they run a final NPE pass on simulated outputs corrupted by this learned error model to sharpen the amortized posterior.

Datasets

Each task uses 100,000 simulated pairs, 10,000 unlabeled "real" observations for training/validation, and 1,000 unseen observations for testing across four misspecified benchmarks:

  • CS (Cancer-Stromal): A 2D spatial cell model (4 summary statistics). Misspecification: Removing cells in tumor cores to mimic unmodeled necrosis.
  • SIR (Epidemic): Disease spread trajectories (6 summary statistics). Misspecification: Simulating weekend reporting delays (5% drop) reassigned to Mondays.
  • Pendulum: Noisy 200-step time series compressed via a pretrained neural embedding. Misspecification: Real observations have 20% Gaussian noise instead of the simulator's assumed 5%.
  • Spectrum: 250-dimensional synthetic stellar spectra using a Galactic prior. Misspecification: Evaluating on a metal-poor stellar stream, creating a prior misspecification shift rather than a broken forward model.

Key Insights and Ideas

  • Model the gap, don't erase it: Domain adaptation methods try to close the reality gap by forcing summary statistics to look identical, which can distort what $\boldsymbol{\theta}$ actually means. RVNP models the gap explicitly in data space, letting the error model absorb non-simulator variation while keeping $\boldsymbol{\theta}$ physically grounded.
  • Multiple observations unlock unsupervised calibration: A single weird observation tells you very little about systematic simulator error. Having a dataset of unlabeled observations—the natural setting for amortized SBI—gives an empirical distribution rich enough to fit an explicit error model without ground-truth labels or manual regularization trade-offs.
  • Diagnostic superpowers: Because the error model is explicit (like a covariance matrix), you can inspect its principal directions to see which features of your simulator are failing to match reality.
Learned error covariance directions across benchmarks

Key Results

RVNP variants are the only tested methods that remain consistently well-calibrated while preserving high accuracy at the true parameters across all four tasks.

  • Calibration (Average Expected Posterior Coverage, ideal = 0): Standard NPE and domain-adaptation baselines (NPE-MMD, NPE-SC) are severely overconfident across the board, scoring between -0.24 and -0.49. RVNP stays right near ideal calibration: on CS, RVNP-L hits -0.00; on Spectrum, RVNP-L/G score 0.01 / 0.02; on SIR, RVNP-L scores 0.05 (vs. -0.45 for NPE and -0.48 for NPE-MMD).
  • Accuracy (Log Posterior Density, higher is better): RVNP achieves the highest log density at the ground-truth parameters on every single benchmark—for example, scoring 1.33 (RVNP-L) on SIR compared to -6.03 for NPE and -34.57 for NPE-MMD, and 3.83 (RVNP-G) on Pendulum vs. 0.46 for NPE.
  • Flexibility: Pre-specified noise methods (NNPE) work when their guessed noise matches reality (0.00 AEPC on CS), but collapse when the corruption structure differs (-0.49 AEPC on Spectrum). RVNP adapts automatically, remaining stable whenever more than ~100 unlabeled observations are available.

Limitations and Future Work

  • Training overhead & upstream reliance: RVNP requires a three-stage training pipeline, making training slower than standard NPE (though inference remains instant). Furthermore, because the error model bridges the gap between the surrogate likelihood and reality, any sloppiness in the surrogate gets absorbed into the error model—though ablations showed surprising resilience here.
  • Slightly conservative when well-specified: If your simulator is actually perfect, shrinking a learned covariance matrix all the way to zero is tough, leaving RVNP slightly underconfident.
  • No free lunch on inductive bias: Without labeled real data, you must choose an error-model family (here, zero-mean Gaussians). If the true corruption shifts the mean or violates your error family's assumptions in ways that mimic $\boldsymbol{\theta}$, bias can remain. Future work will explore richer, physics-informed, sparse, or mean-offset error models, as well as hybrid setups incorporating tiny labeled calibration sets.

Summary updated

Abstract

Recent advances in neural density estimation have enabled amortized Bayesian inference for complex stochastic simulators. However, these methods rely on simulators accurately reflecting the true data-generating process and can degrade significantly under model misspecification. We consider the setting where multiple unlabeled observations are available and introduce robust variational neural posterior estimation (RVNP), an amortized Bayesian inference method that uses an importance-weighted autoencoder to jointly learn a misspecification-robust posterior proxy and an explicit error model that captures the simulation-to-reality gap. Our results show that RVNP can recover robust posterior inference in a data-driven and interpretable manner, outperforming previous methods on multiple metrics across misspecified benchmarks.
BibTeX
@inproceedings{ocallaghan2026robust,
  author = {Matthew O'Callaghan and Kaisey Mandel and Gerard Gilmore},
  title = {{Robust Amortized Simulation-Based Inference via Learned Error Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ZGDfWRoYTN},
}
Figure