autoMALA: Locally adaptive Metropolis-adjusted Langevin algorithm

Miguel Biron-Lattes, Nikola Surjanovic, Saifuddin Syed, Trevor Campbell, Alexandre Bouchard‐Côté · DOI

Abstract

Selecting the step size for the Metropolis-adjusted Langevin algorithm (MALA) is necessary in order to obtain satisfactory performance. However, finding an adequate step size for an arbitrary target distribution can be a difficult task and even the best step size can perform poorly in specific regions of the space when the target distribution is sufficiently complex. To resolve this issue we introduce autoMALA, a new Markov chain Monte Carlo algorithm based on MALA that automatically sets its step size at each iteration based on the local geometry of the target distribution. We prove that autoMALA has the correct invariant distribution, despite continual automatic adjustments of the step size. Our experiments demonstrate that autoMALA is competitive with related state-of-the-art MCMC methods, in terms of the number of log density evaluations per effective sample, and it outperforms state-of-the-art samplers on targets with varying geometries. Furthermore, we find that autoMALA tends to find step sizes comparable to optimally-tuned MALA when a fixed step size suffices for the whole domain.

What Problem Does This Paper Address?

In Bayesian inference, sampling from complex probability distributions is a fundamental challenge. The Metropolis-adjusted Langevin algorithm (MALA) is a powerful tool that utilizes gradients to guide the sampler toward high-density regions, significantly improving efficiency over standard random-walk Metropolis-Hastings.

However, MALA's performance is highly sensitive to its step size ($\epsilon$). A step size that is too large leads to frequent rejections, while one that is too small results in slow exploration. Most practitioners tune a single global step size, but this approach fails when the target distribution's geometry varies significantly across the space. A classic example is Neal’s funnel, where the distribution transitions from a wide, flat region to a narrow, high-curvature "neck."

Neal's funnel distribution illustrates the challenge of varying geometry.

Methods: Giving MALA a Local Set of Gears

The authors propose autoMALA, which dynamically adapts the step size at every iteration based on local geometry. The algorithm ensures mathematical rigor through a novel reversibility check. Each iteration involves:

  1. State Augmentation: Sampling a momentum term and two random thresholds ($a$ and $b$) to define a target acceptance range.
  2. Local Step Size Selection: The algorithm iteratively doubles or halves the step size until the proposal's acceptance ratio falls within the $(a, b)$ window.
  3. The Reversibility Check: To maintain the correct invariant distribution, the algorithm verifies if the reverse move (from the proposed state back to the current state) would have selected the same step size. If this symmetry is broken, the move is rejected.
  4. Metropolis-Hastings Step: A final correction step ensures the samples are valid.
The autoMALA mechanism for local step size selection and reversibility checking.

Additionally, autoMALA includes a round-based tuning scheme to initialize the step size and a diagonal preconditioner to rescale dimensions automatically.

Key Insights and Results

  • Local vs. Global Adaptation: Unlike the No-U-Turn Sampler (NUTS), which typically fixes its step size after warmup and only adapts the number of steps, autoMALA adapts the step size itself. This proves crucial for distributions with varying curvature.
  • Computational Efficiency: autoMALA's cost per step scales linearly with the number of dimensions, making it more scalable than other adaptive Langevin methods that require cubic-scaling matrix operations.
  • Performance on Complex Geometries: On Neal’s funnel, autoMALA required fewer gradient evaluations per effective sample than NUTS and provided more accurate variance estimates in the difficult "neck" region.
  • Real-World Robustness: In Bayesian logistic regression tasks with "horseshoe" priors, autoMALA consistently outperformed NUTS, particularly in low-data regimes where the posterior geometry is highly irregular.

Conclusion

autoMALA offers a "plug-and-play" solution for MCMC sampling that is robust to poor initialization and highly effective for complex, varying geometries. While NUTS remains efficient for simpler, uniform distributions, autoMALA's ability to shift "gears" locally makes it a powerful addition to the Bayesian inference toolkit. Future work may extend this local adaptation framework to other classes of MCMC algorithms.

Summary updated

BibTeX
@inproceedings{bironlattes2024automala,
  author = {Miguel Biron-Lattes and Nikola Surjanovic and Saifuddin Syed and Trevor Campbell and Alexandre Bouchard‐Côté},
  title = {{autoMALA: Locally adaptive Metropolis-adjusted Langevin algorithm}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
  url = {https://openreview.net/forum?id=ReMB1WRY6T},
}
Figure