The Role of Quantization in Loss Spikes
Organizations: Columbia University · Mohamed bin Zayed University of Artificial Intelligence · University of Maryland · Vector Institute
Abstract
Loss spikes in language model pretraining can waste substantial compute and derail otherwise healthy training runs. A primary driver of these instabilities is the growth and divergence of output logits in the final language modeling (LM) head. In this work, we study a particularly costly form of this instability associated with output logit growth: delayed, terminal divergences that emerge only after prolonged training, which we call time-bomb spikes. We find that these instabilities are preceded by rapidly growing quantization error in the LM head, which eventually culminates in a loss spike. Crucially, reducing numerical precision accelerates time-bomb spikes, while increasing precision improves stability. We then propose a simple yet effective mitigation that replaces AdamW on the LM head with SGD with momentum, suppressing logit growth and improving stability over long training horizons. Finally, we find that existing mitigation techniques from the literature (along with our own) all reduce quantization error, suggesting a shared numerical mechanism behind their effectiveness. Together, our results identify finite precision error as a hidden driver of time-bomb spikes and show that suppressing this error is key to stable long-horizon pretraining.
Figures & tables
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Original context (spiking) | Swapped context (recovered) | |||
| Rank | Token | Logit | Token | Logit |
| 1 | ible | 782.05 | ␣the | 95.01 |
| 2 | ments | 669.86 | ␣in | 94.12 |
| 3 | ured | 640.67 | ␣however | 93.80 |
| 4 | ive | 603.56 | ␣until | 92.99 |
| 5 | ivism | 595.26 | ␣and | 92.96 |
| Peak learning rate (final eval loss ) | |||||||
| Method | |||||||
| 162M | |||||||
| AdamW | 3.642 | 3.679 | 3.733 | 3.733 | |||
| -centering | 3.637 | 3.656 | 3.674 | 3.701 | |||
| -loss | 3.636 | 3.655 | 3.690 | 3.718 | |||
| row-centering | 3.617 | 3.631 | 3.633 | 3.718 | 3.697 | 3.793 | 3.863 |
| 162M | 404M | |||
|---|---|---|---|---|
| Method | Eval Loss | Spike Score | Eval Loss | Spike Score |
| Baseline (AdamW) | ||||
| -loss | ||||
| -centering | ||||
| Row-centering | ||||
| SGD-M, | ||||
LLM Training
Large language model training studies the data, objectives, optimizers, and systems used to build and adapt language models.
See all 353 papers