NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Variational Autoencoders for Efficient Simulation-Based Inference

Mayank Nautiyal, Andrey Shternshis, Andreas Hellander, Prashant SingharXiv 2024 · DOI

Abstract

Simulation-Based Inference (SBI) is essential for scientific modeling where likelihood functions are computationally intractable. While Normalizing Flows and Diffusion models offer powerful solutions, they are often constrained by architectural requirements or high computational costs. This work proposes using Conditional Variational Autoencoders (C-VAEs) as an efficient alternative. We introduce two variants: CP-VAE, which utilizes a data-conditioned latent prior, and UP-VAE, which employs a standard unconditional prior. Our results on the sbibm benchmark demonstrate that VAE-based models can capture complex, multimodal posterior distributions with training times orders of magnitude faster than adversarial or diffusion-based methods, offering a practical "Goldilocks" solution for rapid scientific iteration.

Introduction

In many scientific fields—from epidemiology to cosmology—complex stochastic simulators are used to model real-world phenomena. The goal of Simulation-Based Inference (SBI) is to work backward: given observed data, identify the simulator parameters that likely produced it.

The primary challenge is that the "likelihood function" for these simulators is often computationally intractable. Traditional methods like Markov Chain Monte Carlo (MCMC) are too slow, while modern deep learning approaches like Normalizing Flows or Diffusion models come with significant trade-offs. Flows require specific invertible architectures that limit flexibility, and diffusion models are notoriously slow to train and sample from. This research seeks a middle ground: a method that is fast, flexible, and robust.

Methods: Conditional VAEs for SBI

The authors propose using Conditional Variational Autoencoders (C-VAEs) for amortized inference. Unlike other generative models, VAEs are easy to train and do not require the neural network to be invertible, allowing researchers to utilize any architecture, such as CNNs or Transformers.

The paper introduces two specific variants:

  1. CP-VAE (Conditional Prior): The latent variable prior is conditioned on the observed data, allowing the model to adapt its internal representation to specific queries.
  2. UP-VAE (Unconditional Prior): This uses a standard Gaussian prior. While simpler, it is often more robust because it avoids overfitting the prior to noisy training data.
The CP-VAE architecture conditions the latent prior on the observed data y to improve generalization.

Both models use the "reparameterization trick" to remain end-to-end differentiable and optimize a modified version of the Evidence Lower Bound (ELBO) specifically derived for the SBI setting.

Experimental Evaluation

The models were evaluated using the sbibm benchmark suite, which includes tasks testing multimodal shapes (Two Moons), complex dependencies (SLCP), and real-world scientific models like the SIR epidemic model and Lotka-Volterra predator-prey dynamics.

Key Results and Efficiency

  • Training Speed: VAEs demonstrated a massive speedup. For the Two Moons task, CP-VAE trained in roughly 2-5 minutes, whereas adversarial methods like GATSBI required over 2 hours.
  • Accuracy and Robustness: On metrics like C2ST (Classifier Two-Sample Test), the VAE models were highly competitive. As shown in Figure 4, they successfully captured complex, bimodal, and non-Gaussian posterior shapes that simpler methods often miss.
Comparison of CP-VAE and UP-VAE on the Two Moons task, showing both models accurately capturing the bimodal posterior distribution.
  • The Noise Trade-off: A key finding was that the simpler UP-VAE often outperforms the CP-VAE when observed data is very noisy. The conditional prior in CP-VAE can become "distracted" by input noise, whereas the unconditional prior remains stable.

Conclusion and Future Work

While VAEs are significantly faster than diffusion-based models, they can sometimes suffer from oversimplification due to Gaussian assumptions in their latent space. However, their training stability and efficiency make them an ideal choice for heavy workflows requiring rapid model exploration.

Future research directions include integrating Convolutional Neural Networks (CNNs) for spatial data and combining VAEs with Normalizing Flows—using flows within the VAE framework—to allow for even more flexible posterior approximations without sacrificing stability.

Summary updated

BibTeX
@misc{nautiyal2024variational,
  author = {Mayank Nautiyal and Andrey Shternshis and Andreas Hellander and Prashant Singh},
  title = {{Variational Autoencoders for Efficient Simulation-Based Inference}},
  year = {2024},
  eprint = {2411.14511},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.14511},
}
Figure