Stability of SGD: Tightness Analysis and Improved Bounds

Yikai Zhang, Wenjia Zhang, Sammy Bald, Vamsi Pritham Pingali, Chao Chen, Mayank Goswami

Abstract

Stochastic Gradient Descent (SGD) based methods have been widely used for training large-scale machine learning models that also generalize well in practice. Several explanations have been offered for this generalization performance, a prominent one being algorithmic stability [Hardt et al., 2016]. However, there are no known examples of smooth loss functions for which the analysis can be shown to be tight. Furthermore, apart from properties of the loss function, data distribution has also been shown to be an important factor in generalization performance. This raises the question: is the stability analysis of [Hardt et al., 2016] tight for smooth functions, and if not, for what kind of loss functions and data distributions can the stability analysis be improved? In this paper we first settle open questions regarding tightness of bounds in the data-independent setting: we show that for general datasets, the existing analysis for convex and strongly-convex loss functions is tight, but it can be improved for non-convex loss functions. Next, we give novel and improved data-dependent bounds: we show stability upper bounds for a large class of convex regularized loss functions, with negligible regularization parameters, and improve existing data-dependent bounds in the non-convex setting. We hope that our results will initiate further efforts to better understand the data-dependent setting under non-convex loss functions, leading to an improved understanding of generalization abilities of deep networks.

Introduction

Algorithmic stability is a powerful framework for understanding the generalization capabilities of Stochastic Gradient Descent (SGD). A stable algorithm ensures that a small change in the training dataset (e.g., replacing one sample) does not drastically alter the resulting model. While the seminal work of Hardt et al. (2016) established foundational upper bounds for SGD stability, it left two critical questions unanswered: are these bounds tight (i.e., the best possible), and how does the underlying data distribution influence stability? This paper addresses these gaps by providing matching lower bounds for convex settings and improved, tighter bounds for non-convex landscapes.

Methodology

The authors utilize a combination of adversarial construction and probabilistic analysis to refine stability theory.

  • Adversarial Construction: To demonstrate the tightness of existing bounds, the authors construct specific "worst-case" scenarios using modified Huber functions—functions that are quadratic near the origin and linear elsewhere.
  • Hitting Time Analysis: For non-convex functions, the analysis focuses on the "hitting time," which identifies the specific iteration where SGD first encounters the differing data point between two adjacent datasets.
  • Second Moment Conditions: Moving beyond worst-case data-independent analysis, the authors introduce conditions based on the second moment of the data distribution to quantify how data diversity promotes stability.

Theoretical Contributions

The primary contribution of this work is the "Landscape of Stability," which categorizes the tightness of bounds across different loss function types. The authors prove that for convex and strongly convex functions, the bounds established by Hardt et al. (2016) are indeed tight. However, for non-convex functions, they identify that previous bounds were pessimistic and provide a new, tighter analysis.

Table 1: Summary of stability upper and lower bounds for various loss functions and step sizes.

Key findings include:

  • Convex Tightness: Established a lower bound of $\Omega(T/n)$, matching the known upper bound.
  • Strongly Convex Tightness: Established a lower bound of $\Omega(1/n)$, matching the known upper bound.
  • Non-Convex Refinement: Improved the stability bound from $O(T^a/n)$ to $O(T^a/n^{1+a})$ for specific iteration ranges.
  • Constant Step Size Risks: The analysis shows that constant step sizes in non-convex settings can lead to exponential instability, justifying the common practice of using decaying learning rates.

Data-Dependent Stability

A significant insight of this research is that "well-behaved" data distributions can act as a form of implicit regularization. For linear models, the authors derive an $O(1/n)$ stability bound that remains independent of the number of iterations ($T$), provided the data distribution is sufficiently diverse (measured via second-moment conditions). This explains why deep networks often generalize well even with minimal explicit regularization like weight decay.

Discussion and Limitations

While this work settles several open questions regarding SGD stability, it also highlights new challenges. The data-dependent results are currently most robust for linear models; extending these insights to the highly non-linear landscapes of deep neural networks is a primary direction for future research. Additionally, while "on-average" stability has been improved for non-convex cases, achieving similar refinements for "uniform" stability remains an open problem. Future work should investigate which specific properties of real-world datasets most significantly contribute to the observed stability of SGD in practice.

Summary updated

BibTeX
@inproceedings{zhang2022stability,
  author = {Yikai Zhang and Wenjia Zhang and Sammy Bald and Vamsi Pritham Pingali and Chao Chen and Mayank Goswami},
  title = {{Stability of SGD: Tightness Analysis and Improved Bounds}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=Sl-zmO8j5lq},
}
Figure