arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.38277cs.LGcs.AI
收藏

量化在损失尖峰中的作用

The Role of Quantization in Loss Spikes

Columbia University(哥伦比亚大学);Mohamed bin Zayed University of Artificial Intelligence(穆罕默德·本·扎耶德人工智能大学);University of Maryland(马里兰大学);Vector Institute(向量研究所)

Zaiqian Chen, Aditya Somasundaram, Sophie Li, Sean McLeish, John Kirchenbauer, Tom Goldstein, Micah Goldblum

AI总结:

该研究发现有限精度误差是语言模型预训练中定时炸弹损失尖峰的隐藏驱动因素,提出用带动量的SGD替换LM头的AdamW抑制误差,明确抑制误差是稳定长时间预训练的关键。

摘要:

语言模型预训练中的损失尖峰会浪费大量计算资源,还会破坏原本正常的训练过程。这些不稳定性的一个主要驱动因素是最终语言建模(LM)头中输出 logit 的增长与发散。在本研究中,我们针对与输出 logit 增长相关的一种特定高成本不稳定性展开研究:这种延迟的、仅在长时间训练后才出现的最终发散,我们将其称为“定时炸弹尖峰”。我们发现,这些不稳定性出现前,LM 头中的量化误差会快速增长,最终引发损失尖峰。关键在于,降低数值精度会加速定时炸弹尖峰,而提高精度则能提升稳定性。随后,我们提出一种简单却有效的缓解方法:将 LM 头的 AdamW 替换为带动量的 SGD,抑制 logit 增长,提升长时间训练的稳定性。最后,我们发现文献中现有的缓解技术(以及我们提出的技术)都能减少量化误差,这表明它们的有效性背后存在共同的数值机制。综上,我们的研究结果确定了有限精度误差是定时炸弹尖峰的隐藏驱动因素,并表明抑制该误差是实现长时间稳定预训练的关键。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑