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

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

Tyler Farghly, Patrick Rebeschini

TL;DR

This paper proves that Stochastic Gradient Langevin Dynamics (SGLD)—a popular algorithm for non-convex optimization—can maintain stable generalization performance even when trained indefinitely. By leveraging the geometric property of "Wasserstein contraction," the authors derive generalization bounds that do not grow with time, ensuring the model's error depends primarily on the sample size rather than the training duration.

What Problem Does This Paper Address?

In machine learning, we want our models to perform well on unseen data (generalization). A common way to study this is through uniform stability: if changing one data point in your training set doesn't change the algorithm's output much, the model is likely to generalize well.

For many popular algorithms like Stochastic Gradient Descent (SGD) and its noisy cousin, SGLD, existing mathematical "bounds" on generalization error often grow as training time ($t$) increases. This suggests a "ticking clock" where the model eventually overfits if trained too long. While this is a known risk, practitioners often find that SGLD remains remarkably stable in practice. The gap between the pessimistic theory (bounds that blow up with time) and the successful practice (stable long-term training) is what this paper aims to close for non-convex settings.

Methods

The authors analyze SGLD under two main conditions: dissipativity (the loss function "pulls" the parameters back toward a central region at large distances) and smoothness.

To prove their results, they use a combination of:

  • Uniform Stability Framework: Measuring how much the algorithm's output diverges when one training sample is replaced.
  • Wasserstein Contraction: This is the core innovation. Instead of assuming the algorithm is "non-expansive" (the standard approach), they use advanced tools from stochastic analysis called reflection couplings. These tools show that under dissipative conditions, the Langevin diffusion (the continuous version of SGLD) naturally "contracts"—meaning two different paths of the algorithm will actually get closer together over time, effectively "forgetting" the initial perturbation caused by changing a single data point.
  • Discretization Analysis: They bridge the gap between the idealized continuous-time SDE (Langevin diffusion) and the actual discrete-time algorithm used by engineers.

Key Insights and Ideas

  • The "Forgetful" Nature of Noise: The injected Gaussian noise in SGLD isn't just for escaping local minima; it provides a mechanism for the algorithm to "forget" specific training points over time, leading to stability.
  • Dissipativity is the Key: You don't need the entire landscape to be convex. As long as the function is "bowl-shaped" at very large distances (dissipative), the algorithm will eventually contract.
  • Breaking the Time Dependency: By showing that the "contraction" rate of the algorithm eventually balances out the "divergence" caused by the data, the authors prove the generalization error stays bounded even as $t \to \infty$.
  • Dimension-Free Potential: In the Lipschitz setting with weight decay, the continuous-time bounds are dimension-free, suggesting that SGLD's stability might scale well to very high-dimensional models.

Key Results

The paper provides two main sets of bounds for the expected generalization error, successfully removing the strict dependence on training time seen in prior work.

Comparison of Expected Generalization Error (EGE) bounds against prior work.
  1. Lipschitz Setting (with Weight Decay):
    • Continuous-time: The bound is $O(1/n)$, where $n$ is the number of samples. This is the "gold standard" for stability.
  2. Discrete-time: The bound is $O(1/n + \sqrt{\eta d})$, where $\eta$ is the learning rate and $d$ is the dimension. By choosing a small enough learning rate ($\eta \propto 1/n^2$), you get a $O(1/n)$ bound that doesn't care about training time.
  3. General Dissipative Setting (No Lipschitz requirement):
    • The bounds are slightly slower, scaling at roughly $O(1/(n\sqrt{\eta}))$.
  4. A key finding here is a trade-off: if you set the learning rate $\eta = O(1/n)$, you achieve a generalization bound of $O(1/\sqrt{n})$, which is standard for many non-convex problems.

Limitations and Future Work

  • Exponential Constants: Like much of the theory in non-convex optimization, the constants in these bounds often depend exponentially on parameters like the "inverse temperature" or the smoothness. In practice, this can make the theoretical bounds much larger than the actual observed error.
  • Gaussian Noise Only: The proof relies heavily on the specific properties of the Langevin diffusion and Gaussian noise. It is unclear if these time-independent results hold for other types of noise (like the heavy-tailed noise sometimes observed in SGD).
  • Discretization Gap: The discrete-time bounds introduce a dependence on the dimension ($d$), which the continuous-time versions avoid. Closing this gap or finding more efficient discretization schemes is a suggested path for future research.

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