Hostname: page-component-76d6cb85b7-vdhp9 Total loading time: 0 Render date: 2026-07-14T12:33:40.153Z Has data issue: false hasContentIssue false

Does Hamiltonian Monte Carlo mix faster than a random walk on multimodal densities?

Published online by Cambridge University Press:  23 April 2026

Oren Mangoubi*
Affiliation:
Worcester Polytechnic Institute
Natesh S. Pillai*
Affiliation:
Harvard University
Aaron Smith*
Affiliation:
University of Ottawa
*
*Postal address: Mathematical Sciences, Worcester Polytechnic Institute, USA. Email: omangoubi@wpi.edu
**Postal address: Statistics, Harvard University, USA. Email: pillai@fas.harvard.edu
***Postal address: Mathematics and Statistics, University of Ottawa, Canada and Tutte Institute for Mathematics and Computing, Canada. Email: smith.aaron.matthew@gmail.com
Rights & Permissions [Opens in a new window]

Abstract

Hamiltonian Monte Carlo (HMC) is a very popular collection of Markov chain Monte Carlo (MCMC) algorithms. One explanation for the popularity of HMC algorithms is their excellent performance as the dimension d of the target becomes large: theoretical analyses show that popular versions of HMC can have a running time that scales as well as $d^{0.25}$ in good conditions, while even an optimally tuned random-walk metropolis (RWM) algorithm will not do better than d. In this paper, we investigate a different scaling question: does HMC beat RWM for targets with well-separated modes? We find that the answer is often no. Our main tool for answering this question is a novel and simple formula for the conductance of HMC based on Liouville’s theorem, and we also show how this new formula can be used to give very short proofs of results that seem tedious to show with the usual formula. We also use this result to compute the spectral gap of HMC algorithms, for both the classical HMC with isotropic momentum and the recent Riemannian HMC, for multimodal targets. While we focus on the concrete comparison of RWM and HMC, we expect qualitatively similar conclusions to hold for other gradient-based algorithms.

Information

Type
Original Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2026. Published by Cambridge University Press on behalf of Applied Probability Trust
Figure 0

Figure 1. We see a small deep mode next to a ‘banana’-shaped mode. HMC can often explore long, skinny modes much more quickly than RWM. Thus, it is possible to tune the length of the banana-shaped mode, in relation to the distance between the centers of the banana and the circle, so that the time for RWM to mix on the long mode is much larger than the time to escape the small mode, while the time for HMC to mix on the long mode is much smaller than the time to escape the small mode. In this case, the HMC algorithm can exhibit metastability while the RWM algorithm does not; we would expect HMC to mix more quickly than RWM in this situation.

Figure 1

Algorithm 1 Random walk metropolis [45]

Figure 2

Algorithm 2 Isotropic-momentum HMC (idealized symplectic integrator) [44]

Figure 3

Algorithm 3 Riemannian manifold HMC (idealized symplectic integrator) [22, 23]

Figure 4

Figure 2. A boundary $\partial S$ is shown in black. The intersection of $\partial S$ with the top curve is transverse; the intersection with the show right-hand curve is not.

Figure 5

Figure 3. The spectral gap for the isotropic-momentum HMC algorithm with stationary distribution $\pi(q) = ({1}/{2F_{\mathcal{N}(0,1)}(a)})\max (f_{\mathcal{N}(0,1)}(q-a),f_{\mathcal{N}(0,1)}(q-a))$, for different inter-modal distances 2a and different Hamiltonian trajectory times T. The results agree closely with the asymptotic formula in Theorem 1.

Figure 6

Figure 4. A long boundary curve $\partial S$ is shown in black. The top trajectory intersects only once; the right trajectory hits a highly curved region more than once. By Assumption 2, these ‘highly curved’ regions are not possible for very short paths.

Figure 7

Figure 5. In each of the two pictures, we see the central curve $\partial S$, a ball $B_{r}$, and the two left- and right-curves $H_{1}, H_{2}$. The right-hand side picture is only possible for r large, as it would require the normal vector of $\partial S$ to have a derivative of size that goes to infinity as r goes to 0.

Figure 8

Figure 6. A cartoon plot of the target density $\mu_{\sigma}$ with the regions illustrated. Note that we have substantially compressed the regions; in a to-scale drawing, $B_{\beta}$ would not be visible.