Information-Theoretic Generalization Bounds for Stochastic Gradient Descent

Gergely Neu

Abstract

We study the generalization properties of the popular stochastic optimization method known as stochastic gradient descent (SGD) for optimizing general non-convex loss functions. Our main contribution is providing upper bounds on the generalization error that depend on local statistics of the stochastic gradients evaluated along the path of iterates calculated by SGD. The key factors our bounds depend on are the variance of the gradients (with respect to the data distribution), the local smoothness of the objective function along the SGD path, and the sensitivity of the loss function to perturbations to the final output. Our key technical tool is combining the information-theoretic generalization bounds previously used for analyzing randomized variants of SGD with a perturbation analysis of the iterates.

Introduction

In modern machine learning, models are frequently over-parameterized, containing significantly more parameters than training data points. While classical learning theory suggests such models should suffer from severe overfitting, Stochastic Gradient Descent (SGD) consistently identifies solutions that generalize well to unseen data. Explaining this phenomenon remains a central challenge in deep learning theory.

Existing explanations typically fall into two categories: algorithmic stability and information-theoretic approaches. Stability-based proofs demonstrate that if the training set is slightly modified, the output of the algorithm remains relatively unchanged. Information-theoretic approaches use the Mutual Information (MI) between the training data and the final model parameters to bound the generalization gap. However, applying MI to vanilla SGD is problematic: because the algorithm is deterministic once the data and random seed are fixed, the mutual information can become infinite, rendering the bounds vacuous. To circumvent this, researchers often analyze Stochastic Gradient Langevin Dynamics (SGLD), which adds Gaussian noise at each step. Yet, SGLD is rarely used in practice as the added noise can impede training. This work bridges this gap by applying information-theoretic tools to vanilla SGD through a novel analytical framework.

Methodology: The Virtual SGLD Approach

The core innovation of this paper is the "Virtual SGLD" analysis. Rather than modifying the SGD algorithm itself, the authors introduce "virtual" Gaussian noise to the iterates only within the mathematical analysis. This allows for the application of the chain rule of relative entropy to decompose mutual information across the entire training trajectory.

This perturbation analysis yields generalization bounds that are sensitive to the specific path SGD takes through the parameter space. The resulting bound (Theorem 1) is determined by three primary local statistics:

  1. Local Gradient Variance: The fluctuation of mini-batch gradients relative to the true population gradient.
  2. Local Gradient Sensitivity: A measure of local smoothness, quantifying how much the gradient changes when parameters are slightly perturbed.
  3. Local Value Sensitivity: The "flatness" of the loss landscape at the final solution. Solutions residing in flat valleys are less sensitive to perturbations, which correlates with better generalization.

Key Insights

Path-Dependent Generalization

Unlike traditional bounds that focus solely on the properties of the final model, these bounds are path-dependent. They suggest that generalization is a cumulative property determined by the statistics of the gradients encountered at every step of the optimization process. Generalization is not just about where you land, but how you got there.

Simultaneous Bounds and Noise Levels

A significant feature of the proposed Theorem 1 is that the bound holds for all possible noise levels ((\sigma)) simultaneously. This eliminates the need to "tune" the analysis to find a valid bound; the mathematical framework automatically captures the trade-off between gradient variance and landscape flatness.

Unifying SGD and SGLD

The analysis demonstrates that the sensitivity terms appearing in the SGD generalization bound are essentially the same terms that manifest as training error in SGLD. This provides a unified theoretical perspective on why both algorithms exhibit similar generalization behavior despite their different implementations.

Results and Theoretical Rates

The paper proves that for smooth loss functions, SGD can achieve generalization error rates of (O(n^{-1/2})) in large-batch settings and (O(n^{-1/3})) in small-batch settings under specific step-size regimes. Notably, these bounds do not rely on the global Lipschitz constant of the loss function—a common bottleneck in previous theories that caused bounds to explode when applied to deep neural networks. By focusing on local statistics along the path, the bounds remain more controlled and representative of actual training dynamics.

Limitations and Future Directions

While the paper provides a robust framework for measuring generalization based on the SGD path, it does not yet explain the "implicit bias" of SGD—that is, why the algorithm naturally gravitates toward paths characterized by low variance and high flatness. Additionally, the definition of gradient variance used is measured against the population gradient rather than the conditional mean, which differs from some standard optimization literature. Future work may involve combining this approach with "chaining" techniques to further sharpen the bounds and better account for multi-scale dependencies in the data.

Summary updated

BibTeX
@inproceedings{neu2021information,
  author = {Gergely Neu},
  title = {{Information-Theoretic Generalization Bounds for Stochastic Gradient Descent}},
  booktitle = {Conference on Learning Theory},
  year = {2021},
  url = {https://openreview.net/forum?id=nmGYJalWxf},
}
Figure