← New search

Other meanings of Hamiltonian Monte Carlo

Computational statistics

Hamiltonian Monte Carlo

Hamiltonian Monte Carlo (HMC) is a Markov chain Monte Carlo (MCMC) sampling method that uses Hamiltonian dynamics to propose new states, enabling efficient exploration of high-dimensional probability distributions. Introduced by Simon Duane, Anthony D. Kennedy, Brian J. Pendleton, and Duncan Roweth in 19871, HMC is particularly effective for Bayesian inference, where it avoids the random walk behavior of simpler Metropolis algorithms.

1987
Year introduced
Year introduced
Duane et al.
Original authors
Original authors
Leapfrog integrator
Core numerical method
Core numerical method
1

Core mechanism and advantages

Hamiltonian Monte Carlo augments the target distribution's parameter space with auxiliary momentum variables, then simulates Hamiltonian dynamics using the leapfrog integrator to propose states that are far apart yet have high acceptance probability2. This suppresses the random walk inefficiency of conventional Metropolis–Hastings. The acceptance rate is typically high because the Hamiltonian is conserved up to numerical error, and the gradient of the log-density (the “force”) drives proposals toward regions of high probability. HMC scales well to hundreds or thousands of parameters, making it a cornerstone of modern probabilistic programming languages such as Stan3.

2

Tuning and practical considerations

Performance hinges on two hyperparameters: the step size ε and the number of leapfrog steps L. The step size controls the integrator's accuracy; too large yields low acceptance, too small wastes computation. The trajectory length T = εL determines how far the proposal moves per iteration. Adaptive schemes like NUTS (No-U-Turn Sampler) automatically tune L to avoid periodic behavior4. Modern implementations also use mass matrix adaptation to account for varying scales and correlations among parameters.

3

Lesser-known aspects

The original 1987 paper applied HMC to lattice gauge theory in quantum chromodynamics, long before its widespread use in statistics1. Radford Neal's 1996 Ph.D. thesis and later tutorial are credited with introducing HMC to the machine learning community5. A lesser-known variant, Riemannian manifold HMC, uses the geometry of the parameter space to adapt proposals automatically6. HMC also appears in molecular dynamics as a way to compute thermodynamic averages, bridging statistical physics and Bayesian computation.

4

Limitations and connections

HMC requires gradient information, which may be unavailable for non-differentiable models. It is memory-intensive for large datasets because it evaluates the gradient over all data points per leapfrog step. Stochastic gradient HMC (SG-HMC) extends the method to mini-batch settings7. HMC is closely related to the Metropolis-adjusted Langevin algorithm (MALA), which uses a single leapfrog step; HMC generalizes MALA by allowing multiple steps per iteration.

Glossary

Leapfrog integrator
A symplectic numerical integrator used to approximate Hamiltonian dynamics, preserving phase-space volume.
NUTS
No-U-Turn Sampler, an adaptive variant of HMC that automatically sets the number of leapfrog steps.
MALA
Metropolis-adjusted Langevin algorithm, a gradient-based MCMC method that uses one leapfrog step.

Hamiltonian Monte Carlo is also known as Hybrid Monte Carlo, reflecting its origins in lattice field theory.