Archive for Hamiltonian Monte Carlo
even faster HMC by learning leapfrog scale offline [online]
Posted in Books, Statistics, University life with tags Hamiltonian Monte Carlo, HMC, leapfrog integrator, No-U-Turn sampler, NUTS, population Monte Carlo, Statistics & Computing, tempering on September 24, 2026 by xi'anfaster HMC by learning
Posted in Books, Kids, Statistics, University life with tags algorithm, conformal Hamiltonian dynamics, eHMC, Hamiltonian Monte Carlo, HMC, leapfrog integrator, mirror descent, No-U-Turn sampler, NUTS, PhD thesis, population Monte Carlo, publication fees, revision, Scholarly Open Access, Shanghai, Springer Nature, Statistics & Computing, tempering, Università Ca' Foscari Venezia on September 23, 2026 by xi'an
Just received the good news that our paper Faster Hamiltonian Monte Carlo by Learning Leapfrog Scale by Wu Changye (吴昌烨), Pierre Pudlo, Julien Stoehr and myself, got accepted in Statistics & Computing! This is great in its own, but further concludes a story that started with Changye’s PhD thesis at Paris Dauphine in 2018, with a revision request from Statistics & Computing that stalled with Changye’s departing for industry in Shanghai and eventually resumed thanks to Julien’s massive investment in coding and improving the learning mechanism. It may also conclude my story with Statistics & Computing, where I am supposed to be the historically most prolific author (?), given the move by Springer to a cash-flow model on 01 January, 2027…
comments from Bob
Posted in Books, pictures, Statistics, University life with tags arXiv, Fisher divergence, Hamiltonian Monte Carlo, HMC, JMLR, leapfrog integrator, local adaptation, MCMC, NUTS, Riemann manifold, U-turn on April 10, 2026 by xi'an
Bob replied to my short post with further items of information that I find worth sharing:
Thanks for the kind post, Christian. It’s amusing to be the subject of one of these posts given how many of them I’ve read about other people. I really appreciate your summaries. And thanks to everyone in the audience for all the great feedback during and after the talk. Here’s a link to my slides.
One of your students or postdocs mentioned an approach that does continuous adaptation on some kind of polynomial schedule that is provably correct, but I didn’t manage to write down the author/reference or the name of the person who recommended it. If you happen to know what that is, I’d be grateful for the reference.
I would also like to follow up on the Robert & Andrieu paper you mention, but I could not find the exact reference on your Google Scholar page. The closest match I can find is:
Controlled MCMC for optimal sampling. 2001. C Andrieu, CP Robert. INSEE.
Section 1.3 is titled “Criteria for local adaptation.” The section cites two things. The first is Haario et al.’s (1999) sliding window approach, for which HMC moves too fast to be useful locally. The second is the multiple try approach of Liu et al. (2000) and the delayed rejection approach Tierny and Mira (1999). We applied delayed rejection to HMC step size adaptation in a couple of papers before developing GIST (Modi, Barnett and Carpenter in Bayesian Analysis; Turok, Modi, and Carpenter in AISTATS); these mirror our second GIST paper and third GIST paper in doing the step size adaptation for a whole trajectory and at each leapfrog step. The GIST approach is easier to understand, easier to describe mathematically, easier to implement, and is more efficient.
The nice part about GIST compared to Riemannian HMC is that we do not need to do any volume adjustments (which must be autodiffed through), which are cubic, and we do not need an implicit integrator, which is incredibly fussy to tune. The tradeoff is the we require reversibility of the adaptation, which I think is going to be tricky with varying curvature. Of course, we can’t afford to compute Hessian matrices in high dimensions, but we could manage Hessian-vector products if we could figure out how to use just those and we could also manage low-rank plus diagonal approximations or sketches as described in the Nutpie paper.
We’ve arXived the Nutpie paper since the talk:
Preconditioning HMC by minimizing Fisher divergence. arXiv. 2026. Seyboldt, Carlsen, and Carpenter.
The WALNUTS paper has been accepted by JMLR, but currently only the arXiv version is available:
The within-orbit adaptive leapfrog no-U-turn sampler. 2026. Nawaf Bou-Rabee, Bob Carpenter, Tore Selland Kleppe, Sifan Liu. 2025 arXiv; 2026 to appear JMLR.
Working with Nawaf and Tore has made all the difference in the world on this—it’s not something I could have done by myself. Sifan’s the one who came up with the nice characterization of NUTS and Nawaf’s done a number of additional things like providing mixing time bounds for NUTS (with Milo Marsden, who’s sadly no longer with us—he’s gone into finance).
Furthermore, you can adjust the U-turn criterion from 180 degrees to whatever you want to control how much of a full orbit you get. Those tend to be even more wasteful of iterations, though—this is what the plot from the expected integration time of NUTS is supposed to show, but it was confusing in the talk.
The approach you took with Wu Chengye to randomize number of leapfrog steps made a deep impression on me. It’s also wasteful in leapfrog steps because any number of steps greater than or less than about 1/4 of an orbit is wasteful either in computation or because it leads to more diffusive sampling. You can see that it is roughly as gradient efficient as NUTS in a 1000-dimensional standard normal. Interestingly, it’s worse than NUTS for parameter estimates and better for squared parameter estimates, which is overall a win. Nawaf has also published on randomized HMC. I think we could turn down NUTS U-turn criterion below 180 degrees to get something similar with NUTS, but I haven’t tried it.
One important property of your randomized approach is that it is much much easier to code efficiently for GPUs than NUTS, because the conditionals in NUTS are hard to execute in SIMD fashion. There’s a very nice introduction to this problem by Sountsov, Carroll, and Hoffman, in their paper “Running Markov Chain Monte Carlo on Modern Hardware and Software,” which is out on arXiv and also going into the next edition of the Handbook of MCMC). The thing to read about how to code NUTS on GPU is Dance, Glaser, Orbanz, and Adams’s paper, “Efficiently Vectorized MCMC on Modern Accelerators,” which is on arXiv and ICML 2025.
You can also randomize step size to vary the integration time and avoid harmonics, e.g.,
Randomized Hamiltonian Monte Carlo. 2017. Bou-Rabee and Sanz-Serna. Annals of Applied Probability.
mostly Monte Carlo [13/03]
Posted in Statistics, Travel, University life with tags #ERCSyG, Adam, ERC, Flatiron Institute, Gibbs sampler, Hamiltonian Monte Carlo, HMC, INRIA, Kantorovich semi-distances, Langevin diffusion, Markov kernel, Markov semigroup, MCMC, NUTS, Ocean, Paris, PariSanté campus, seminar, WALNUTS on March 10, 2026 by xi'an
A new episode of our mostly Monte Carlo seminar, very soon coming near you (if in Paris):
On Friday 13/02/26, from 3-5pm at PariSanté Campus
15h00: Pierre Del Moral (INRIA, Bordeaux)
On the Kantorovich contraction of Markov semigroup
We present a novel operator theoretic framework to study the contraction properties of Markov semigroups with respect to a general class of Kantorovich semi-distances, which notably includes Wasserstein distances. This rather simple contraction cost framework combines standard Lyapunov techniques with local contraction conditions. Our results can be applied to both discrete time and continuous time Markov semigroups, and we illustrate their wide applicability in the context of (i) Markov transitions on models with boundary states, including bounded domains with entrance boundaries, (ii) operator products of a Markov kernel and its adjoint, including two-block-type Gibbs samplers, (iii) iterated random functions and (iv) diffusion models, including overdampted Langevin diffusion with convex at infinity potentials.
16h00: Bob Carpenter (Flatiron Institute, New York)
GIST, WALNUTS, and Continuous Nutpie: mass-matrix and step-size adaptation for Hamiltonian Monte Carlo
I will introduce Gibbs self tuning (GIST), our new technique for coupling tuning parameters and conditionally Gibbs-sampling them per iteration in Hamiltonian Monte Carlo. Then I will turn to the within-orbit adaptive NUTS (WALNUTS) sampler, which adapts the step size every leapfrog step in order to conserve the Hamiltonian. Empirical evaluations on varying multi-scale target distributions, including Neal’s funnel and the Stock-Watson stochastic volatility time-series model, demonstrate that WALNUTS achieves substantial improvements in sampling efficiency and robustness. I will review the Nutpie mass-matrix adaptation scheme, which is designed to minimize Fisher divergence by estimating the mass matrix as the geometric midpoint (aka barycenter) between the inverse covariance of the draws and the covariance of the scores of the draws. Then I will describe a continuously adapting version that adapts per iteration by continuously discounting the past rather than updating in fixed blocks. I will also show how the Adam optimizer outperforms dual averaging for step-size adaptation. I will conclude by considering a lock-free multi-threading implementation that automatically monitors adaptation and sampling for convergence for automatic stopping.

Bob then spoke about the latest version of NUTS, the within-orbit adaptive NUTS (WALNUTS) sampler, which adapts the step size at every leapfrog step in order to conserve the Hamiltonian and keep the path stable enough. The adaptation is facilitated by incorporating this step size as an extra parameter with an attached distribution, that the authors call Gibbs self tuning (GIST), for coupling tuning parameters and conditionally Gibbs-sampling them per iteration in Hamiltonian Monte Carlo. This has been done in the past, incl. in some of my papers (e.g., Andrieu & Robert, 2004), but I could not cite a particular reference during the seminar.