Hamiltonian Dynamics with Non-Newtonian Momentum for Rapid Sampling

Greg Ver Steeg, Aram Galstyan

TL;DR

Energy Sampling Hamiltonian (ESH) dynamics replaces standard Newtonian momentum with a "non-Newtonian" log-kinetic energy. This creates a deterministic system where a particle’s trajectory ergodically samples the target distribution, providing a faster, more stable alternative to traditional stochastic MCMC methods for training energy-based models.

The Problem: The Stochasticity Tax

Sampling from unnormalized distributions is essential for Bayesian inference and training Energy-Based Models (EBMs). For decades, Markov Chain Monte Carlo (MCMC) has been the default, but it faces two major drawbacks:

  1. The Stochasticity Tax: Methods like Langevin Dynamics rely on random walks, which are slow to explore complex, high-dimensional spaces.
  2. Computational Overhead: Learned samplers require expensive auxiliary training that must be repeated for every new target distribution.

The authors seek a "third way": a deterministic dynamics that samples the target distribution directly without needing a stochastic "accept/reject" step or a pre-trained neural model.

Comparison of sampling dynamics: ESH (blue) provides deterministic exploration across modes compared to stochastic random walks or slow thermalization.

Methodology: Non-Newtonian Momentum

In standard Hamiltonian Monte Carlo (HMC), a particle has total energy $H(x, v) = E(x) + K(v)$, where $K(v)$ is usually $\frac{1}{2}v^2$. The core innovation of ESH is a "non-Newtonian" kinetic energy: $$K_{ESH}(v) = \frac{d}{2} \log(v^2/d)$$ where $d$ is the dimension and $v$ is velocity.

In Newtonian physics, a particle spends most of its time where it moves slowest—typically at the top of a hill (high potential energy). To sample a distribution, we want the opposite: the particle should spend time in regions proportional to the probability density $e^{-E(x)}$. The authors prove that their log-form for kinetic energy ensures that the time a particle spends in a region is exactly proportional to the Boltzmann distribution.

Intuition for ESH: Unlike Newtonian physics where particles slow down at peaks, ESH dynamics ensure the time spent in a region is proportional to the target probability density $e^{-E(x)}$.

To make this practical, the authors also developed a transformed ESH ODE to stabilize step sizes and a specialized leapfrog integrator that preserves volume while handling the non-standard momentum.

Key Results and Insights

  • Deterministic Ergodicity: Unlike HMC, which uses dynamics to propose a move and a random flip to accept it, ESH is entirely deterministic. The path of the particle itself is the sample.
  • Faster Convergence: On synthetic tasks, ESH achieved lower Maximum Mean Discrepancy (MMD) with significantly fewer gradient evaluations than NUTS or Langevin.
  • Superior Mode Exploration: ESH is particularly effective at navigating "long, low-energy chasms" where Langevin dynamics often get stuck in a random walk.
  • Better EBM Training: When training EBMs on CIFAR-10, ESH produced markedly more realistic and diverse images than Langevin-trained models under the same computational budget.

Limitations

Like most existing samplers, ESH struggles with the "Funnel" distribution due to extreme variations in length scales. Additionally, while the flow-based version of ESH is unbiased, it suffers from high variance in very high dimensions, making the trajectory-based version more practical for complex tasks like image generation.

Summary updated

BibTeX
@inproceedings{steeg2021hamiltonian,
  author = {Greg Ver Steeg and Aram Galstyan},
  title = {{Hamiltonian Dynamics with Non-Newtonian Momentum for Rapid Sampling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=yVL9qvK5I0},
}
Figure