Abstract
We revisit the theoretical properties of Hamiltonian stochastic differential equations (SDEs) for Bayesian posterior sampling, and we study the two types of errors that arise from numerical SDE simulation: the discretization error and the error due to noisy gradient estimates in the context of data subsampling. Our main result is a novel analysis for the effect of mini-batches through the lens of differential operator splitting, revising previous literature results. The stochastic component of a Hamiltonian SDE is decoupled from the gradient noise, for which we make no normality assumptions. This leads to the identification of a convergence bottleneck: when considering mini-batches, the best achievable error rate is $\mathcal{O}(\eta^2)$, with $\eta$ being the integrator step size. Our theoretical results are supported by an empirical study on a variety of regression and classification tasks for Bayesian neural networks.
Introduction
Bayesian inference for large-scale models like Bayesian Neural Networks (BNNs) often relies on Hamiltonian Monte Carlo (HMC). However, standard HMC requires calculating the gradient of the entire dataset at every step, which is computationally prohibitive for large datasets. To address this, researchers use Stochastic Gradient HMC (SGHMC), which estimates gradients using mini-batches. Traditional theory assumed that the noise introduced by these mini-batches behaves like Gaussian noise and could be compensated for by adding a friction term. This paper challenges this view, arguing that mini-batch noise is fundamentally different from the stochastic components of the underlying SDEs.
Methods and Theoretical Framework
The authors analyze mini-batching through the lens of differential operator splitting rather than the standard Gaussian noise assumption. They propose a framework where the sampling process is treated as an SDE where gradient noise is decoupled from the SDE's inherent Brownian motion. By using the Baker–Campbell–Hausdorff formula, they calculate the exact error introduced by splitting the full dataset's influence into mini-batches.
The study compares several numerical integrators: the standard Leapfrog (order 1 for SDEs), second-order Lie-Trotter and Symmetric Splitting methods, and the high-order (3rd-order) MT3 quasi-symplectic integrator.
The $\mathcal{O}(\eta^2)$ Convergence Bottleneck
A key insight of this work is the identification of a fundamental "convergence bottleneck." Mini-batching introduces an error of order 2. Consequently, even if a high-order integrator (e.g., $p=3$) is used, the total error remains limited to $\mathcal{O}(\eta^2)$. In this regime, mini-batching becomes the limiting factor for accuracy. Furthermore, the paper proves that standard HMC with partial momentum refreshment is mathematically equivalent to a specific SDE integration scheme (Lie-Trotter splitting), bridging classical MCMC and modern SDE-based sampling.
Empirical Results
The theoretical findings were validated using synthetic data and real-world UCI regression and classification benchmarks (e.g., Boston Housing, Ionosphere) using BNNs.
As shown in the empirical results, the 3rd-order MT3 integrator excels in the full-batch setting. However, when mini-batches are introduced, its performance advantage vanishes, matching the lower-order integrators. This confirms that sophisticated, high-order numerical integrators provide no benefit over simpler second-order methods when working with mini-batches. Additionally, "SDE-based HMC," which does not attempt to counterbalance noise with friction, performed as well as SGHMC, suggesting that noise counterbalancing is unnecessary for accurate posterior sampling.
Conclusion and Future Work
The study concludes that for practical large-scale Bayesian inference, robust second-order quasi-symplectic integrators are preferable due to the mini-batch bottleneck. Future work may refine the constants in the error rates, which depend on the geometry of the loss surface, and extend the theory beyond the current focus on ergodic error and strongly convex potentials to more general non-convex regimes typical of neural networks.
Summary updated