NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Revisiting the Effects of Stochasticity for Hamiltonian Samplers

Giulio Franzese, Dimitrios Milios, Maurizio Filippone, Pietro Michiardi

In Bayesian machine learning, sampling from complex posterior distributions is a fundamental challenge. Hamiltonian Monte Carlo (HMC) is widely considered a gold-standard tool for this task, but it is computationally expensive because it requires calculating the gradient of the entire dataset at every step.

To scale up to large datasets, researchers often turn to Stochastic Gradient HMC (SGHMC), which uses small "mini-batches" of data to estimate gradients. Conventional wisdom—and previous theoretical work—suggested that the error introduced by mini-batching behaves like simple Gaussian noise, which could theoretically be counterbalanced by adding friction to the system.

This paper challenges that foundational assumption. By re-analyzing these systems, the authors prove that the stochasticity from mini-batching is fundamentally different from the Brownian motion used in standard stochastic differential equations (SDEs). Instead of being mere "extra noise," mini-batching introduces a structural error that creates a strict convergence bottleneck.

A New Perspective: Differential Operator Splitting

The authors introduce SDE-based HMC (SHMC) and analyze it through the lens of differential operator splitting. Rather than treating mini-batch noise as an additive term, they view each mini-batch as a separate "operator" that moves the system.

To understand the impact of this structure, they compared three types of numerical integrators:

  1. Leapfrog: A standard 1st-order (for SDEs) quasi-symplectic scheme.
  2. Lie-Trotter: A 2nd-order splitting scheme.
  3. MT3: A high-order (3rd-order) quasi-symplectic integrator.

By applying Taylor expansions to these operators, they rigorously derived the "ergodic error"—the difference between the average of the samples and the true distribution.

The $O(\eta^2)$ Convergence Bottleneck

The central breakthrough of the paper is the discovery of an $O(\eta^2)$ bottleneck. The mathematics reveal that while a sophisticated 3rd-order integrator like MT3 might have a theoretical discretization error of $O(\eta^3)$, the act of randomizing mini-batches inherently introduces an error of $O(\eta^2)$.

In a mini-batch setting, this $O(\eta^2)$ term dominates the equation. This means that your advanced 3rd-order integrator will perform no better than a simpler 2nd-order one. The authors proved that for any integrator of weak order $p$, the mini-batch error vanishes at a rate of $O(\eta^{\min(p, 2)})$.

Comparison of integrators in mini-batch vs. full-batch settings.

This phenomenon is perfectly illustrated in the empirical results. When using a full batch of data, the 3rd-order MT3 scheme is clearly superior. However, when mini-batches are introduced, the MT3 and Lie-Trotter (2nd-order) performance lines converge, demonstrating that they have hit the theoretical accuracy wall.

The Role of Friction

The authors also argue for "noise decoupling," suggesting that Brownian motion is a poor model for the discrete jumps caused by switching between data subsets. Unlike previous SGHMC formulations that attempted to precisely estimate and subtract gradient noise, this paper suggests a simpler approach: simply having a friction term ($C$) is enough to ensure the system reaches the correct stationary distribution, provided the step size is small.

Sample paths showing the effect of friction coefficient C.

Empirically, the sampler proved relatively robust to the choice of the friction constant $C$. Values between 5 and 10 generally performed well across different tasks, balancing the "smoothness" of the sampling trajectory without requiring complex noise-subtraction mechanics.

Conclusion and Future Directions

By proving that mini-batching fundamentally limits sampling accuracy to $O(\eta^2)$, this paper provides a crucial reality check for the design of scalable Bayesian samplers. It shows that investing computational resources into high-order integrators is largely redundant in big-data, mini-batch settings.

While the paper establishes strong stationary (long-term accuracy) bounds, the authors note that analyzing how quickly the sampler reaches that state (convergence speed) remains an open area for non-asymptotic analysis. Furthermore, breaking the $O(\eta^2)$ barrier would likely require highly complex splitting schemes involving negative step sizes or imaginary time, presenting a formidable but fascinating challenge for future research.

Summary updated

BibTeX
@inproceedings{franzese2022revisiting,
  author = {Giulio Franzese and Dimitrios Milios and Maurizio Filippone and Pietro Michiardi},
  title = {{Revisiting the Effects of Stochasticity for Hamiltonian Samplers}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=lqO95Z4uYuF},
}
Figure