Multilevel Hamiltonian Monte Carlo

Statistics
Introduced by
Beskos, Jasra, Law, Tempone, Zhou (multilevel MCMC); Neal (HMC component)
Year
2010s
Type
Bayesian computational sampler
Family
Bayesian / computational

What does it do?

Multilevel Hamiltonian Monte Carlo (Multilevel HMC) applies the telescoping, multi-fidelity idea of multilevel Monte Carlo to posterior sampling with Hamiltonian Monte Carlo kernels.

Coupled HMC chains run at several levels of model fidelity or discretisation, and most gradient evaluations fall on the cheaper levels. The aim is to reduce total computational cost relative to a single HMC chain at the finest level.

The intuition behind the method

Multilevel Monte Carlo estimates a quantity by combining many cheap, approximate evaluations with a few expensive, accurate ones, arranged so that the errors largely cancel. Multilevel HMC applies this idea to posterior sampling: coarse-level HMC chains carry out most of the exploration, while finer-level chains estimate the correction needed to move the coarse approximation toward the fine-level target. HMC's gradient-driven proposals let each chain move across the posterior with fewer wasted steps than random-walk proposals would need. The size of the saving depends on how strongly the chains at neighbouring levels are coupled.

History

The multilevel idea is adapted from multilevel Monte Carlo estimation. Beskos, Jasra, Law, Tempone and Zhou (2017) developed multilevel sequential Monte Carlo samplers, a related but distinct method. Neal (2011) describes the Hamiltonian Monte Carlo component that serves as the level kernel.

When to use it

Choose Multilevel HMC when the posterior depends on an expensive forward model that can also be run at coarser fidelity, for example a fine versus coarse PDE solver or a fine versus coarse discretisation of a time-series or spatial model, and when a standard HMC run at the finest level is too slow to be practical. Bayesian inverse problems with PDE constraints are a natural fit. Do not use it when no meaningful hierarchy of approximations exists, when the coarse model differs so much from the fine model that the correction terms remain large, or when the posterior is low-dimensional or cheap to evaluate, in which case a single HMC chain is likely adequate. The method assumes that all levels share one parameter space, since level differences are formed for the same quantity, and that the log-posterior is differentiable at every level, since leapfrog integration requires its gradient. Step sizes and trajectory lengths are tuned separately for each level, using the acceptance rate at that level.

Limitations and considerations

  • Requires a meaningful hierarchy of model fidelities; constructing well-coupled chains across levels demands significant modelling effort.
  • The variance of the level differences must be small enough that the coarse corrections provide real savings; poorly coupled chains can remove the cost advantage.
  • Implementation is substantially more complex than standard HMC, requiring synchronised random-number streams and separate tuning of step sizes and trajectory lengths at each level.
  • The number of levels and the sample allocation across levels must be chosen, which often requires a pilot run.
  • Gradient computations are still needed at the fine level for correction chains, so the method does not eliminate fine-level cost.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Can reduce total gradient cost relative to a single fine-level HMC chain, because most gradient evaluations occur at the cheaper coarse levels, provided the level differences are well coupled.
  • Retains HMC's gradient-driven exploration of continuous, higher-dimensional posteriors at each level.
  • If the coupling and acceptance construction gives an exact level-difference correction, the telescoping estimator targets the fine-level posterior rather than retaining the coarse-level bias. This property depends on the construction and should be verified for the implementation in use.
  • Well suited to forward models whose cost rises steeply with resolution, such as PDE solvers.
  • Each level can use standard HMC machinery, including automatic-differentiation gradients, although the coupling layer between levels is not a standard feature and must be built.

Applications

  • Bayesian inversion of PDE-constrained models, such as subsurface flow problems, where forward solves differ in mesh resolution.
  • Uncertainty quantification in computational fluid dynamics, where discretisation resolution defines the levels.
  • Spatial and geostatistical models in which approximations of increasing fidelity, such as Gaussian process approximations, form the hierarchy.
  • Calibration of computationally expensive simulators, where coarser simulator configurations serve as the lower levels.
  • Posterior sampling for neural network models, where smaller architectures could supply the coarse levels; this is exploratory rather than established practice.

How it works

How it works

1

Define L+1 model approximations or discretisation levels, from a coarse, cheap level 0 to a fine, accurate level L. Typical hierarchies are mesh refinements in a PDE-constrained model, quadrature orders, or the resolution of a lower-dimensional surrogate. The cost is assumed to rise with level, which is why the coarse levels are worth using heavily.

2

At each level, HMC serves as the Markov kernel. HMC introduces auxiliary momentum variables p and proposes new states by simulating Hamiltonian dynamics governed by the Hamiltonian H(q,p) = U(q) + K(p), where U is the negative log-posterior (potential energy) and K is kinetic energy. Gradient information ∇U drives proposals far across the posterior without random-walk diffusion.

Formula
H(q, p) = U(q) + K(p)
3

The Hamiltonian dynamics are discretised with the leapfrog (Störmer–Verlet) integrator, which evaluates ∇U at each step. Gradients are cheap to compute at coarse levels and expensive at fine levels. Because the fine levels mainly serve the correction terms, most gradient evaluations fall on the cheaper levels.

4

The estimator writes the finest-level expectation as the level-0 expectation plus a sum of level-difference terms, each of which is small when neighbouring levels agree closely. Each difference is estimated from its own set of coupled HMC chain pairs, with a sample size chosen separately for each level. The random inputs are shared across the two levels so that the variance of the difference stays low. The cost reduction comes from this structure only if the variance of each level difference decays faster than its cost grows with level. Whether that holds must be checked with a pilot run on the actual model.

Formula
\mathbb{E}[f] = \mathbb{E}_{\ell_0}[f] + \sum_{\ell=1}^{L} \bigl(\mathbb{E}_{\ell}[f] - \mathbb{E}_{\ell-1}[f]\bigr)
5

Coupling between consecutive levels is central: chains at levels ℓ and ℓ−1 need strongly correlated driving noise so that the variance of their difference is small. The accept–reject step at each level must preserve that level's target distribution. Whether the combined estimate is unbiased for the finest level depends on the specific coupling and acceptance construction, which is implementation-dependent. Confirm that construction against an implementation source before relying on the bias correction.

Common pitfalls

  • Failing to verify that the coarse-level model is a meaningful approximation: if coarse and fine posteriors differ drastically, the correction variance is large and the method loses its advantage.
  • Using uncorrelated random numbers across levels, which removes the variance reduction that the telescoping estimator depends on.
  • Checking convergence diagnostics (R-hat, effective sample size) only on the pooled output, when chains at different levels may mix at different rates and need to be assessed level by level.
  • Using the same step size and trajectory length at every level without separate tuning, which can leave the finer levels mixing poorly.
  • Applying the method to low-dimensional or fast-evaluating models, where the overhead of the multilevel machinery outweighs the savings.

Frequently asked questions

How does Multilevel HMC differ from standard HMC?

Standard HMC runs a single Markov chain at the target model's full fidelity, evaluating the gradient of the log-posterior at each leapfrog step. Multilevel HMC runs coupled chains across multiple fidelity levels and combines their estimates through a telescoping sum, so the expensive fine-level gradient is evaluated far fewer times. This is where the cost saving comes from.

What does 'coupling' mean in this context, and why does it matter?

Coupling means the chains at two consecutive levels share the same stream of random numbers, so their sample paths are as similar as possible. When the chains are tightly coupled, the variance of the level-difference correction is small, which is what makes the multilevel estimator cheap. Poor coupling removes the variance reduction and with it the computational advantage.

Is a natural level hierarchy always available?

No, and this is the method's main practical limitation. The hierarchy must arise naturally from the model structure, such as mesh refinement, quadrature order, time-step size, or model complexity. If the forward model cannot be run meaningfully at a coarser resolution, Multilevel HMC is not applicable and standard HMC should be used instead.

How do I choose the number of levels and samples per level?

A pilot run is typically used to estimate the variance and cost of the level differences at each level. The sample allocation is then chosen to minimise total cost for a given error target, with more samples usually placed on the cheaper levels. The exact allocation depends on the model, so it should be set from the pilot estimates rather than from a fixed rule.

Can Multilevel HMC be implemented in standard probabilistic programming languages?

Only partly. General-purpose probabilistic programming systems typically provide the HMC sampler but not the coupling and telescoping layer, which generally has to be written by the user. The level hierarchy also has to be built from the model itself.

Related methods

Sources

  1. Beskos, A., Jasra, A., Law, K., Tempone, R., & Zhou, Y. (2017). Multilevel sequential Monte Carlo samplers. Stochastic Processes and their Applications, 127(5), 1417–1440.

    Open DOI reference
  2. Neal, R. M. (2011). MCMC using Hamiltonian dynamics. In S. Brooks, A. Gelman, G. Jones, & X.-L. Meng (Eds.), Handbook of Markov Chain Monte Carlo (pp. 113–162). CRC Press.

    Open publication reference