Skip to main content
QUICK REVIEW

[Paper Review] Continual Pre-Training of Large Language Models: How to (re)warm your model?

Kshitij Gupta, Benjamin Thérien|arXiv (Cornell University)|Aug 8, 2023
Topic ModelingComputer Science12 citations
TL;DR

The paper studies warm-up strategies for continual pre-training of LLMs, showing that re-warming learning rates can improve downstream adaptation while affecting upstream forgetting, and that re-warming from latest checkpoints outperforms retraining from scratch.

ABSTRACT

Large language models (LLMs) are routinely pre-trained on billions of tokens, only to restart the process over again once new data becomes available. A much cheaper and more efficient solution would be to enable the continual pre-training of these models, i.e. updating pre-trained models with new data instead of re-training them from scratch. However, the distribution shift induced by novel data typically results in degraded performance on past data. Taking a step towards efficient continual pre-training, in this work, we examine the effect of different warm-up strategies. Our hypothesis is that the learning rate must be re-increased to improve compute efficiency when training on a new dataset. We study the warmup phase of models pre-trained on the Pile (upstream data, 300B tokens) as we continue to pre-train on SlimPajama (downstream data, 297B tokens), following a linear warmup and cosine decay schedule. We conduct all experiments on the Pythia 410M language model architecture and evaluate performance through validation perplexity. We experiment with different pre-training checkpoints, various maximum learning rates, and various warmup lengths. Our results show that while rewarming models first increases the loss on upstream and downstream data, in the longer run it improves the downstream performance, outperforming models trained from scratch$\unicode{x2013}$even for a large downstream dataset.

Motivation & Objective

  • Motivate continual pre-training as a cheaper alternative to full re-training when new data becomes available.
  • Investigate how warm-up strategies impact forgetting and adaptation during continual pre-training on two large text corpora.
  • Identify practical guidelines for choosing warm-up length, maximum learning rate, and checkpoint selection to balance upstream and downstream performance.

Proposed method

  • Use a 410M Pythia model pre-trained on the Pile as upstream data and continue pre-training on SlimPajama (≈297B tokens) as downstream data.
  • Experiment with linear warm-up and cosine decay learning rate schedules.
  • Vary warm-up length (0–2% of downstream data) and maximum learning rate (1.5e-4, 3e-4, 6e-4).
  • Evaluate performance via validation perplexity on upstream (Pile) and downstream (SlimPajama) datasets.
  • Test different pre-training checkpoints (latest, earlier near maximum loss, and one in-between).
  • Compare continual pre-training with training from scratch under the same schedule.

Experimental results

Research questions

  • RQ1Does the length of the warm-up phase significantly affect downstream or upstream perplexity during continual pre-training?
  • RQ2How does the maximum learning rate during re-warming influence the trade-off between downstream improvement and upstream forgetting?
  • RQ3Is re-warming beneficial when continuing to pre-train on data similar to the upstream corpus (Pile) or on a distinctly different downstream corpus (SlimPajama)?
  • RQ4Do earlier pre-training checkpoints hinder or help adaptation during continual pre-training on new data?
  • RQ5Can continual pre-training with re-warming outperform training from scratch across large downstream datasets?

Key findings

  • Short warm-up length (0–2% of data) does not significantly affect downstream or upstream perplexity.
  • Larger maximum learning rates improve downstream performance but increase forgetting on upstream data; smaller rates preserve upstream performance but limit downstream adaptation.
  • Re-warming with a decayed cosine schedule yields better downstream performance than scratch or constant LR baselines, but initial instability occurs during the warm-up.
  • Continual pre-training with the latest checkpoint outperforms training from scratch and yields better downstream results than using an earlier checkpoint.
  • Re-warming on the same data (Pile) also induces a stability gap but can still lead to downstream benefits, indicating optimization dynamics contribute to the effect beyond distribution shift.
  • Across experiments, models finetuned with warm-up outperform those trained from scratch; early stopping with constant LR can be economical for adapting to new distributions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.