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

Time-independent Generalization Bounds for SGLD in Non-convex Settings

Tyler Farghly, Patrick Rebeschini

This paper, presented at NeurIPS 2021, provides a significant theoretical advancement in understanding why Stochastic Gradient Langevin Dynamics (SGLD) generalizes well, even when the underlying optimization landscape is non-convex.

TL;DR

The authors establish new generalization error bounds for SGLD that are "time-independent," meaning they don't explode as you train for longer. By leveraging the contraction properties of Langevin diffusions, they show that SGLD's error decays to zero as the sample size increases, providing a more robust theoretical foundation for this popular sampling and optimization algorithm.

What Problem Does This Paper Address?

In machine learning, we care deeply about the generalization error: the gap between how well a model performs on its training data versus unseen data. For many popular algorithms like Stochastic Gradient Descent (SGD), proving tight generalization bounds in non-convex settings (like deep learning) is notoriously difficult.

Stochastic Gradient Langevin Dynamics (SGLD) is a variant of SGD that adds controlled Gaussian noise to every update. While SGLD is widely used for both optimization and Bayesian sampling, existing theoretical bounds for its generalization error often had a major flaw: they grew indefinitely with time ($t$). This suggests that the longer you train, the worse your generalization might become—a conclusion that contradicts practical experience. Furthermore, many previous analyses relied on restrictive assumptions (like bounded loss functions) that don't always hold in practice.

Methods

The authors bridge this gap by combining two powerful mathematical frameworks:

  1. Uniform Stability: This framework measures how much an algorithm's output changes if you swap out exactly one data point in the training set. If the output doesn't change much, the algorithm is "stable" and likely to generalize well.
  2. Wasserstein Contraction: The core innovation here is exploiting the fact that Langevin diffusions (the continuous-time version of SGLD) naturally "contract." Under certain conditions—specifically dissipativity (the function grows at infinity) and smoothness—two different trajectories of the algorithm will eventually converge toward each other regardless of their starting points.

By using reflection couplings (a technique to track two stochastic processes), the authors prove that the "memory" of a single changed data point eventually fades away. This allows them to derive bounds that stay flat or even improve over time, rather than growing linearly or exponentially.

Datasets

This is a purely theoretical paper focused on establishing mathematical proofs and bounds. Consequently, no empirical datasets or benchmarks were used for training or evaluation.

Key Insights and Ideas

  • Time-Independence is Key: Unlike previous work where bounds scaled with $O(\sqrt{t})$, these bounds are $O(1)$ with respect to time. This matches the intuition that a well-behaved algorithm should reach a steady state of generalization.
  • Dissipativity over Lipschitzness: Most stability analyses require the loss function to be Lipschitz (bounded gradients). This paper uses the broader assumption of dissipativity, which is more natural for the "Gibbs distributions" that SGLD is designed to sample from.
  • The Learning Rate Paradox: Interestingly, the authors found that in the dissipative setting, some bounds actually diverge as the learning rate ($\eta$) goes to zero. This happens because a smaller learning rate gives the process less "time" to contract at each step, highlighting a unique trade-off between discretization accuracy and stability.
  • Dimension-Free Potential: The authors show that with a specific scaling of the learning rate ($\eta \propto 1/n^2d$), one can achieve generalization bounds that do not explicitly depend on the model's dimension.

Key Results

The paper provides concrete rates for the Expected Generalization Error (EGE). A comparison with prior work is summarized in the table below:

Table 1: Comparison of expected generalization error bounds for SGLD in recent works.
  • Lipschitz + Weight Decay: For the continuous-time version, they achieve a bound of $O(1/n)$. For the discrete-time version, the bound is $O(1/n + \sqrt{\eta})$.
  • General Dissipative Setting: They achieve a bound of $O(1/(n\sqrt{\eta}))$ for continuous-time and $O(1/(n\sqrt{\eta}) + \sqrt{\eta})$ for discrete-time.
  • Algorithmic Flexibility: The proof technique is robust enough to cover SGLD variants that use Euclidean projections (to keep parameters in a specific range) or non-isotropic noise (where noise varies by direction).

Limitations and Future Work

  • Exponential Constants: While the rates ($1/n$) are excellent, the constants hidden in the $O(\cdot)$ notation often depend exponentially on parameters like the smoothness constant and the inverse temperature ($\beta$). This is a common "curse of non-convexity" in Langevin analysis.
  • Discretization Error: In the discrete-time case, the error introduced by approximating a continuous diffusion with discrete steps still introduces a dependence on the dimension ($d$).
  • Gaussian Dependency: The analysis relies heavily on the properties of Gaussian noise. Extending these time-independent bounds to algorithms with different noise distributions (like heavy-tailed noise) remains an open challenge.
  • Full-Batch Limitation: The convergence of these bounds requires the mini-batch size to be strictly less than the total number of samples ($k < n$). If using full-batch gradient descent, the bounds still grow with time.

Summary updated

BibTeX
@inproceedings{farghly2021time,
  author = {Tyler Farghly and Patrick Rebeschini},
  title = {{Time-independent Generalization Bounds for SGLD in Non-convex Settings}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure