Why Gradient Clipping Accelerates Training: A Theoretical Justification for Adaptivity

Jingzhao Zhang, Tianxing He, Suvrit Sra, Ali Jadbabaie

Gradient clipping is a ubiquitous technique in deep learning, particularly for training recurrent neural networks like LSTMs in Natural Language Processing (NLP). While practitioners have long relied on it to prevent "exploding gradients" and stabilize training, traditional optimization theory has struggled to explain why this simple "hack" often leads to significantly faster convergence than standard Stochastic Gradient Descent (SGD). This paper demystifies the success of gradient clipping by introducing a new, more realistic "relaxed smoothness" condition, proving that clipped gradient descent can be arbitrarily faster than standard gradient descent.

The Gap in Traditional Optimization Theory

The theoretical gap lies in a fundamental assumption called Lipschitz smoothness. Most convergence proofs assume that the gradient of a loss function does not change faster than some global constant $L$. In reality, the loss landscapes of neural networks are far from uniform; they contain "spiky" regions where the gradient changes violently. If an optimizer uses a fixed step size based on the "worst-case" roughness of the landscape, training will be agonizingly slow in the smoother, flatter regions.

A Novel Framework: $(L_0, L_1)$-Smoothness

To bridge this gap, the authors propose a novel theoretical framework. Instead of assuming a constant smoothness $L$, they propose that the Hessian norm (a measure of how fast the gradient changes, or the local smoothness) is bounded by a linear function of the gradient norm:

$$\|\nabla^2 f(x)\| \leq L_0 + L_1 \|\nabla f(x)\|$$

This "relaxed" condition allows the landscape to become increasingly "non-smooth" as the gradient grows.

Correlation between gradient norm and smoothness during training.

By plotting the local Lipschitz constant against the gradient norm during training, the authors found a strong positive correlation. In plain English: when the gradient is large, the "ground" under the optimizer is much more uneven. This empirical observation directly supports the proposed $(L_0, L_1)$-smoothness condition.

Why Clipping Works: Adaptive Step Sizing

Under the $(L_0, L_1)$ condition, standard Gradient Descent (GD) is forced to use a tiny step size to avoid diverging in the rougher parts of the landscape. This makes it "arbitrarily slower" than clipped methods.

Gradient clipping effectively acts as an automated gear-shifter. It allows the optimizer to take large steps when the landscape is smooth (small gradients) and automatically scales down the step size when it hits a "spiky" region (large gradients). This adaptivity allows it to traverse areas that would otherwise cause standard GD to crash or require prohibitively small learning rates.

Theoretical and Empirical Results

The authors analyze the convergence rates of Clipped Gradient Descent and Normalized Gradient Descent under this new condition, comparing them against standard fixed-step GD.

  • Theoretical Speedup: The authors prove that the iteration complexity for clipped GD is $O(1/\epsilon^2)$. In contrast, for fixed-step GD, it scales with the initial gradient norm $M$ as $O(L_1 M / \epsilon^2)$. If $M$ is large (e.g., due to poor initialization), standard GD is exponentially slower.
  • Stability with Large Learning Rates: The theory was validated using benchmarks like Penn Treebank (PTB) for AWD-LSTM models and CIFAR-10 for ResNet20. In LSTM experiments, clipping allowed the use of a massive learning rate (up to 30), leading to the fastest training loss convergence. Without clipping, such a high learning rate caused immediate divergence.
  • Empirical Discovery in Vision: While clipping is standard in NLP, the authors demonstrated its efficacy in Computer Vision as well. Training ResNet20 on CIFAR-10 with clipping achieved 95.2% accuracy, matching the performance of heavily tuned SGD with momentum.

Limitations and Future Work

While the paper provides a firm theoretical foundation for clipping and normalization, it acknowledges certain limitations:

  • Scope of Adaptivity: The current theory does not fully extend to more complex adaptive optimizers like Adam or RMSProp, though it suggests a promising path forward.
  • Stochastic Lower Bounds: A tight lower bound for SGD under this relaxed smoothness condition remains an open question, although a lower bound for deterministic GD is provided.
  • Optimal Condition: While $(L_0, L_1)$-smoothness is a significantly better fit than standard Lipschitz smoothness, there may be even more refined conditions that capture the nuances of deep learning landscapes with greater accuracy.

Summary updated

BibTeX
@inproceedings{zhang2020why,
  author = {Jingzhao Zhang and Tianxing He and Suvrit Sra and Ali Jadbabaie},
  title = {{Why Gradient Clipping Accelerates Training: A Theoretical Justification for Adaptivity}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=wWgVb3nnO2},
}
Figure