Neural Simulation-Based Inference - Overview

Summary

Simulation-based inference (SBI) is statistical inference for models that exist only as a simulator: a program you can run forward to draw but whose likelihood is an intractable integral over every latent execution path. Cranmer, Brehmer & Louppe (2020) argue the term “likelihood-free” is “a bit of a misnomer” because most modern methods estimate the missing likelihood (or a function of it). Neural SBI replaces the accept/reject comparison of ABC and the Gaussian of synthetic likelihood with a trained neural surrogate for one of three objects: the posterior (NPE), the likelihood ( SNL), or the likelihood ratio (NRE). The payoffs are sample efficiency, freedom from hand-crafted summary statistics and tolerances, and amortization.

Overview

The vault already covers the classical toolbox for intractable-likelihood models: ABC, synthetic likelihood, and the frequentist simulation-based estimation family (SMM, Indirect Inference, EMM). The Bayesian Workflow note Simulation-Based and Amortized Inference names neural density estimators in two paragraphs. This cluster is the dedicated treatment of that modern branch.

Cranmer et al. define a simulator as a program that takes parameters , samples latent variables , and emits data (Sec. 1.A). The defining obstruction is their Eq. (2):

For an agent-based model is every random draw made by every agent at every tick, so the integral is hopeless. Both Bayesian inference (the posterior of their Eq. 1) and frequentist inference (likelihood-ratio tests) are blocked at the same place.

They diagnose three shortcomings of the traditional methods (Sec. 1.C-2):

  1. Sample efficiency. ABC and classical (histogram / kernel) density estimation suffer the curse of dimensionality: “in the worst case, the required number of simulations increases exponentially with the dimension of the data .”
  2. Quality of inference. Reducing data to low-dimensional summaries “invariably discards some of the information in the data about ”; a large ABC tolerance or KDE bandwidth degrades it further.
  3. Amortization. ABC for a new dataset “requires repeating most steps of the inference chain.”

and three forces moving the frontier (Sec. 2): (A) the machine-learning revolution, above all neural density estimation with normalizing flows; (B) active learning, running the simulator where it is most informative; (C) integration and augmentation, opening the black box via probabilistic programming and automatic differentiation.

Main Content

Simulation-based inference problem ^def-sbi

Given a prior , a simulator from which one can sample but not evaluate , and an observation , approximate the posterior

Such models are called implicit models, in contrast to prescribed models whose likelihood can be written down (Cranmer et al., p. 1). Black-box SBI assumes neither differentiability of the simulator nor access to its internal random numbers (Lueckmann et al. 2021, Sec. 1).

Surrogate (emulator) based inference ^def-surrogate

Methods that “construct a surrogate model and use that for inference”, as opposed to methods that, like ABC, “use the simulator itself during inference” (Sec. 3). Simulator output becomes training data for a learning stage; the trained surrogate is then queried instead of the simulator. This is what makes the expensive stage reusable, i.e. amortized.

The three neural targets

Cranmer et al. (Sec. 3.B, Fig. 3e-g) organize the neural methods by which conditional object the network learns from simulated pairs :

FamilyNetwork learnsLearning problemPosterior samples viaNote
NPEconditional density estimationdirect sampling from Neural Posterior Estimation (NPE)
NLEconditional density estimationMCMC or VI on Neural Likelihood Estimation and Sequential Neural Likelihood
NREbinary / multi-class classificationMCMC on Neural Ratio Estimation

Trade-offs among the three targets (Cranmer et al., Sec. 3.B, p. 7) ^thm-tradeoffs

  • Posterior. “Learning the posterior directly provides the main target quantity in Bayesian inference, but induces a prior dependence at every stage of the inference method.”
  • Likelihood / ratio. These enable “frequentist inference or model comparisons, though for Bayesian inference an additional MCMC or VI step is necessary.” Prior independence gives “extra flexibility to change the prior during inference.”
  • Generative vs discriminative. Likelihood and posterior surrogates can be sampled; but “learning the likelihood or posterior is an unsupervised learning problem, whereas estimating the likelihood ratio through a classifier is an example of supervised learning and often a simpler task.”
  • All three are amortized, all “require an upfront specification of the parameters of interest” with the network implicitly marginalizing over the latents , and all can adopt an iteratively updated proposal (active learning).

How the neural methods sit relative to the classical ones

  • ABC never forms the likelihood; it is “implicitly replaced by rejection probability”, which is why it “does not lend itself to frequentist inference” (Sec. 3). It needs summaries , a distance , and a tolerance , and is exact only as .
  • Classical density-estimation likelihoods (histograms, KDE, and the Gaussian of synthetic likelihood) are already amortized, which is why they powered the Higgs discovery, but they cannot go beyond a handful of summary dimensions. NLE “is structurally identical to the classical density estimation-based approach, but uses more powerful density estimation techniques.”
  • Moment-matching estimators (Method of Simulated Moments, Indirect Inference) give point estimates with asymptotic standard errors and also depend on the analyst’s choice of moments or auxiliary model. Neural SBI targets the full posterior and can learn its own summaries through an embedding network.

Beyond the black box

If the simulator exposes more than samples, Cranmer et al. (Sec. 2.C) list six extractable quantities, including the joint score and the joint likelihood ratio . These are tractable even though their marginal counterparts are not, and they can “augment” training data to turn surrogate fitting into a much more sample-efficient supervised problem. The marginal score is itself a locally sufficient summary statistic (Sec. 3.C). Probabilistic programming with inference compilation (Fig. 3d) goes further and infers the latent trace too. The same gradient-through-an-implicit-model ideas appear in experimental design in Likelihood-Free ACE and Gradient Estimation.

Practitioner recommendations (Cranmer et al., Sec. 3.D, p. 8) ^ex-recommendations

  1. If any of the augmented quantities (scores, joint ratios, differentiability, a probabilistic-programming interface) is available, use it.
  2. If powerful low-dimensional summaries already exist, traditional techniques remain reasonable.
  3. Otherwise “we recommend trying methods based on training a neural network surrogate for the likelihood or the likelihood ratio”; prefer the ratio when you do not need to sample synthetic data from the surrogate.
  4. Active learning helps every method, but “there is a tradeoff between active learning, which tailors the efficiency to a particular observed data set, and amortization.” See Amortized vs Sequential Inference.

Relevance to marketing measurement and applied work

Three situations in the vault owner’s practice are SBI problems in disguise. (1) Agent-based market simulators: consumer-adoption or media-exposure ABMs of the kind surveyed in ABM in Marketing Strategy have no likelihood, and calibration has so far meant history matching plus ABC or SMM; NPE/NRE give a full posterior with 10-1000x fewer simulator runs (see Neural SBI for Agent-Based and Economic Models). (2) Amortized refits: a media mix model that is refit weekly for many brands or geos is the “many datasets, one model” regime where an amortized posterior network replaces repeated HMC runs, a complement to Variational Inference and Pathfinder. (3) Design of geo experiments: expected-information-gain estimators for implicit models (Implicit Likelihood Estimator) are NLE/NRE under another name. In every case the uncomfortable truth from Cranmer et al. stands: none of the diagnostics address misspecification, and an ABM that is a poor description of the market yields a confident, well-calibrated posterior about the wrong model.

Examples

One training set, three surrogates. Take a toy simulator , , , and simulate pairs once. The same table trains:

# pseudo-code in the style of the `sbi` toolbox used by Lueckmann et al. (2021)
theta = prior.sample((5000,))
x     = simulator(theta)
 
npe = NPE(prior).append_simulations(theta, x).train()   # flow over theta given x
nle = NLE(prior).append_simulations(theta, x).train()   # flow over x given theta
nre = NRE(prior).append_simulations(theta, x).train()   # classifier on (theta, x)
 
post_npe = npe.build_posterior().sample((10_000,), x=x_o)               # direct, no MCMC
post_nle = nle.build_posterior(sample_with="mcmc").sample((10_000,), x=x_o)
post_nre = nre.build_posterior(sample_with="mcmc").sample((10_000,), x=x_o)

For the true posterior is bimodal at . NPE must represent a bimodal density over directly, so it needs a flexible flow or mixture. NLE only has to learn a unimodal Gaussian-like and lets MCMC discover the two modes, which is the “simple likelihood, complex posterior” argument made for SNL. Rejection ABC on the same budget keeps only the few hundred draws with and throws the rest away, whereas the neural methods “use all of them for training” (Papamakarios & Murray 2016, Sec. 3).

Connections

See Also