On the Theory of Variance Reduction for Stochastic Gradient Monte Carlo

Niladri S. Chatterji, Nicolas Flammarion, Yi-An Ma, Peter L. Bartlett, Michael I. Jordan

This paper provides a rigorous theoretical foundation for variance-reduced sampling, bridging the gap between optimization and Bayesian inference. By adapting popular "variance reduction" techniques from the optimization world, the authors demonstrate how to make Stochastic Gradient Monte Carlo (SG-MCMC) faster and more accurate. Crucially, they provide the first sharp convergence guarantees for variance-reduced SG-MCMC methods under realistic assumptions, identifying a critical "accuracy threshold" that dictates when variance reduction becomes mathematically essential.

The Problem: Bottlenecks in Bayesian Sampling

In Bayesian machine learning, sampling from a posterior distribution is a fundamental task. Langevin Dynamics (LD) is a classic approach, but it requires calculating the gradient of the log-posterior over the entire dataset at every step. For large datasets, this becomes a massive computational bottleneck.

To mitigate this, researchers often use Stochastic Gradient Langevin Dynamics (SGLD), which relies on mini-batches. However, SGLD introduces a new challenge: the stochastic noise (variance) from the mini-batches acts as a constant source of error. To achieve high accuracy, the step size must be shrunk so drastically that the algorithm becomes painfully slow.

While variance reduction (VR) techniques like SAGA and SVRG have revolutionized standard optimization, their application to sampling has been poorly understood. Previous theoretical work often relied on the unrealistic assumption that gradients are "globally bounded"—an assumption that fails even for a simple Gaussian distribution. This paper establishes a unified theory for VR in sampling without relying on such restrictive crutches.

Variance-Reduced Methods

The authors analyze three primary algorithms:

  1. SAGA-LD: Maintains a "memory" of gradients for every data point, updating them incrementally to build a low-variance estimate of the full gradient.
  2. SVRG-LD: Periodically computes a full gradient (a "snapshot") to anchor the stochastic estimates in between.
  3. CV-ULD (Control-Variate Underdamped Langevin Diffusion): Uses a fixed "centering" point (usually the MAP estimate) as a control variate and applies it to underdamped Langevin dynamics, which includes a "momentum" term for faster traversal.

The Secret Sauce: The authors developed a novel proof technique using a Lyapunov function to track how "far" the algorithm is from the target distribution. This allowed them to prove convergence in Wasserstein distance (a measure of the effort required to transform one distribution into another) under standard assumptions like smoothness and strong convexity.

Key Insights and Ideas

The Three Regimes of Accuracy

The paper identifies three distinct performance zones based on the target accuracy ($\epsilon$):

Runtime vs. Accuracy Thresholds
  • Crude Accuracy: If only a rough estimate is needed (less than one pass over the data), standard SGLD is the fastest option.
  • Medium Accuracy: On small datasets, Control Variates (CV-LD) often provide the quickest path to convergence.
  • High Accuracy: For high-precision samples (e.g., for rigorous uncertainty quantification), SAGA-LD emerges as the clear champion.

SAGA vs. SVRG and Heavy Tails

In the context of sampling, SAGA-LD generally outperforms SVRG-LD. SVRG requires a large "epoch length" to function effectively, which can negate the benefits of variance reduction when the step size is small.

Furthermore, one of the most surprising findings is that VR methods are significantly more robust than SGLD when data does not follow a normal distribution. Because SAGA and SVRG "remember" gradient history, they can capture crucial information about the heavy tails of a distribution that SGLD simply misses.

Empirical Validation and Theoretical Speedups

The theory was tested on both synthetic datasets (designed to break the Central Limit Theorem) and real-world datasets from the UCI Machine Learning Repository, including Heart ($N=100$), PIMA ($N=600$), and SUSY ($N=100,000$).

Performance on Real-World Datasets
  • Theoretical Speedup: For a target accuracy $\epsilon$, SAGA-LD requires a step size of $\delta = \mathcal{O}(\epsilon/d)$, whereas SGLD requires a much smaller $\delta = \mathcal{O}(\epsilon^2/d)$. This allows SAGA-LD to take much larger steps, drastically reducing the number of iterations needed to reach the same precision.
  • Dimension Scaling: The authors demonstrate that underdamped methods (CV-ULD) scale better with the dimension ($d$) of the data, potentially offering a square-root improvement ($\sqrt{d}$ vs $d$) over overdamped methods.
  • Empirical Performance: On large datasets like SUSY, SGLD performs well initially but quickly plateaus. In contrast, SAGA-LD continues to improve the log-likelihood as it performs more passes over the data.

Limitations and Future Work

While powerful, these methods come with trade-offs:

  • Memory Overhead: SAGA-LD requires storing a gradient for every data point ($\mathcal{O}(Nd)$). While manageable for linear models (where it simplifies to $\mathcal{O}(N)$), it is prohibitive for deep neural networks.
  • Convexity Assumption: The theoretical guarantees assume the log-posterior is strongly convex. This covers many classical models but does not extend to the highly non-convex landscapes typical of deep learning.
  • The "Error Floor": Control variate methods (CV-ULD) exhibit a non-vanishing error floor if the centering point is not exactly the mode of the distribution.

Future work may explore "accelerated" sampling methods—akin to Nesterov acceleration in optimization—and the development of a comprehensive theory for lower bounds in sampling.

Summary updated

BibTeX
@inproceedings{chatterji2018theory,
  author = {Niladri S. Chatterji and Nicolas Flammarion and Yi-An Ma and Peter L. Bartlett and Michael I. Jordan},
  title = {{On the Theory of Variance Reduction for Stochastic Gradient Monte Carlo}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=ry-k1sZObB},
}
Figure