Skip to main content
QUICK REVIEW

[Paper Review] The promises and pitfalls of Stochastic Gradient Langevin Dynamics

Nicolas Brosse, Alain Durmus|arXiv (Cornell University)|Nov 25, 2018
Quantum many-body systemsPhysics and Astronomy47 citations
TL;DR

This paper analyzes SGLD with constant step size, showing its invariant distribution can diverge from the posterior as data size grows, and contrasts it with SGLDFP, LMC, and SGD using Wasserstein distances and moment expansions.

ABSTRACT

Stochastic Gradient Langevin Dynamics (SGLD) has emerged as a key MCMC algorithm for Bayesian learning from large scale datasets. While SGLD with decreasing step sizes converges weakly to the posterior distribution, the algorithm is often used with a constant step size in practice and has demonstrated successes in machine learning tasks. The current practice is to set the step size inversely proportional to $N$ where $N$ is the number of training samples. As $N$ becomes large, we show that the SGLD algorithm has an invariant probability measure which significantly departs from the target posterior and behaves like Stochastic Gradient Descent (SGD). This difference is inherently due to the high variance of the stochastic gradients. Several strategies have been suggested to reduce this effect; among them, SGLD Fixed Point (SGLDFP) uses carefully designed control variates to reduce the variance of the stochastic gradients. We show that SGLDFP gives approximate samples from the posterior distribution, with an accuracy comparable to the Langevin Monte Carlo (LMC) algorithm for a computational cost sublinear in the number of data points. We provide a detailed analysis of the Wasserstein distances between LMC, SGLD, SGLDFP and SGD and explicit expressions of the means and covariance matrices of their invariant distributions. Our findings are supported by limited numerical experiments.

Motivation & Objective

  • Motivate the use of SGLD for scalable Bayesian learning on large datasets.
  • Characterize how constant-step SGLD behaves relative to the true posterior as N grows.
  • Compare SGLD with variants like SGLDFP and with Langevin Monte Carlo (LMC) and SGD using Wasserstein distances and moments.
  • Provide practical guidance on when SGLD approximates the posterior and when it does not.

Proposed method

  • Model the target posterior as the invariant measure of the Langevin diffusion.
  • Use Euler discretization to define LMC, SGLD, and SGLDFP with a minibatch gradient estimator.
  • Impose assumptions on U and U_i (gradient Lipschitz, strong convexity, convexity) to derive Wasserstein-distance bounds.
  • Derive upper bounds for W2 distances between marginal laws of LMC, SGLDFP, SGLD, and SGD and their respective invariant measures.
  • Provide explicit expressions for means and covariances of invariant distributions via perturbation analyses (H, G, K matrices).
  • Support theoretical findings with limited numerical experiments on simulated data and a Covertype-like dataset.

Experimental results

Research questions

  • RQ1How close are the invariant distributions of LMC, SGLDFP, SGLD, and SGD to the target posterior π as N grows?
  • RQ2How do Wasserstein distances between the marginal distributions evolve for these algorithms under constant step sizes?
  • RQ3Can control variates (SGLDFP) recover approximate posterior samples at sublinear cost in the data size?
  • RQ4What are the mean and covariance discrepancies of the invariant distributions relative to π, and how do they scale with N and γ?
  • RQ5Under what conditions does SGLD resemble SGD rather than the posterior distribution?

Key findings

  • LMC and SGLDFP have invariant measures that become close to the posterior π as N grows, with sampling costs sublinear in N for SGLDFP.
  • SGLD's invariant measure remains distant from π as N grows and is similar to SGD, due to high gradient-variance from subsampling.
  • Wasserstein bounds show convergence rates and cost trade-offs, indicating LMC and SGLDFP achieve ε-accuracy in W2 with cost roughly linear in N for LMC and sublinear for SGLDFP.
  • Mean/covariance expansions reveal biases and covariances of LMC and FP are Θ(1/N), while SGLD/SGD biases are Θ(η) with η = γN, under the specified asymptotics.
  • Theoretical results are illustrated by simulations on Bayesian logistic regression and a large-scale dataset, highlighting gradient-variance behavior and test-set performance differences.
  • The analysis suggests strategies to mitigate SGLD bias (e.g., adjusting γ and p or using control variates) to approach posterior sampling.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.