paper-with-me

홈 › Papers

SPAM: Spike-Aware Adam with Momentum Reset for Stable LLM Training

2025-01-12 · Tianjin Huang, Ziquan Zhu, Gaojie Jin, Lu Liu, Zhangyang Wang, Shiwei Liu

Large Language Models (LLMs) have demonstrated exceptional performance across diverse tasks, yet their training remains highly resource-intensive and susceptible to critical challenges such as training instability. A predominant source of this instability stems from gradient and loss spikes, which disrupt the learning process, often leading to costly interventions like checkpoint recovery and experiment restarts, further amplifying inefficiencies. This paper presents a comprehensive investigation into gradient spikes observed during LLM training, revealing their prevalence across multiple architectures and datasets. Our analysis shows that these spikes can be up to $1000\times$ larger than typical gradients, substantially deteriorating model performance. To address this issue, we propose Spike-Aware Adam with Momentum Reset SPAM, a novel optimizer designed to counteract gradient spikes through momentum reset and spike-aware gradient clipping. Extensive experiments, including both pre-training and fine-tuning, demonstrate that SPAM consistently surpasses Adam and its variants across various tasks, including (1) LLM pre-training from 60M to 1B, (2) 4-bit LLM pre-training,(3) reinforcement learning, and (4) Time Series Forecasting. Additionally, SPAM facilitates memory-efficient training by enabling sparse momentum, where only a subset of momentum terms are maintained and updated. When operating under memory constraints, SPAM outperforms state-of-the-art memory-efficient optimizers such as GaLore and Adam-Mini. Our work underscores the importance of mitigating gradient spikes in LLM training and introduces an effective optimization strategy that enhances both training stability and resource efficiency at scale. Code is available at https://github.com/TianjinYellow/SPAM-Optimizer.git

📄 PDF Abstract BibTeX arXiv:2501.06842

Code (1)

tianjinyellow/spam-optimizer 공식 구현 pytorch

Tasks

Time Series Forecasting

Methods 이 논문이 사용한 방법론

Adam 설명 없음

Similar Papers 제목 키워드 기반

Stable-SPAM: How to Train in 4-Bit More Stably than 16-Bit Adam

2025-02-24 · Tianjin Huang, Haotian Hu, Zhenyu Zhang, Gaojie Jin 외

This paper comprehensively evaluates several recently proposed optimizers for 4-bit training, revealing that low-bit precision amplifies sensitivity to learning rates and often causes unstable gradient norms, leading to …

A Qualitative Study of the Dynamic Behavior for Adaptive Gradient Algorithms

2020-09-14 · Chao Ma, Lei Wu, Weinan E

The dynamic behavior of RMSprop and Adam algorithms is studied through a combination of careful numerical experiments and theoretical explanations. Three types of qualitative features are observed in the training loss cu…

Adaptive Optimization via Momentum on Variance-Normalized Gradients

2026-02-10 · Francisco Patitucci, Aryan Mokhtari arxiv

We introduce MVN-Grad (Momentum on Variance-Normalized Gradients), an Adam-style optimizer that improves stability and performance by combining two complementary ideas: variance-based normalization and momentum applied a…

Image Classification

SoftSignSGD(S3): An Enhanced Optimizer for Practical DNN Training and Loss Spikes Minimization Beyond Adam

2025-07-09 · Hanyang Peng, Shuang Qin, Yue Yu, Fangqing Jiang 외 arxiv

Adam has proven remarkable successful in training deep neural networks, but the mechanisms underlying its empirical successes and limitations remain underexplored. In this study, we demonstrate that the effectiveness of …

Stochastic Optimization

Training Memory in Deep Neural Networks: Mechanisms, Evidence, and Measurement Gaps

2026-01-29 · Vasileios Sevetlidis, George Pavlidis arxiv

Modern deep-learning training is not memoryless. Updates depend on optimizer moments and averaging, data-order policies (random reshuffling vs with-replacement, staged augmentations and replay), the nonconvex path, and a…