sbi reloaded: a toolkit for simulation-based inference workflows

Jan Boelts, Michael Deistler, Manuel Gloeckler, Álvaro Tejero-Cantero, Jan-Matthis Lueckmann, Guy Moss, Peter Steinbach, Thomas Moreau, Fabio Muratore, Julia Linhart, Conor Durkan, Julius Vetter, Benjamin Kurt Miller, Maternus Herold, Abolfazl Ziaeemehr, Matthijs Pals, Theo Gruner, Sebastian Bischoff, Nastya Krouglova, Richard Gao, Janne K. Lappalainen, Bálint Mucsányi, Felix Pei, Auguste Schulz, Zinovia Stefanidi, Pedro Rodrigues, Cornelius Schröder, Faried Abu Zaid, Jonas Beck, Jaivardhan Kapoor, David S. Greenberg, Pedro J. Gonçalves, Jakob H. Macke

TL;DR

The paper introduces the "reloaded" version of sbi, a comprehensive, PyTorch-based Python toolkit for simulation-based Bayesian inference (SBI). It enables parameter estimation for complex, black-box simulators where traditional likelihood-based methods fail, offering a highly flexible, community-driven ecosystem equipped with state-of-the-art neural architectures, samplers, and diagnostic tools.

What Problem Does This Paper Address?

Scientists and engineers across disciplines rely on stochastic, complex simulators to model real-world phenomena, from neural circuits to cosmological structures. However, performing Bayesian inference—identifying the simulator parameters that best explain empirical observations—is notoriously difficult.

Traditional inference methods like Markov Chain Monte Carlo (MCMC) or Variational Inference (VI) require explicit evaluation of a likelihood function or rely on simulator gradients. Unfortunately, real-world simulators are often non-differentiable, computationally slow, or possess intractable likelihoods (meaning we can generate samples but cannot mathematically evaluate their probability).

Simulation-based inference (SBI) bypasses these hurdles by using neural networks to learn the relationship between simulator parameters and outputs. The sbi toolkit addresses the practical challenge of making these advanced machine learning methods accessible, customizable, and robust for domain scientists and ML researchers alike.

Methods

The sbi package provides a unified, modular interface for three primary classes of neural SBI algorithms:

  • Neural Posterior Estimation (NPE): Directly targets the posterior distribution.
  • Neural Likelihood Estimation (NLE): Estimates the likelihood wrapper, which can then be sampled.
  • Neural Ratio Estimation (NRE): Approximates the likelihood-to-evidence ratio.

These methods can be run in amortized mode (training a neural network once on a large batch of simulations so it can instantly evaluate any new observation) or sequential mode (using active learning to focus simulations around a specific observation).

Figure 1: Features of the sbi package. Components that were added since the initial release described in Tejero- Cantero et al. [5] are marked in red.

As shown in Figure 1, the reloaded toolkit significantly expands upon its initial release by integrating:

  • Advanced Generative Models: Support for flow matching, diffusion models, and advanced normalizing flows (via Zuko and nflows).
  • Flexible Architectures: Preconfigured and customizable embedding networks (MLPs, CNNs, and permutation-invariant networks) to automatically extract summary statistics from high-dimensional data.
  • Enhanced Sampling: Vectorized MCMC chains across data, variational inference, rejection sampling, and wrappers for popular probabilistic programming libraries like Pyro and PyMC.
  • Rigorous Diagnostics: Tools like Simulation-Based Calibration (SBC), Expected Coverage, Local C2ST, and TARP to validate whether the neural network's approximations are statistically faithful.

Datasets

Not discussed in the paper. As a software architecture and toolkit paper, it does not introduce new benchmark datasets.

Key Insights and Ideas

  • Amortization is a Game-Changer: By front-loading the computational cost to train a neural network on a large set of simulations, researchers can perform near-instantaneous inference on new empirical data without retraining.
  • True Black-Box Flexibility: The toolkit completely decouples the simulator from the inference loop. It can ingest pre-simulated offline data, handle failed simulations or missing values gracefully, and does not require the simulator to be written in Python.
  • Trust, but Verify: Because neural network approximations can occasionally be unfaithful, the inclusion of robust diagnostic tools (like TARP and SBC) transitions SBI from a black-box guessing game into a verifiable statistical workflow.
  • Ecosystem Consolidation: The development team notes that other specialized packages (such as Lampe) have stopped independent development to merge their features into sbi, signaling a healthy consolidation toward a community standard library.

Key Results

While this software announcement paper does not present a quantitative benchmark table, it highlights the widespread real-world adoption of the toolkit. The sbi package has successfully fostered applications across diverse scientific fields, including computational neuroscience (e.g., modeling single-neuron multiplication and neural circuit mechanisms), astrophysics (galaxy clustering), economics (agent-based models), and evolutionary biology.

Limitations and Future Work

The authors focus primarily on the toolkit's capabilities rather than its limitations. However, inherent challenges of neural SBI remain: generating the initial training data can be computationally expensive, and high-dimensional observation spaces still require careful design of embedding networks.

The authors frame sbi as an evolving, open-architecture project. Future work centers on community-driven development to continuously integrate emerging generative machine learning techniques and expand diagnostic workflows.

Summary updated

BibTeX
@article{boelts2025sbi,
  author = {Jan Boelts and Michael Deistler and Manuel Gloeckler and Álvaro Tejero-Cantero and Jan-Matthis Lueckmann and Guy Moss and Peter Steinbach and Thomas Moreau and Fabio Muratore and Julia Linhart and Conor Durkan and Julius Vetter and Benjamin Kurt Miller and Maternus Herold and Abolfazl Ziaeemehr and Matthijs Pals and Theo Gruner and Sebastian Bischoff and Nastya Krouglova and Richard Gao and Janne K. Lappalainen and Bálint Mucsányi and Felix Pei and Auguste Schulz and Zinovia Stefanidi and Pedro Rodrigues and Cornelius Schröder and Faried Abu Zaid and Jonas Beck and Jaivardhan Kapoor and David S. Greenberg and Pedro J. Gonçalves and Jakob H. Macke},
  title = {{sbi reloaded: a toolkit for simulation-based inference workflows}},
  journal = {J. Open Source Softw.},
  year = {2025},
  url = {https://openreview.net/forum?id=JoMOoTNuor},
}
Figure