Simulation-based Inference with the Generalized Kullback-Leibler Divergence

Benjamin Kurt Miller, Marco Federici, Christoph Weniger, Patrick Forré · DOI

Introduction

Simulation-based inference (SBI) is a critical tool for scientific domains where the likelihood of observed data $x$ given parameters $\theta$ is implicitly defined by complex simulators rather than explicit mathematical formulas. Traditionally, SBI has been divided into two primary methodologies: Neural Posterior Estimation (NPE), which fits normalized densities like Normalizing Flows, and Neural Ratio Estimation (NRE), which learns the ratio between the posterior and the prior. While NPE offers easy sampling, it can struggle with complex, multi-modal distributions. Conversely, NRE is flexible but lacks a direct variational interpretation and can suffer from training instabilities.

Unifying SBI with the Generalized KL Divergence

This research introduces a unified framework for SBI based on the Generalized Kullback-Leibler (GKL) divergence. Unlike the standard KL divergence, GKL does not require the surrogate model $q(\theta|x)$ to be normalized. By incorporating a term that accounts for the partition function during optimization, GKL allows for the use of unnormalized models, such as energy-based models.

This framework effectively bridges the gap between NPE and NRE. Under the GKL objective, standard NPE is recovered when using a normalized surrogate, while a specific version of NRE can be derived directly from GKL principles.

The Hybrid Surrogate Model

The most significant contribution of this work is the Hybrid Surrogate. This model decomposes the posterior approximation into two components:

  1. Base Distribution ($b_v$): A simple, normalized distribution (e.g., a Gaussian or a small flow) that captures the general location of the posterior.
  2. Ratio Surrogate ($\exp \rho_w$): A flexible, unnormalized energy-based model that refines the base distribution.
The hybrid surrogate model combines a base distribution with a learned ratio to capture complex posterior shapes.

This architecture enables an "eraser" effect: the ratio can suppress probability mass in regions where the base distribution overestimates the posterior (e.g., bridging gaps between modes in the "Two Moons" task). Furthermore, because the base distribution is already close to the target, sampling from the unnormalized hybrid model via rejection sampling remains highly efficient, avoiding the need for expensive MCMC chains.

Experimental Results

The authors evaluated the GKL-based models using the standard SBI Benchmark across eight diverse tasks, including Bernoulli GLM, Gaussian Mixture, and the highly non-convex Two Moons task.

Benchmark results comparing the hybrid model against standard flow-based and ratio-based SBI methods.

The results demonstrate that the "Hybrid Big" model consistently outperforms or matches the performance of pure flow-based (NPE) and ratio-based (NRE) methods. The hybrid approach proved particularly robust and accurate in tasks with complex posterior geometries, achieving lower Classifier Two-Sample Test (C2ST) scores—where a score of 0.5 indicates a perfect match to the ground truth.

Conclusion

By leveraging the Generalized KL divergence, this work provides a rigorous mathematical foundation that unifies disparate SBI techniques. The resulting hybrid models combine the sampling efficiency of normalized flows with the representational flexibility of energy-based ratios, setting a new state-of-the-art for simulation-based inference across a wide range of scientific applications. Future work will look to scale these methods to higher-dimensional parameter spaces and adapt them for sequential inference settings.

Summary updated

BibTeX
@inproceedings{miller2023simulation,
  author = {Benjamin Kurt Miller and Marco Federici and Christoph Weniger and Patrick Forré},
  title = {{Simulation-based Inference with the Generalized Kullback-Leibler Divergence}},
  booktitle = {SynS and ML @ ICML},
  year = {2023},
  url = {https://openreview.net/forum?id=tPb1Fe58ro},
}
Figure