Understanding the unstable convergence of gradient descent

Kwangjun Ahn, Jingzhao Zhang, Suvrit Sra

TL;DR

Classical optimization theory states that gradient descent diverges if the step size is too large ($\eta > 2/L$). This paper provides a first-principles theoretical framework explaining why neural networks defy this rule, entering a regime of "unstable convergence" where the loss non-monotonically decreases while the iterates and sharpness oscillate predictably around a theoretical threshold.

What Problem Does This Paper Address?

In traditional convex optimization, the textbook rule for choosing a gradient descent (GD) step size $\eta$ relies on the descent lemma. To guarantee that the loss decreases at every single step, $\eta$ must be strictly less than $2/L$, where $L$ is the smoothness constant (the maximum sharpness or eigenvalue of the loss Hessian).

However, modern deep learning practitioners routinely violate this condition by using large learning rates. Surprisingly, instead of blowing up into catastrophic divergence, the training loss still manages to decrease over time, albeit with wild, non-monotonic oscillations. This bizarre phenomenon is known as the Edge of Stability (EoS) or unstable convergence.

While empirically well-documented, a rigorous explanation from first principles has been lacking. This paper tackles the fundamental questions: Why doesn't gradient descent completely diverge when the step size is too large, and what rules govern this unstable regime?

Figure 1: Example of unstable convergence for training CIFAR-10 with GD. We follow the experimental setup of (Cohen et al., 2021); see Experiment 1 for details. We use a ReLU network. Here, condition (1.2) fails, but the training loss still (non-monotonically) decreases in the long run.

Methods

The authors investigate unstable convergence by combining dynamical systems theory with controlled empirical simulations.

To precisely quantify the dynamics, they introduce two key mathematical metrics:

  1. Relative Progress Ratio (RP): Measures the actual change in loss relative to the squared norm of the gradient step. In a stable regime, this ratio is strictly negative; in the unstable regime, it hovers near zero.
  2. Directional Smoothness ($L(\theta; v)$): Measures how much the gradient changes specifically along the direction of the optimizer's update vector.

Using the Stable Manifold Theorem, they analyze the behavior of GD near sharp stationary points. They then extend their deterministic GD framework to Stochastic Gradient Descent (SGD) by defining an Expected Relative Progress Ratio to handle the inherent randomness of minibatches.

Datasets

The theoretical insights are validated using:

  • Synthetic Landscapes: Pure quadratic costs and "flattened" quadratic costs (using a $\tanh$ wrapper) to isolate geometric effects.
  • CIFAR-10: Used to train fully connected neural networks (with both tanh and ReLU activations) under full-batch GD and minibatch SGD settings to demonstrate real-world alignment with their theory.

Key Insights and Ideas

  • Unstable GD Cannot Rest at Sharp Points: The authors prove that for almost all initializations, GD will never converge to a stationary point whose sharpness exceeds $2/\eta$. If it encounters a sharp region, it is violently kicked out.
  • Why Neural Networks Don't Diverge: In a pure quadratic function, a large step size causes infinite divergence. However, neural network architectures (thanks to activation functions like ReLU and tanh) feature "sub-quadratic growth"—the landscape flattens out far away from the minimum. This flattening creates a forward-invariant compact set, acting like valley walls that keep the bouncing iterates contained.
  • The Self-Correcting Oscillation: When GD enters the unstable regime, it begins to oscillate across the valley walls. The authors prove a core identity showing that the Relative Progress Ratio directly depends on Directional Smoothness: $$\text{RP}(\theta) \approx -1 + \frac{\eta}{2} \cdot L(\theta; \eta\nabla f(\theta))$$ Because the iterates oscillate, the directional smoothness hits a ceiling of $\sim 2/\eta$, forcing the relative progress ratio to hover around $0$. The optimizer effectively "slides" along the valley floor.
Figure 1: Example of unstable convergence for training CIFAR-10 with GD. We follow the experimental setup of (Cohen et al., 2021); see Experiment 1 for details. We use a ReLU network. Here, condition (1.2) fails, but the training loss still (non-monotonically) decreases in the long run.

Key Results

  • The Core Identity Verification: Experiments on CIFAR-10 confirm that in the unstable regime, the Relative Progress Ratio tightly saturates around $0$, while the directional smoothness and sharpness oscillate right at or slightly above the theoretical $2/\eta$ threshold.
  • Extension to SGD: The authors successfully extend this relationship to stochastic settings, proving that even though SGD doesn't minimize loss monotonically in expectation, its expected relative progress ratio obeys the exact same oscillatory bounds.
A toy example demonstrating how applying a flattening function (tanh) to a quadratic cost prevents complete divergence and enables unstable convergence.

Limitations and Future Work

  • Constant Step Sizes Only: The current analysis is restricted to constant step-size GD and SGD. It remains unclear how these properties interact with adaptive optimizers like Adam or RMSProp, which dynamically scale learning rates per parameter.
  • Explaining the Acceleration: Empirically, operating at the Edge of Stability often leads to faster training. While this paper characterizes how it happens, a rigorous proof explaining why optimization accelerates in this oscillatory state remains an open problem.
  • Hessian Assumptions: The link to absolute sharpness relies on the gradient vector aligning with the top eigenvector of the Hessian, an assumption that holds perfectly in toy models but requires deeper validation in massive, deep architectures.

Summary updated

BibTeX
@inproceedings{ahn2022understanding,
  author = {Kwangjun Ahn and Jingzhao Zhang and Suvrit Sra},
  title = {{Understanding the unstable convergence of gradient descent}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=KAOhLG9Fi9},
}
Figure