Robust and Automated Tuning for Hamiltonian Monte Carlo

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 2419 papers448 conceptsfrozen 2026-10-04

Hamiltonian Monte Carlo (HMC) is often described as the "gold standard" for sampling from complex, high-dimensional distributions. By treating the log-density of a target distribution as a potential energy field and introducing a fictitious "momentum," HMC uses the laws of physics to glide across the probability landscape. However, this physical analogy comes with a significant engineering burden: the sampler’s efficiency is notoriously sensitive to its hyperparameters—specifically the integration step size ($\epsilon$) and the trajectory length ($L$).

If the step size is too large, the simulation becomes unstable and "diverges," flying off into regions of zero probability. If it is too small, the sampler moves with agonizing slowness, behaving more like a sluggish random walk than a sleek physical system. Research in this field focuses on moving away from manual, "expert-only" tuning toward algorithms that are either inherently robust or automatically self-calibrating.

The Geometry of the Tuning Problem

To understand why tuning is so difficult, we must look at the geometry of the distributions we aim to sample. As Michael Betancourt and Simon Byrne explore in The geometric foundations of Hamiltonian Monte Carlo, HMC's success depends on its ability to stay on a "typical set"—a thin shell in high dimensions where most of the probability mass resides.

Standard HMC uses a numerical integrator (the leapfrog integrator) to simulate motion. This integrator is an approximation; it introduces small errors in energy conservation. To maintain the correct distribution, HMC uses a Metropolis-Hastings rejection step: if the energy error is too high, the move is rejected. Alexandros Beskos and colleagues provided a theoretical anchor for this in Optimal tuning of the Hybrid Monte-Carlo Algorithm, proving that for high-dimensional targets, the optimal acceptance rate is approximately 0.651. This gives practitioners a target, but it doesn't tell them how to reach it across different problem geometries.

Bypassing the Integrator with Exact HMC

One of the most elegant ways to solve the tuning problem is to eliminate the source of the error: the numerical integrator itself. If we can solve the Hamiltonian equations of motion analytically, we don't need a step size at all.

Ari Pakman and Liam Paninski pioneered this approach for specific, difficult distributions. In Exact Hamiltonian Monte Carlo for Truncated Multivariate Gaussians, they showed that when a Gaussian distribution is restricted by linear constraints, the "particle" travels in a series of predictable arcs, reflecting off the constraint boundaries like a billiard ball. Because these reflections can be calculated exactly, the sampler requires no tuning of $\epsilon$ and has a 100% acceptance rate. They extended this logic to discrete spaces in Auxiliary-variable Exact Hamiltonian Monte Carlo Samplers for Binary Distributions, mapping binary variables to the signs of continuous variables to create a piecewise continuous landscape where exact trajectories are still possible.

Adaptive Geometry and Speed Limits

In many real-world models, the "curvature" of the distribution changes. A step size that works in a flat region will cause a divergence in a high-curvature "funnel."

To address this, Kai Xu and Hong Ge introduced General Relativistic HMC (GR-HMC). Borrowing from Einstein’s relativity, they impose a position-dependent "speed limit." When the sampler enters a region of high curvature (where numerical errors usually explode), the algorithm automatically slows the particle down. This makes the sampler significantly more robust to the initial choice of step size, as the algorithm "self-brakes" to avoid instability.

Similarly, Charles Sutton and Yichuan Zhang developed Semi-Separable Hamiltonian Monte Carlo to handle the varying scales of hierarchical models. By exploiting the specific structure of these models, they can adapt the "mass matrix" (which scales the steps in different dimensions) more efficiently than general-purpose Riemannian methods.

Learning to Sample

If manual tuning is hard and analytical solutions are limited to specific distributions, can we simply learn the best way to move?

Recent work has turned to deep learning to automate the design of MCMC kernels. In A-NICE-MC: Adversarial Training for MCMC, Jiaming Song proposed using adversarial training to learn transition kernels. Instead of a human picking a step size, a neural network learns a volume-preserving transformation that mimics the efficient exploration of HMC but adapts to the specific training data.

This trend toward automation is also visible in score-based modeling. Tomas Geffner, George Papamakarios, and Andriy Mnih argue in Compositional Score Modeling for Simulation-Based Inference that by learning the "score" (the gradient of the log-density), we can aggregate information from multiple observations without the finicky manual calibration required by traditional MCMC.

Robust Alternatives: Slice Sampling

When HMC's sensitivity becomes a dealbreaker, researchers often turn to Slice Sampling. Unlike HMC, which requires a gradient and a step size, slice sampling only requires the density value and is largely "tuning-free."

In Gibbsian Polar Slice Sampling, the authors demonstrate a gradient-free sampler that handles heavy-tailed and funnel-shaped distributions—the very things that break poorly-tuned HMC—by updating radial and directional components separately. Similarly, Oliver Mueller and colleagues showed in Slice Sampling Particle Belief Propagation that replacing Metropolis-Hastings with slice sampling eliminates the need for manually tuned proposal distributions in continuous-label Markov Random Fields.

Summary

The evolution of this research area is a move from heuristics to automation. Whether through the rigorous geometric insights of Michael Betancourt, the exact analytical solutions of Ari Pakman, or the learned kernels of Jiaming Song, the goal is the same: to make high-powered Bayesian inference accessible by removing the "magic numbers" that previously required an expert's touch.

Papers in this version

Showing 60 of 419 papers.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 291 papers
  2. Version 1 · 2026-10-04 · 419 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_hyperparameter_sensitivity_mcmc_hyperpar_b87e8354,
  title = {hyperparameter sensitivity (MCMC hyperparameter sensitivity)},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/hyperparameter-sensitivity-mcmc-hyperparameter-sensitivity/rdr_b87e8354f19b4b4aab43d5b5e9bfddd8},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_robust_and_automated_tuning_for_hamilton_b87e8354_v1,
  title = {Robust and Automated Tuning for Hamiltonian Monte Carlo},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/robust-and-automated-tuning-for-hamiltonian-monte-carlo/rdr_b87e8354f19b4b4aab43d5b5e9bfddd8/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}