AdaGC: Improving Training Stability for Large Language Model Pretraining

Guoxia Wang, Shuai Li, Congliang Chen, Jinle Zeng, Jiabin Yang +3 more
2/16/2025
cs.LG

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Loss spikes remain a persistent obstacle in large-scale language model pretraining. While previous research has attempted to identify the root cause of loss spikes by investigating individual factors, we observe that, in practice, such spikes are typically triggered by the confluence of heterogeneous factors. Empirically, loss spikes may arise from a combination of data outliers, hardware or transient computational faults, numerical precision issues, and hyperparameter settings. Regardless of the underlying cause, these spikes manifest as unstable optimizer updates, as abnormal gradients contaminate both first- and second-moment states. In this paper, we propose a principled gradient-centric remedy: AdaGC, an adaptive per-tensor gradient clipping scheme that mitigates such contamination by bounding gradient norms relative to a tensor-wise exponential moving average of their historical clipped values. AdaGC is optimizer-agnostic, introduces negligible memory overhead, and reduces communication costs compared to GlobalGC, particularly in hybrid-parallel distributed training environments. Experiments on Llama-2 7B, Mixtral 8x1B, and ERNIE 10B-A1.4B demonstrate that AdaGC robustly eliminates training instabilities, consistently reducing spike scores to zero for all models and improving downstream accuracy over GlobalGC by 1.32%, 1.27%, and 2.48%, respectively. Furthermore, AdaGC seamlessly integrates with optimizers such as Muon and Lion, consistently yielding higher average accuracy and zero spike scores.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2025adagc,
  title  = {AdaGC: Improving Training Stability for Large Language Model Pretraining},
  author = {Guoxia Wang and Shuai Li and Congliang Chen and Jinle Zeng and Jiabin Yang and Dianhai Yu and Yanjun Ma and Li Shen},
  year   = {2025},
  eprint = {2502.11034},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.11034v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.11034.svg)](https://codeofpaper.com/paper/2502.11034)

Discussion