Computing Marginal Likelihood for Bayesian Model Selection

This direction is split into other directions: marginal likelihood estimation. Its last version stays readable and citable here.

Version 1 of 1158 papers166 conceptsfrozen 2026-10-04

In Bayesian statistics, the "gold standard" for deciding between two competing models is the marginal likelihood, also known as the model evidence. It is the probability of the data given the model, calculated by integrating the likelihood over all possible parameter values.

While the posterior distribution tells us which parameters are best within a model, the marginal likelihood tells us which model is best overall. It naturally incorporates Occam’s Razor: a model that is too simple cannot fit the data, but a model that is too complex spreads its probability mass too thin, resulting in a lower evidence score.

The problem is that for most interesting models—especially deep neural networks or complex physical simulations—this integral is a high-dimensional nightmare. It is often analytically intractable and numerically explosive. Researchers have spent decades developing clever ways to "weigh" these models without actually solving the impossible integral.

The Bridge: Thermodynamic Integration

One of the most intuitive ways to calculate evidence is to build a bridge between something we know and something we don't. David Barber and Christopher M. Bishop popularized a technique called chaining (now known as Thermodynamic Integration or TI) in Bayesian Model Comparison by Monte Carlo Chaining.

Imagine you have a "cold" distribution (the complex posterior) and a "hot" distribution (the simple prior). By creating a sequence of intermediate distributions—slowly "heating up" the posterior—you can calculate the evidence by measuring how the average energy changes along this path. Iwona Hawryluk and colleagues recently extended this in Referenced Thermodynamic Integration for Bayesian Model Selection, showing that comparing a model to a known "reference" density can drastically speed up convergence, requiring hundreds of samples instead of tens of thousands.

Peeling the Onion: Nested Sampling

If Thermodynamic Integration is like walking a path, Nested Sampling (NS) is like peeling an onion. Introduced as a way to handle the "curse of dimensionality" in cosmology, NS transforms the high-dimensional evidence integral into a simple one-dimensional integral over the "prior volume."

The intuition is to maintain a set of "live points" and iteratively replace the point with the lowest likelihood with a new point that has a higher likelihood. Christian P. Robert provided the rigorous theoretical foundation for this in Properties of nested sampling, proving it follows a standard convergence rate. To make this work in the massive parameter spaces of modern science, M. P. Hobson developed PolyChord (PolyChord: nested sampling for cosmology), which uses slice sampling to navigate high-dimensional likelihood surfaces efficiently.

The Physics of Inference

Some of the most powerful insights come from treating inference as a physical process. Michael Habeck demonstrated in Model evidence from nonequilibrium simulations that we can use "fluctuation theorems" from nonequilibrium physics to estimate evidence. By running simulations both "forward" (from prior to posterior) and "backward," we can create estimators that are far more stable than traditional importance sampling.

Similarly, Gabriel Stoltz and Tony Lelièvre imported "free energy" methods from molecular dynamics in Free energy methods for Bayesian inference. They used adaptive biasing to force a sampler to explore difficult, multimodal regions of the parameter space, effectively "flattening" the landscape to ensure no high-evidence peaks are missed.

Evidence in the Wild: Neural Networks and Speed

In modern deep learning, calculating the marginal likelihood is notoriously difficult. However, researchers have found surprising proxies for it. Clare Lyle, Yarin Gal, and Mark van der Wilk discovered a deep connection between training dynamics and evidence in A Bayesian Perspective on Training Speed and Model Selection. They showed that the area under the training curve—how fast a model learns—is actually a proxy for its marginal likelihood. This explains why models that learn quickly often generalize better: they have higher Bayesian evidence.

Furthermore, Pablo Moreno-Muñoz and colleagues proved in On Masked Pre-training and the Marginal Likelihood that popular techniques like Masked Pre-training (used in BERT) are essentially stochastic algorithms for maximizing the marginal likelihood.

Approximations for Scale

When exact integration is impossible, we turn to approximations. The Laplace Approximation fits a Gaussian to the posterior peak and uses its volume as an evidence estimate. While often criticized as too simple, Rina Foygel Barber and Kean Ming Tan showed in Laplace Approximation in High-dimensional Bayesian Regression that it remains remarkably accurate even when the number of parameters exceeds the number of data points, provided the model is sparse.

For even faster results, Amortized Bayesian Inference (ABI) uses neural networks to "learn" the mapping from data to model evidence. While lightning-fast, these methods can be brittle. Recent work by Šimon Kucharský suggests that "Self-Consistency" training—forcing the neural network to obey internal mathematical symmetries—can make these amortized comparisons much more trustworthy for real-world scientific use.

Papers in this version

Showing 60 of 158 papers.

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_computing_marginal_likelihood_for_bayesi_29544db6,
  title = {Computing Marginal Likelihood for Bayesian Model Selection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/computing-marginal-likelihood-for-bayesian-model-selection/rdr_29544db6c4a04dcd8e7d7a43bf2c1e14},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_computing_marginal_likelihood_for_bayesi_29544db6_v1,
  title = {Computing Marginal Likelihood for Bayesian Model Selection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/computing-marginal-likelihood-for-bayesian-model-selection/rdr_29544db6c4a04dcd8e7d7a43bf2c1e14/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}