JEGJonas El Gammal
Surrogate inference for expensive likelihoods

Scientific ML & Bayesian inference

How can we recover a posterior distribution when the model is accurate enough to trust, but too expensive to evaluate conventionally?

The computational bottleneck

Bayesian inference turns a forward model and observed data into a probability distribution over parameters. In simple textbook examples, evaluating the likelihood is almost free. In many real inverse problems it is the dominant cost: one call may require solving differential equations, generating a waveform, running a simulator, or processing a large dataset before it can be compared with the observation.

This problem is not specific to cosmology or even to physics. It appears whenever inference sits on top of an expensive numerical model—in engineering design, computational biology, climate modelling, materials science, and other simulation-driven fields. Standard MCMC and nested-sampling methods may need tens of thousands or millions of likelihood evaluations. They are excellent general tools, but they cannot create a computational budget that is not there.

The difficulty is also statistical. A useful algorithm must locate the small region of parameter space supported by the data, resolve correlations and multiple modes, estimate uncertainty, and recognise invalid regions where the underlying solver fails. Simply evaluating a coarse grid is inefficient in more than a few dimensions, while blindly fitting a global approximation can be dangerously confident where little information exists.

An active-learning loop building a surrogate posterior
Evaluate the expensive target, update a probabilistic surrogate, choose new informative locations, and test whether the inferred posterior has stabilised.

Learning a posterior under a fixed budget

The approach I work on treats likelihood evaluations as a limited experimental resource. A Gaussian process learns the log-posterior from the points evaluated so far and returns both a prediction and an uncertainty. That uncertainty matters: it distinguishes a low posterior region that has genuinely been ruled out from one that is merely unexplored.

An active-learning acquisition rule then decides where the next expensive calls should be made. Useful candidates are not simply the locations with the largest predictive variance. They should be capable of changing the reconstructed posterior—because they lie near probable mass, expose an uncertain boundary, or reveal a mode the current surrogate has not resolved. Evaluations are added iteratively until changes to posterior samples and summary quantities become small.

Gaussian-process active learning

Watch the surrogate learn

expensive evaluations3
log posteriorparameter x
targetGP meanuncertaintyacquisitionevaluations
01 / 16

The target is an illustrative asymmetric log posterior. At each iteration, the Gaussian process updates its mean and uncertainty from the marked evaluations; the acquisition function then balances posterior relevance against what the model still does not know.

Robust acquisition and failure boundaries

Scientific targets add complications that are easy to hide in a schematic surrogate model. Physical solvers can fail outside their domain, and log-posteriors may vary over enormous dynamic ranges. A classifier can learn the boundary between informative, negligible, and invalid regions so that the regression model concentrates on the part of the target that affects inference.

Batch acquisition is another practical requirement. If several workers are available, proposing one point at a time wastes parallel hardware. NORA draws Monte Carlo samples from the current surrogate and turns them into a diverse batch of candidate evaluations. Sampling is often more robust than repeatedly optimising a strongly multimodal acquisition function, and it naturally allocates proposals across separated regions of posterior mass.

These ideas are implemented in GPry, but the scientific question is broader than the package: how should a probabilistic approximation allocate computation, quantify what it does not yet know, and provide evidence that the resulting posterior is accurate enough for the intended analysis?

Selected papers

Where it works—and where it doesn’t

Surrogate inference is most attractive for deterministic, sufficiently regular, low- to moderate-dimensional targets where likelihood evaluations dominate runtime. It is not a universal replacement for MCMC or nested sampling. Noisy targets, severe degeneracies, widely separated modes, and very high dimensionality all require additional structure or different methods. The useful question is not whether a surrogate can imitate a posterior plot, but whether its uncertainty and convergence checks are strong enough to support the scientific conclusion.