Skip to main content
QUICK REVIEW

[Paper Review] BayesFlow: Learning complex stochastic models with invertible neural networks

Stefan T. Radev, Ulf K. Mertens|arXiv (Cornell University)|Mar 13, 2020
Gaussian Processes and Bayesian InferenceComputer Science10 citations
TL;DR

BayesFlow proposes a global amortized Bayesian inference method using invertible neural networks to learn the posterior distribution over model parameters from simulated data, enabling fast, scalable, and accurate parameter estimation without explicit likelihoods. The method combines a learnable summary network with normalizing flows to map data to parameters, achieving state-of-the-art performance on intractable models in ecology, epidemiology, and cognitive science.

ABSTRACT

Estimating the parameters of mathematical models is a common problem in almost all branches of science. However, this problem can prove notably difficult when processes and model descriptions become increasingly complex and an explicit likelihood function is not available. With this work, we propose a novel method for globally amortized Bayesian inference based on invertible neural networks which we call BayesFlow. The method uses simulation to learn a global estimator for the probabilistic mapping from observed data to underlying model parameters. A neural network pre-trained in this way can then, without additional training or optimization, infer full posteriors on arbitrary many real datasets involving the same model family. In addition, our method incorporates a summary network trained to embed the observed data into maximally informative summary statistics. Learning summary statistics from data makes the method applicable to modeling scenarios where standard inference techniques with hand-crafted summary statistics fail. We demonstrate the utility of BayesFlow on challenging intractable models from population dynamics, epidemiology, cognitive science and ecology. We argue that BayesFlow provides a general framework for building amortized Bayesian parameter estimation machines for any forward model from which data can be simulated.

Motivation & Objective

  • To address the challenge of Bayesian parameter estimation in models where the likelihood function is intractable or unavailable.
  • To develop a global amortized inference framework that bypasses case-by-case MCMC or ABC sampling for each dataset.
  • To learn informative, data-driven summary statistics through a neural network, improving performance over hand-crafted statistics.
  • To enable efficient, scalable, and GPU-accelerated inference across multiple datasets using a single pre-trained model.
  • To provide a general-purpose framework applicable to diverse scientific domains with complex forward models.

Proposed method

  • Employs invertible neural networks (normalizing flows) to learn the joint posterior distribution p(θ|x) from simulated data pairs (x, θ).
  • Introduces a learnable summary network that embeds high-dimensional data x into low-dimensional, informative summary statistics s(x), preserving relevant information for inference.
  • Trains the entire BayesFlow architecture end-to-end using a variational inference objective that maximizes the likelihood of observed data under the learned posterior.
  • Uses a normalizing flow-based inference network to model the posterior p(θ|x) as a transformation of a prior p(z), with z ~ N(0, I), enabling exact density estimation and sampling.
  • Leverages the invertibility of the neural networks to perform both posterior estimation and likelihood-free simulation, enabling bidirectional modeling.
  • Employs a differentiable simulation pipeline to backpropagate gradients through the forward model g(θ, ξ), allowing joint optimization of the summary and inference networks.

Experimental results

Research questions

  • RQ1Can invertible neural networks enable global amortized Bayesian inference in likelihood-free settings where standard ABC methods fail?
  • RQ2Can a learnable summary network outperform hand-crafted statistics in complex, high-dimensional data scenarios?
  • RQ3To what extent can BayesFlow generalize across multiple datasets from the same model family without retraining?
  • RQ4How well does BayesFlow perform on real-world intractable models from population dynamics, epidemiology, and cognitive science?
  • RQ5What is the impact of network architecture depth and design on posterior calibration and inference accuracy?

Key findings

  • BayesFlow achieves accurate posterior estimation on complex, intractable models from population dynamics, epidemiology, cognitive science, and ecology, outperforming standard ABC and neural density estimation baselines.
  • The method enables global amortized inference: once trained, it can infer full posteriors on any new dataset from the same model family without additional training or optimization.
  • Learned summary statistics significantly improve inference performance compared to hand-crafted statistics, especially in high-dimensional or complex data regimes.
  • The approach is highly parallelizable and benefits from GPU acceleration, making inference orders of magnitude faster than traditional case-based methods.
  • The method provides calibrated posterior estimates when properly trained, with theoretical guarantees under perfect convergence.
  • Empirical validation shows that default hyperparameters and moderate network depth (5–10 coupling layers) yield strong performance across diverse models, even with relatively simple architectures.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.