Source-linked AI summary

Sequential Neural Likelihood: Fast Likelihood-free Inference with Autoregressive Flows

George Papamakarios, David C. Sterratt, Iain Murray

arXiv:1805.07226v2stat.MLcs.LG

TL;DR

Simulator-model inference is broadly useful but can require prohibitively many simulations to fit accurate posteriors. SNL learns the likelihood in high-posterior regions through sequentially guided simulations, and experiments show it is accurate, efficient, robust, and broadly applicable with diagnostics for deployment.

  • Problem

    Accurate and efficient inference for simulator models is important, but posterior estimation may require prohibitively many simulations near the observed data.

  • Method

    SNL trains a flexible conditional neural density estimator to learn the likelihood while sequentially updating simulation proposals toward the region of interest.

  • Results

    SNL is accurate, efficient, and robust, outperforming existing neural density-estimation methods in posterior accuracy and simulation cost.

  • Takeaways & Limitations

    SNL can be deployed with limited problem-specific tuning and supported by diagnostics for calibration, convergence, and goodness-of-fit.

  • Takeaways & Limitations

    High-dimensional data remain challenging because SNL relies on estimating the data density, often requiring low-dimensional features or summary statistics.

Abstract

from arXiv · show

We present Sequential Neural Likelihood (SNL), a new method for Bayesian inference in simulator models, where the likelihood is intractable but simulating data from the model is possible. SNL trains an autoregressive flow on simulated data in order to learn a model of the likelihood in the region of high posterior density. A sequential training procedure guides simulations and reduces simulation cost by orders of magnitude. We show that SNL is more robust, more accurate and requires less tuning than related neural-based methods, and we discuss diagnostics for assessing calibration, convergence and goodness-of-fit.

1 Introduction

Simulator models support inference across scientific and engineering domains, but their likelihoods are generally unavailable, making conventional Bayesian methods impractical. SNL addresses this with a sequential autoregressive-flow likelihood estimator that focuses simulations where posterior density is high and reduces simulation cost.

  • Motivation: Simulator models generate data from controllable parameters and support inference tasks across physics, cosmology, biology, econometrics, and computer vision.Their applications include discovering physical theories and inferring scene parameters from images.
  • Motivation: Likelihoods for simulator models are generally computationally infeasible to evaluate, preventing direct use of traditional Bayesian methods such as variational inference and MCMC.Bayesian posteriors require combining the likelihood with prior beliefs and normalizing.
  • Motivation: Likelihood-free methods avoid likelihood evaluation by repeatedly simulating data, but greater accuracy generally requires more simulations and therefore higher computational cost.The burden is especially substantial when simulators are expensive to run.
  • SNL approach: SNL trains a Masked Autoregressive Flow on simulated data to estimate the conditional data density as a model of the likelihood.Its sequential procedure uses the current likelihood estimate to select the next simulation batch.
  • Results: SNL reduces simulation requirements by several orders of magnitude and is reported to be robust, well-calibrated, and more accurate than existing neural density-estimation methods.The paper also discusses diagnostics for convergence and goodness-of-fit.

2 Likelihood-free inference with neural density estimation

Neural density estimation can learn simulator posteriors from parameter–simulation pairs, but it may require many simulations near the observed data. Sequential proposals improve efficiency, while posterior estimation with proposal samples introduces bias and instability concerns.

  • Neural density estimation: A conditional neural density estimator qφ(u | v) learns a conditional density by maximizing the log probability of paired training data.With sufficient data and model flexibility, it approximates the target conditional distribution.
  • Sequential posterior estimation: Global posterior estimators may require many simulations near the observed datapoint to fit the posterior accurately, making simulator execution prohibitively expensive.Training samples are drawn from the prior and simulator before fitting qφ(θ | x).
  • Sequential posterior estimation: SNPE trains over rounds using proposals that approximate the posterior and generate simulations likely to be close to the observed data.This sequential strategy can converge rapidly with relatively few simulations per round.
  • SNPE limitations: SNPE proposal sampling biases posterior approximation because the estimator learns under the proposal distribution rather than the prior.SNPE-A adjusts the learned posterior, whereas SNPE-B reweights training samples.
  • SNPE limitations: SNPE-A can terminate prematurely when proposal adjustment produces a negative variance, while SNPE-B can experience unstable training from high-variance weights.SNPE-B avoids the Gaussian-proposal restriction and negative-variance failure mode of SNPE-A.

3 Sequential Neural Likelihood

SNL learns the simulator likelihood with a conditional neural density estimator and sequentially concentrates simulations in regions of high posterior density. Because it learns likelihood rather than posterior, proposal choice does not asymptotically bias learning when parameter-space support is retained.

  • Likelihood learning: SNL trains a conditional neural density estimator qφ(x | θ) on simulated parameter–data pairs to approximate the simulator likelihood p(x | θ).The proposal distribution affects where the estimator is most accurate with finite data, while sufficient simulations and adequate flexibility recover the likelihood over the proposal’s support.
  • Posterior inference: SNL’s likelihood-based formulation avoids the proposal-induced bias associated with directly learning the posterior, provided the proposal does not exclude parameter-space regions.The method also recommends persistent slice-sampling MCMC with 200 burn-in iterations per round and notes that other schemes may suit higher-dimensional spaces.
  • Sequential procedure: SNL initializes with the prior, samples parameters from the previous approximate posterior, simulates data, retrains on all accumulated simulations, and updates the approximate posterior each round.The proposal in round r effectively averages the approximate posteriors from earlier rounds, while the estimator is retrained on simulations from rounds 1 through r.
  • Sequential procedure: As training data grow, the approximate posterior and proposal tend toward the exact posterior, so later rounds concentrate simulations in high-posterior parameter regions.This concentration is the mechanism by which SNL avoids spending simulations broadly across low-posterior regions.
  • Sequential procedure: Unlike SNPE, SNL trains on all simulations obtained up to each round rather than only simulations from the latest round.
  • Likelihood learning: A conditional Masked Autoregressive Flow models qφ(x | θ) by transforming a standard Gaussian through θ-conditioned autoregressive bijections.The flow is selected as a general-purpose density estimator, and its likelihood is combined with the prior to form an approximate posterior sampled by MCMC.

4 Related work

Related likelihood-free methods either reject simulations, approximate likelihoods with restricted parametric forms, learn posterior models, or learn likelihood ratios. SNL is situated among approaches that guide simulations toward informative parameter regions to reduce cost.

  • Likelihood-free inference: Approximate Bayesian Computation repeatedly simulates and rejects mismatched data, often using lower-dimensional summaries and an acceptance tolerance ϵ.
  • Likelihood-free inference: ABC’s simulation requirement grows dramatically as ϵ becomes small, creating an accuracy–cost trade-off; exact-ϵ variants require differentiable simulators.
  • Learning the posterior: Posterior-learning methods fit parametric models of θ given x, including regression adjustment, Gaussian copulas, variational likelihood-free inference, and SNPE.
  • Learning the likelihood: Synthetic Likelihood estimates simulated-data means and covariances at each parameter and approximates the likelihood with a Gaussian distribution.Other likelihood approximations include linear-Gaussian models and mixtures of Gaussian copulas with expert-modeled marginals.
  • Likelihood-ratio estimation: Likelihood-ratio methods estimate p(x | θ1)/p(x | θ) or p(x | θ)/p(x), often by training classifiers to distinguish simulated data sources.The simulation-guidance strategy proposed for SNL could in principle be combined with likelihood-ratio estimation.
  • Guiding simulations: Several methods guide simulations using observed data or previously accepted parameters, while SNL and SNPE propose parameters from preliminary posterior approximations.

5 Experiments

Experiments evaluate SNL across toy, queue, ecological, and neuroscience models, comparing posterior accuracy, calibration, convergence, and likelihood fit against neural and conventional baselines. SNL generally offers strong accuracy-cost trade-offs, robustness, and useful diagnostics, though some settings show calibration or convergence limitations.

  • Baselines: The experiments compare SNL with NL, SNPE-A, SNPE-B, Synthetic Likelihood, and SMC-ABC using stated neural architectures and simulation budgets.NL isolates the benefit of SNL’s simulation-guiding strategy, while SL and SMC-ABC provide widely used baselines.
  • Experimental setup: Experiments cover four simulator models, including fast toy demonstrations and slower differential-equation models representing practical scientific problems.The models span a complex-posterior toy model, an M/G/1 queue, Lotka–Volterra ecology, and a Hodgkin–Huxley neuroscience model.
  • Diagnostics: Likelihood and convergence diagnostics show SNL can converge faster than NL, although the Hodgkin–Huxley comparison indicates that longer SNL runs may improve results further.Diagnostics include median simulated-to-observed distance and MMD between learned and true likelihood samples; likelihood goodness-of-fit is unavailable for posterior- or likelihood-ratio methods.
  • Calibration: Simulation-based calibration suggests that SNL is well-calibrated for the toy and M/G/1 models, but calibration can be over-confident under a broad prior for Lotka–Volterra.For oscillating Lotka–Volterra behaviour under a constrained prior, the calibration test suggests reasonable calibration.

6 Discussion

SNL combines sequential simulation guidance with flexible neural likelihood estimation, achieving accurate and robust inference across experiments. The discussion highlights diagnostics, high-dimensional scaling challenges, and trade-offs between learning likelihoods and posteriors.

  • Performance and robustness of SNL: SNL was accurate, efficient, and robust across experiments, outperforming neural and non-parametric alternatives in accuracy or simulation cost.SNPE-A failed in two of four cases, while SNPE-B showed high variability.
  • Performance and robustness of SNL: Guiding simulations was crucial for fitting the likelihood well in regions relevant to inference with a reasonable simulation budget.The comparison between SNL and NL supports the value of sequential simulation guidance.
  • Performance and robustness of SNL: SNL used the same masked autoregressive flow architecture and training hyperparameters across experiments, reducing reliance on problem-specific tuning.This broad applicability was presented as evidence that extensive task-specific tuning is unnecessary.
  • Diagnostics: Diagnostics help determine the number of rounds, assess calibration, diagnose convergence, and check goodness-of-fit.These diagnostics are intended to support practical deployment of SNL.
  • Scaling to high-dimensional data: High-dimensional data remain challenging because SNL estimates data densities, often requiring low-dimensional features or exploitation of data structure.Factorizing structured datasets into lower-dimensional individual-point densities is suggested as a scaling strategy.
  • Learning the likelihood vs the posterior: Learning likelihoods can be easier and more robust than learning posteriors, and likelihood models can be reused with different priors.The likelihood is also useful for identifiability analysis and hypothesis testing, while posterior construction adds computational cost and approximation error.

A Detailed description of simulator models used in experiments

The first toy simulator uses five parameters drawn from a uniform prior and generates eight-dimensional observations from a multivariate normal distribution. Ground-truth parameters generate the observed dataset for inference experiments.

  • Toy model: The resulting data x are 8-dimensional, and the simulator likelihood is defined for these observations.The passage identifies the data dimensionality and introduces the likelihood used in the experiment.
  • Toy model: Observed data xo are produced by simulating the model at ground-truth parameters θ∗.The ground-truth parameter values themselves are specified separately in the experimental setup.

A.2 M/G/1 queue model

The M/G/1 queue simulator models service in a customer queue using three parameters. Its five-dimensional observations are standardized quantiles of inter-departure times from 50 customers.

  • M/G/1 queue model: The M/G/1 queue model describes how a server processes a queue of arriving customers.The setup follows Papamakarios and Murray.
  • M/G/1 queue model: The model contains 3 parameters, θ = (θ1, θ2, θ3), sampled from a uniform prior.The passage introduces the parameterization and prior before giving the model dynamics.
  • M/G/1 queue model: Customer service, arrival, and departure times define the queue dynamics, with a0 = d0 = 0.The notation includes si for service time, ai for arrival time, and di for departure time.
  • M/G/1 queue model: 50 customers produce 5-dimensional data from the 0th, 25th, 50th, 75th, and 100th quantiles of inter-departure times.The quantiles are linearly transformed to have approximately zero mean and unit covariance using a pilot-run transformation.
  • M/G/1 queue model: Observed data xo are generated by simulating the queue model at ground-truth parameters θ∗.The ground-truth values are specified in the experimental setup.

A.3 Lotka–Volterra population model

The experiments use mechanistic simulators spanning predator–prey dynamics and neuronal electrophysiology. Each model is simulated under specified parameters, transformed into summary features, and paired with observed data generated at ground truth.

  • Lotka–Volterra population model: The Lotka–Volterra model is a four-parameter Markov jump process describing predators interacting with prey.Its state variables are predator count X and prey count Y.
  • Lotka–Volterra population model: Predator and prey births, predator deaths, and predation occur with rates depending on X, Y, or their product XY.The four transitions respectively change predator or prey populations by one.
  • Lotka–Volterra population model: Lotka–Volterra simulations start at X = 50 and Y = 100, run for 30 time units, and record two 151-value timeseries.The Gillespie algorithm is used, producing 9-dimensional feature data.
  • Lotka–Volterra population model: The Lotka–Volterra features include means, log variances, autocorrelations at lags 0.2 and 0.4, and cross-correlation between the two timeseries.Features are normalized using a pilot run; broad and oscillating-regime priors are both considered.
  • Experimental construction: Both models generate observed data by simulation at ground-truth parameters, with feature transformations standardized using pilot-run information.The Lotka–Volterra and Hodgkin–Huxley setups specify their respective ground-truth parameters and transformed features.
  • Hodgkin–Huxley model: The Hodgkin–Huxley simulator models a modified regular-spiking cortical pyramidal cell with five coupled ordinary differential equations.The model describes membrane voltage and ionic currents, using conductance, reversal-potential, and state-variable dynamics.
  • Hodgkin–Huxley model: The Hodgkin–Huxley voltage timeseries contains 4001 recordings from a 100 ms simulation with 25 µs time steps.Injected current is drawn from a normal distribution during simulation.

B Full experimental results

The experiments evaluate SNL across posterior approximation, accuracy–simulation-cost trade-offs, calibration, convergence, and goodness-of-fit. The toy-model results show that SNL approximates a complex exact posterior well.

  • The evaluation reports SNL’s approximate posterior for each simulator model.
  • Accuracy is assessed against simulation cost for all methods.
  • Simulation-based calibration uses one rank-statistic histogram per parameter.
  • Distance-based convergence tracks the distance between simulated and observed data across rounds for SNL, SNPE-A, and SNPE-B.
  • Goodness-of-fit is measured by Maximum Mean Discrepancy against data generated from the likelihood model at the true parameters, comparing SNL, NL, and a Gaussian baseline.
  • SNL approximates the toy model’s exact posterior well despite its four symmetric modes and prior-induced vertical cut-offs.

B.2 M/G/1 queue model

For the M/G/1 queue model, SNL concentrates the posterior around the true parameters while reflecting parameter-specific information in the data. The data impose a hard upper constraint on θ1, whereas θ2 and θ3 are less constrained.

  • The SNL posterior is concentrated around the true parameters, with θ1 particularly well constrained.
  • The data impose a hard constraint on the maximum possible value of θ1, which the SNL posterior captures correctly.
  • θ2 and θ3 are less constrained because the data are less informative about them.
  • The Lotka–Volterra posterior is tightly concentrated around the true parameters, indicating that the data are highly informative about θ.

B.4 Hodgkin–Huxley cortical pyramidal neuron model

In the Hodgkin–Huxley model, SNL clusters posterior mass around the true parameter values while revealing unequal uncertainty and biologically meaningful correlations. Equilibrium potentials are more tightly constrained than conductances, and some M-type channel parameters remain weakly identified.

  • SNL clusters all Hodgkin–Huxley parameters around their true values.
  • Sodium and equilibrium potentials are relatively tightly clustered, whereas the potassium equilibrium potential has a longer posterior tail.
  • Conductances vary within a factor of 1.8 for gℓ and a factor of 3 for gNa, gK, and gM.
  • gNa and gK are correlated, consistent with their opposing depolarizing and hyperpolarizing influences on membrane potential.
  • gM and τmax have relatively little effect, leaving these M-type potassium-channel parameters loosely constrained.
  • The parameters kβn1 and kβn2 have relatively wide ranges and weak mutual correlation.
  • High kβn1 combined with low kβn2 may prevent rapid repolarization and produce hyper-excitability.
  • The SNL posterior is qualitatively consistent with the posterior reported by Lueckmann et al.
Loading 1805.07226v2…