[Paper Review] Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Be
This paper challenges the hypothesis that heavy-tailed stochastic gradient noise is the primary cause of Adam’s superior performance over SGD in Transformers. Instead, it finds that Adam outperforms SGD even in the full-batch setting, and that this advantage stems from Adam’s behavior resembling sign descent with momentum, suggesting that deterministic, adaptive gradient normalization—not noise robustness—drives the performance gap.
The success of the Adam optimizer on a wide array of architectures has made it the default in settings where stochastic gradient descent (SGD) performs poorly. However, our theoretical understanding of this discrepancy is lagging, preventing the development of significant improvements on either algorithm. Recent work advances the hypothesis that Adam and other heuristics like gradient clipping outperform SGD on language tasks because the distribution of the error induced by sampling has heavy tails. This suggests that Adam outperform SGD because it uses a more robust gradient estimate. We evaluate this hypothesis by varying the batch size, up to the entire dataset, to control for stochasticity. We present evidence that stochasticity and heavy-tailed noise are not major factors in the performance gap between SGD and Adam. Rather, Adam performs better as the batch size increases, while SGD is less effective at taking advantage of the reduction in noise. This raises the question as to why Adam outperforms SGD in the full-batch setting. Through further investigation of simpler variants of SGD, we find that the behavior of Adam with large batches is similar to sign descent with momentum.
Motivation & Objective
- To investigate whether heavy-tailed stochastic gradient noise is the primary cause of Adam’s superior performance over SGD in Transformer models.
- To evaluate the role of stochasticity by varying batch size up to full-batch training.
- To explore why Adam outperforms SGD in low-noise, full-batch settings where noise effects should be minimal.
- To identify whether deterministic properties—such as gradient sign adaptation—better explain the performance gap.
- To examine whether Adam’s behavior in large-batch regimes resembles sign descent with momentum, suggesting a new theoretical explanation for its success.
Proposed method
- Empirically evaluate SGD and Adam across varying batch sizes, including full-batch training, on language modeling tasks (PTB, Wikitext2, SQuAD) and image tasks (MNIST, CIFAR-10) for comparison.
- Use QQ-plots to compare the distribution of stochastic gradient errors (‖g − g̃‖) against Gaussian and α-stable distributions to assess tail heaviness.
- Analyze optimizer behavior in the full-batch setting, where stochastic noise is eliminated, to isolate deterministic factors.
- Compare Adam’s update dynamics to sign descent with momentum, particularly in terms of coordinate-wise gradient sign estimation.
- Use ablation studies and simplified optimizers to isolate the effect of sign-based updates and momentum.
- Conduct grid searches on hyperparameters and report training loss trends, with validation metrics used to support generalization insights.
Experimental results
Research questions
- RQ1Is the performance gap between SGD and Adam on Transformers primarily driven by heavy-tailed stochastic gradient noise, as previously hypothesized?
- RQ2How does the performance gap between SGD and Adam change as batch size increases, especially when noise is minimized?
- RQ3Does Adam’s superior performance in the full-batch setting suggest that noise robustness is not the main factor behind its success?
- RQ4To what extent does Adam’s behavior in large-batch training resemble sign descent with momentum?
- RQ5What architectural or optimization properties in Transformers lead to a larger gap between SGD and Adam compared to CNNs on image tasks?
Key findings
- The performance gap between SGD and Adam persists even in the full-batch setting, where stochastic noise is eliminated, contradicting the hypothesis that noise robustness is the main driver of Adam’s success.
- As batch size increases, Adam continues to outperform SGD, while SGD fails to benefit from reduced noise, indicating that the gap is not noise-induced.
- Adam’s behavior in large-batch training closely resembles sign descent with momentum, suggesting that coordinate-wise sign estimation may underlie its advantage.
- The observed performance gap on Transformers is not explained by heavy-tailed gradient noise, as the QQ-plot analysis shows that gradient error distributions are less heavy-tailed in language tasks than previously claimed.
- On image tasks like CIFAR-10 with ResNet18, the gap between SGD and Adam is smaller and less consistent, suggesting architectural differences (e.g., Batch Normalization) may influence optimizer behavior.
- Optimizers that perform better on training loss also achieve lower validation loss faster, indicating that training dynamics correlate with generalization performance in this setup.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.