Generalized Bayesian Inference for Scientific Simulators via Amortized Cost Estimation

Richard Gao, Michael Deistler, Jakob H. Macke

Introduction

Mechanistic simulators are indispensable tools in scientific fields such as neuroscience, geophysics, and epidemiology, allowing researchers to model complex phenomena through underlying physical or biological principles. However, connecting these simulators to empirical data—a process known as Simulation-Based Inference (SBI)—remains a significant challenge. Standard SBI methods typically assume that the simulator is a well-specified model of reality. In practice, scientific models are often simplified or "wrong," leading to poor performance when the simulator cannot perfectly replicate observed data.

The Problem: Misspecification and Computational Cost

Traditional Bayesian inference targets the exact likelihood of the data. When a model is misspecified, the likelihood-based posterior can become nonsensical or overconfident, as it attempts to reconcile data that the model is physically incapable of producing.

Generalized Bayesian Inference (GBI) offers a robust alternative by replacing the likelihood with a cost function based on the distance between simulated and observed data. While GBI provides the necessary robustness, it typically requires thousands of simulations for every new observation, making it computationally prohibitive for expensive scientific simulators.

Methodology: Amortized Cost Estimation (ACE)

To address these limitations, Gao et al. (2023) introduce Amortized Cost Estimation (ACE). ACE bridges the gap between the robustness of GBI and the efficiency of amortized neural inference.

The Core Framework

The central idea of ACE is to train a regression neural network, $f_\phi(\theta, x_t)$, to predict the expected distance (or cost) between simulator outputs and observed data for any given parameter set $\theta$. By learning this mapping, the network effectively acts as a surrogate for the simulator's cost function.

Efficient Training

A key innovation in ACE is its training efficiency. The authors demonstrate that the network does not require multiple simulations per parameter set to learn the expected distance. Because neural network regression naturally converges to the conditional expectation of the target labels, training the network on the distance between a single simulation and a target observation is sufficient. This allows the model to be trained over a broad distribution of possible observations.

Inference and Flexibility

Once the network is trained, inference on a new observation $x_o$ is performed using Markov Chain Monte Carlo (MCMC) sampling. Crucially, this process does not require any additional simulations from the mechanistic model. ACE is also highly flexible, supporting various distance measures such as Mean Squared Error (MSE), Maximum Mean Discrepancy (MMD), or Energy Scores. Furthermore, it allows researchers to adjust the inverse temperature hyperparameter $\beta$ at inference time, controlling the trade-off between fitting the data and adhering to the prior.

Experimental Evaluation

The authors evaluated ACE across synthetic benchmarks and real-world biological applications.

Synthetic Benchmarks

ACE was tested on four classic SBI tasks—Uniform 1D, 2 Moons, 10D Linear Gaussian, and a Gaussian Mixture—modified to include misspecified observations. In these scenarios, ACE consistently outperformed standard methods like Neural Posterior Estimation (NPE), which struggled to produce meaningful results when the data fell outside the simulator's reach.

Neuroscience Application: The Hodgkin-Huxley Model

The framework was applied to the Hodgkin-Huxley (HH) model, a fundamental simulator for neuronal activity. When tested against experimental data from the Allen Cell Types Database, ACE demonstrated remarkable biological validity. While standard NPE often failed to produce any spikes because it attempted to match unreachable voltage traces, ACE identified parameters that captured the essential spiking behavior of the neurons.

Key Results and Insights

  • Robustness: By targeting distance rather than likelihood, ACE remains stable under model misspecification, finding parameters that get as close as possible to the data.
  • Efficiency: In the HH neuron task, ACE achieved superior results with 100,000 simulations compared to NPE using 1,000,000 simulations—an order-of-magnitude improvement in efficiency.
  • Denoising: The neural network serves as a "denoiser" for stochastic simulators, learning the underlying parameter-to-distance mapping and generalizing effectively across the parameter space.

Limitations and Future Directions

While ACE significantly advances robust SBI, it has limitations. The reliance on MCMC for inference is slower than the "instant" inference provided by some normalizing flow-based methods. Additionally, selecting the optimal distance metric and $\beta$ value remains a subjective task for the researcher. Future work may explore scaling ACE to higher-dimensional parameter spaces and integrating more complex embedding architectures.

Conclusion

Amortized Cost Estimation (ACE) provides a practical and efficient framework for performing robust inference on complex scientific simulators. By amortizing the cost of GBI, it enables researchers to handle model misspecification without the prohibitive computational overhead of traditional methods, paving the way for more reliable scientific discovery.

Summary updated

BibTeX
@inproceedings{gao2023generalized,
  author = {Richard Gao and Michael Deistler and Jakob H. Macke},
  title = {{Generalized Bayesian Inference for Scientific Simulators via Amortized Cost Estimation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=ZARAiV25CW},
}
Figure