ZClip: Adaptive Spike Mitigation for LLM Pre-Training

要約

大規模言語モデル(LLM)の学習には、勾配の不安定性や損失スパイクなど、多くの課題があります。これらの現象は破滅的な発散につながる可能性があり、コストのかかるチェックポイントの復元やデータバッチスキップが必要になります。定数法やノルム法などの従来の勾配クリッピング手法は、固定的な閾値やヒューリスティックに依存しているため、これらの問題に効果的に対処できず、非効率な学習につながり、頻繁な手動介入を必要とする。本研究では、時間経過に伴う勾配ノルムの統計的特性に基づいてクリッピング閾値を動的に調整する適応型勾配クリッピングアルゴリズムであるZClipを提案する。これまでの反応的な戦略とは異なり、ZClipは、勾配ノルムのスケールや時間的変化について事前に仮定することなく、トレーニングダイナミクスに積極的に適応する。その中核は、Zスコアに基づく異常検知を活用して、大きな勾配スパイクを識別し、緩和することで、悪性の損失スパイクを防ぐと同時に、それ以外の収束を妨げません。コードはhttps://github.com/bluorion-com/ZClip。

要約(オリジナル)

Training large language models (LLMs) presents numerous challenges, including gradient instability and loss spikes. These phenomena can lead to catastrophic divergence, requiring costly checkpoint restoration and data batch skipping. Traditional gradient clipping techniques, such as constant or norm-based methods, fail to address these issues effectively due to their reliance on fixed thresholds or heuristics, leading to inefficient learning and requiring frequent manual intervention. In this work, we propose ZClip, an adaptive gradient clipping algorithm that dynamically adjusts the clipping threshold based on statistical properties of gradient norms over time. Unlike prior reactive strategies, ZClip proactively adapts to training dynamics without making any prior assumptions on the scale and the temporal evolution of gradient norms. At its core, it leverages z-score-based anomaly detection to identify and mitigate large gradient spikes, preventing malignant loss spikes while not interfering with convergence otherwise. Our code is available at: https://github.com/bluorion-com/ZClip.

arxiv情報

著者 Abhay Kumar,Louis Owen,Nilabhra Roy Chowdhury,Fabian Güra
発行日 2025-04-03 11:41:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.CL, cs.LG パーマリンク