Abstract
Neural posterior estimation (NPE), a simulation-based computational approach for Bayesian inference, has shown great success in approximating complex posterior distributions. Existing NPE methods typically rely on normalizing flows, which approximate a distribution by composing many simple, invertible transformations. But flow-based models, while state of the art for NPE, are known to suffer from several limitations, including training instability and sharp trade-offs between representational power and computational cost. In this work, we demonstrate the effectiveness of conditional diffusions coupled with high-capacity summary networks for amortized NPE. Conditional diffusions address many of the challenges faced by flow-based methods. Our results show that, across a highly varied suite of benchmarking problems for NPE architectures, diffusions offer improved stability, superior accuracy, and faster training times, even with simpler, shallower models. Building on prior work on diffusions for NPE, we show that these gains persist across a variety of different summary network architectures.
Introduction
In many scientific domains, from epidemiology to cosmology, Bayesian inference is hindered by the lack of an explicit likelihood function. Instead, researchers often have access to complex simulators that can generate synthetic data given a set of parameters. Simulation-Based Inference (SBI) aims to estimate the posterior distribution $p(\theta | X)$ using these simulations. Neural Posterior Estimation (NPE) has emerged as a powerful SBI technique, training generative neural networks to learn the mapping from data to posterior distributions.
For years, Normalizing Flows (NF) have been the dominant architecture for NPE. NFs transform a simple base distribution (e.g., a Gaussian) into a complex target distribution through a sequence of invertible transformations. Despite their success, NFs face significant challenges: they can be unstable during training, require deep and computationally expensive architectures to capture complex features, and may scale poorly with data dimensionality. This paper introduces cDiff, a framework that leverages conditional diffusion models to overcome these limitations.
Methodology: The cDiff Framework
The proposed cDiff framework is designed for amortized inference, meaning the model can instantly provide a posterior estimate for any new dataset after a single training phase. The architecture consists of two primary components: a summary network and a diffusion-based decoder.
Summary Networks and Amortization
To handle datasets of varying sizes and structures, a summary network $s_\psi$ is employed to compress the input data $X$ into a fixed-size context vector. The authors utilize diverse architectures tailored to the data type: DeepSets for exchangeable (IID) data and LSTMs for sequential time-series data. This context vector then conditions the generative process.
Diffusion-Based Posterior Decoding
Unlike the rigid transformations of NFs, diffusion models learn to reverse a stochastic noise process. Starting from pure Gaussian noise, the model iteratively "denoises" the sample, guided by the context vector from the summary network, to produce a sample from the posterior distribution.
A significant theoretical contribution of this work is the proof that joint training of the summary network and the diffusion decoder using a mean-prediction loss provides a valid variational upper bound on the KL divergence. This justifies the use of end-to-end training for amortized diffusion-based NPE.
Experimental Results
The researchers evaluated cDiff against conditional Normalizing Flows (cNF) across 13 benchmark problems, including simple "no-encoder" tasks, IID statistical models, and complex sequential models like Lotka-Volterra.
Accuracy and Multimodality
cDiff consistently outperformed cNF in terms of accuracy, measured by Wasserstein distance to the ground truth. This is particularly evident in multimodal distributions where NFs often struggle to capture all modes or the correct density between them.
Handling Sharp Boundaries
One of the most notable advantages of diffusion models is their ability to represent distributions with sharp boundaries or discontinuities. In the "Witch's Hat" benchmark, which features a very narrow peak on a flat background, cDiff captured the sharp transitions almost perfectly, whereas cNF produced blurred or inaccurate estimates.
Efficiency and Stability
Beyond accuracy, cDiff demonstrated superior training characteristics. On average, diffusion models trained 35% faster than their flow-based counterparts. Furthermore, while NFs often required deep architectures (up to 32 layers) and were prone to divergence during training, cDiff remained stable even with shallower models. This stability is crucial for reliable scientific inference where "hidden" failures in posterior estimation can lead to incorrect conclusions.
Conclusion
The introduction of conditional diffusions for amortized NPE represents a significant step forward in simulation-based inference. By replacing the rigid transformations of normalizing flows with the flexible denoising process of diffusions, the cDiff framework offers improved accuracy, faster training, and greater stability across a wide range of problems. While diffusion models are slightly slower during the sampling phase, their ability to handle complex, high-dimensional, and sharply bounded distributions makes them a compelling new standard for neural posterior estimation.
Summary updated