TL;DR
Standard continual pre-training of foundation models relies on repeated cosine annealing schedules, which require fixed iteration budgets and trigger catastrophic forgetting during learning rate re-warming. This paper shows that the Infinite Learning Rate Schedule—maintaining a constant learning rate plateau followed by rapid annealing—consistently outperforms cosine decay across sequential self-supervised vision and language benchmarks. It eliminates the need to pre-define training duration while significantly improving knowledge retention and task adaptability.
What Problem Does This Paper Address?
When updating foundation models on newly available data distributions (e.g., moving from English text to programming code, or object images to remote-sensing imagery), models suffer from catastrophic forgetting. Most training pipelines default to a repeated cosine annealing schedule: warm up the learning rate (LR), decay it to a near-zero minimum ($\eta_{\min}$) over a fixed step budget, and re-warm it when the next dataset arrives.
This approach has two major flaws:
- Budget rigidity: Practitioners must know their total training steps in advance.
- Re-warming instability: Ramping the learning rate back up from zero disrupts established representations and accelerates forgetting.
While "infinite" or Warmup-Stable-Decay (WSD) schedules have shown promise for standard scaling laws on static datasets, their ability to navigate strong, non-IID distribution shifts in self-supervised learning (SSL) remained unexplored.
Methods
The authors investigate the Infinite Cosine Schedule in continual pre-training (CPT) across vision and language modalities, comparing it directly to repeated cosine decay both with and without experience replay (ER).
The infinite schedule consists of four distinct phases:
- Warmup: LR increases linearly to $\eta_{\max}$.
- Cooldown: LR decays via cosine to a stable plateau, $\eta_{\text{const}}$.
- Constant Phase: LR stays indefinitely at $\eta_{\text{const}}$, allowing practitioners to train for an arbitrary number of steps on incoming data streams without fixing a terminal point.
- Rapid Annealing: When an evaluation or deployment checkpoint is needed, the LR drops rapidly from $\eta_{\text{const}}$ to $\eta_{\min}$ over a short window (e.g., ~15% of steps).
Continual training can branch directly from intermediate pre-annealed checkpoints ($\eta_{\text{const}}$), entirely avoiding the disruptive re-warming spike of repeated cosine schedules.
ηmax /\
/ \ (Cooldown)
/ \_________ ηconst (Constant Phase)
/ \ (Annealing)
LR / (Warmup) \
ηmin \_________
Training Iterations
Datasets
The authors evaluated models across sequential domains with pronounced distribution shifts:
- Small-Scale Vision (ViT-tiny MAE): Split CIFAR-10 (5 sequential 2-class tasks).
- Large-Scale Vision (ViT-B/16 MAE):
- ImageNet ($D_0$): 1.28M object-centric images (1,000 classes).
- Places2 ($D_1$): 1M scene-understanding images (365 classes).
- FireRisk ($D_2$): 91K satellite remote-sensing images.
- Large-Scale Language (570M LLaMA-3 architecture): 100B tokens sampled from each of three corpora:
- DCLM-Baseline ($D_0$): English web text.
- The Stack ($D_1$): Source code repository data.
- German OSCAR ($D_2$): Multilingual web crawl.
Key Insights and Ideas
- Re-warming causes representation damage: Repeated cosine schedules degrade performance largely because ramping the LR back up from $\eta_{\min}$ forcefully pushes weights out of well-formed minima. Maintaining an intermediate plateau ($\eta_{\text{const}}$) keeps optimization stable.
- The $\eta_{\text{const}}$ trade-off:
- Without replay, a lower $\eta_{\text{const}}$ provides better regularization and retention on past tasks.
- With replay, a higher $\eta_{\text{const}}$ improves plasticity and adaptation to incoming data, while replay buffers protect past knowledge.
- Dynamic Replay Annealing: During the final annealing phase of an LLM, adjusting the replay mixture to sample equally across all seen tasks (e.g., 33% each across DCLM, Stack, and German) substantially recovers past task loss without degrading performance on the newest task.
Key Results
- Large-Scale Vision (MAE):
- With 5% Replay: Infinite cosine achieved 50.18% average linear probe accuracy across all three datasets vs. 48.87% for cosine, with far less forgetting (Backward Transfer of -1.37 vs. -3.61). ImageNet retention after all tasks remained at 57.50% (Infinite) vs. 54.35% (Cosine).
- Without Replay: Infinite cosine achieved 41.22% average accuracy vs. 39.69% for cosine, retaining 36.38% on ImageNet vs. 33.39%.
- LLM Benchmarks:
- Continual pre-training from DCLM $\rightarrow$ Stack (with 50% replay) yielded 46.81% average zero-shot accuracy across seven reasoning benchmarks (HellaSwag, ARC-e, PIQA, etc.) for infinite cosine vs. 46.37% for cosine. Without replay, infinite cosine achieved 40.09% vs. 38.58%.
- On subsequent training on German ($D_2$), the infinite schedule maintained lower validation perplexity on upstream tasks while matching or exceeding downstream German benchmark accuracy (28.10% vs. 28.09%).
Limitations and Future Work
- Tokenizer Bottlenecks: The LLM experiments relied on the static LLaMA-3 tokenizer. When shifting drastically between coding and non-English domains, static vocabularies can limit representations; continual tokenizer adaptation was left for future work.
- Hyperparameter Sensitivity: Finding the sweet spot for $\eta_{\text{const}}$ and cooldown duration $P$ still requires heuristics (though the authors suggest choosing $\eta_{\text{const}}$ midway between $\eta_{\max}$ and $\eta_{\min}$ as a robust default).
- Theoretical Analysis: The study is primarily empirical; developing formal convergence and stability proofs for infinite schedules under distribution shifts remains an open direction.
Summary updated