Abstract
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.
Community
ZClip: Adaptive Spike Mitigation for LLM Pre-Training
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- AdaGC: Improving Training Stability for Large Language Model Pretraining (2025)
- Stable-SPAM: How to Train in 4-Bit More Stably than 16-Bit Adam (2025)
- Scale-Distribution Decoupling: Enabling Stable and Effective Training of Large Language Models (2025)
- Variance Control via Weight Rescaling in LLM Pre-training (2025)
- HybridNorm: Towards Stable and Efficient Transformer Training via Hybrid Normalization (2025)
- PiKE: Adaptive Data Mixing for Multi-Task Learning Under Low Gradient Conflicts (2025)
- When Can You Get Away with Low Memory Adam? (2025)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment:
@librarian-bot
recommend
Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper