atlas

Research map / Large language models / Instruction and fine-tuning

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

ICLR 2025 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies gradient spikes in LLaMA and Pythia pre-training and proposes SPAM, an Adam variant with periodic momentum reset, spike-aware gradient clipping, and random sparse momentum for memory-efficient training.

Problem

LLM training is unstable due to gradient and loss spikes, which corrupt Adam's momentum statistics and degrade performance, and existing memory-efficient optimizers trade off against quality.

Approach

Periodically reset Adam's first and second moments to flush spike contamination, clip detected spiked gradients to sqrt(theta*v) instead of zeroing them, and use random sparse masks over moments for memory savings.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use SPAM instead of Adam-based baselinesLLaMA pre-training · C4, LLaMA-60M to LLaMA-1Bvalidation perplexity: 30.46 vs. 34.09; 23.36 vs. 24.91; 17.42 vs. 18.77; 14.66 vs. 16.13Helped
use sparse-momentum SPAM instead of memory-matched GaLorememory-efficient LLaMA pre-training · C4, LLaMA-60M to LLaMA-1Bvalidation perplexity: 32.39 vs. 34.88; 23.98 vs. 25.36; 18.28 vs. 18.95; 15.60 vs. 15.64Helped
use SPAM at d=0.25% instead of LoRALLaMA2-7B fine-tuning · Commonsense170K, average across 8 downstream tasksaverage accuracy: 63.7±0.2 -> 64.4±0.2Helped
use full-density SPAM instead of Adam full fine-tuningLLaMA2-7B fine-tuning · Commonsense170K, average across 8 downstream tasksaverage accuracy: 63.4±0.1 -> 66.7±0.1Helped
replace GSS-based clipping with Gaussian-based clipping (ablation)SPAM · C4 pre-training, LLaMA-60M and LLaMA-130Mperplexity: 30.46 -> 30.83; 23.36 -> 25.93Hurt
replace spike-aware clipping with gradient nullifying (ablation)SPAM · C4 pre-training, LLaMA-60M and LLaMA-130Mperplexity: 30.46 -> 30.86; 23.36 -> 23.62Hurt
set spike threshold θ to 500 instead of 5000 (ablation)SPAM · C4 pre-training, LLaMA-60Mperplexity: 30.46 -> 30.77Hurt
set spike threshold θ to 1000 instead of 5000 (ablation)SPAM · C4 pre-training, LLaMA-60Mperplexity: 30.46 -> 30.59Helped
set spike threshold θ to 2500 instead of 5000 (ablation)SPAM · C4 pre-training, LLaMA-60Mperplexity: 30.46 -> 30.57Helped
set spike threshold θ to 10000 instead of 5000 (ablation)SPAM · C4 pre-training, LLaMA-60Mperplexity: 30.46 -> 30.82Hurt
select sparse parameter subsets randomly instead of by weight or gradient magnitude (ablation)SPAM sparse momentum · C4, LLaMA-60Mtraining performanceHelped
reduce momentum reset interval from 2500 to 500 steps (ablation)SPAM · C4, LLaMA-130Mtraining performanceHelped

Surprising findings

Limitations

Experimental setup

Datasets: C4 SlimPajama Commonsense170K ImageNet-1K Weather time series

Benchmarks: C4 validation perplexity BoolQ PIQA SIQA HellaSwag WinoGrande ARC-e ARC-c OBQA ImageNet-1K

Metrics: validation perplexity accuracy memory (GB) time per iteration

Baselines: Adam Adam+Gradient-Clip-Value Adam+Gradient-Clip-Norm Adafactor Adam-mini GaLore LoRA ReLoRA Embed LN Embed Detach Scaled Embed Scaled Initialization

Builds on: Adam Adafactor GaLore Adam-mini

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy