arXiv:2506.04805cs.LG2025-06中稿 · ICML被引 11

揭示Adam优化器中损失突增的根源机制

Adaptive Preconditioners Trigger Loss Spikes in Adam

  • 发现自适应预条件器与梯度平方失配导致失效
  • 损失突增源于预条件矩阵最大特征值超稳定阈值
  • 提出基于方向曲率的突增预测方法,适用广泛

Adam优化器在多种神经网络架构和规模下训练时普遍存在损失突增现象,但其内在机制仍不明确。尽管以往解释归因于低损失时更尖锐的损失曲面,我们发现仅靠曲面几何无法充分解释该现象。本文揭示了问题根源在于Adam的二阶矩估计器内部动态。我们识别出一个关键的“解耦”机制:自适应预条件器 $v_t$ 无法跟踪瞬时梯度平方 $g_t^2$,导致自适应机制失效。这种解耦使预条件器在梯度上升时仍自主衰减,使预条件化海森矩阵的最大特征值持续超过稳定性阈值 $2/η$,从而引发剧烈损失突增。通过二次近似分析,我们理论上并实验上刻画了突增演化的五个阶段,并提出了基于梯度方向曲率的突增预测器。实证表明,该机制虽基于简化模型,但可良好泛化至从小型网络到大规模Transformer的实际场景。

原文摘要 · Abstract (English)

Loss spikes commonly emerge during neural network training with the Adam optimizer across diverse architectures and scales, yet their underlying mechanism remains elusive. While previous explanations attribute these phenomena to sharper loss landscapes at lower loss, we show that landscape geometry alone is insufficient to explain the phenomenon. In this work, we pinpoint the root cause in the internal dynamics of Adam's second moment estimator. We identify a critical ``decoupling'' mechanism where the adaptive preconditioner $v_t$ fails to track the instantaneous squared gradients $g_t^2$, causing the adaptive mechanism to effectively fail. This decoupling allows the preconditioner to decay autonomously despite rising gradients, which pushes the maximum eigenvalue of the preconditioned Hessian beyond the stability threshold $2/η$ for sustained periods, manifesting as dramatic loss spikes. Through a quadratic approximation analysis, we theoretically and experimentally characterize five distinct stages of spike evolution and propose a predictor for anticipating spikes based on gradient-directional curvature. We empirically find that the proposed loss spike mechanism, although derived from simplified models, generalizes well to practical scenarios ranging from small neural networks to large-scale Transformers.

优化器损失突增Adam预条件

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。