Skip to main content
QUICK REVIEW

[Paper Review] Simple and Scalable Strategies to Continually Pre-train Large Language Models

Adam Ibrahim, Benjamin Thérien|arXiv (Cornell University)|Mar 13, 2024
Topic ModelingComputer Science3 citations
TL;DR

This paper proposes a simple, scalable continual pre-training strategy for autoregressive transformer-based large language models (LLMs), combining learning rate re-warming, re-decaying, and replay of prior data. It achieves performance on par with full re-training from scratch on all data—matching re-training baselines across two distribution shifts (English→English and English→German) and two model scales (405M and 10B parameters) using only a fraction of the compute.

ABSTRACT

Large language models (LLMs) are routinely pre-trained on billions of tokens, only to start the process over again once new data becomes available. A much more efficient solution is to continually pre-train these models, saving significant compute compared to re-training. However, the distribution shift induced by new data typically results in degraded performance on previous data or poor adaptation to the new data. In this work, we show that a simple and scalable combination of learning rate (LR) re-warming, LR re-decaying, and replay of previous data is sufficient to match the performance of fully re-training from scratch on all available data, as measured by the final loss and the average score on several language model (LM) evaluation benchmarks. Specifically, we show this for a weak but realistic distribution shift between two commonly used LLM pre-training datasets (English$ ightarrow$English) and a stronger distribution shift (English$ ightarrow$German) at the $405$M parameter model scale with large dataset sizes (hundreds of billions of tokens). Selecting the weak but realistic shift for larger-scale experiments, we also find that our continual learning strategies match the re-training baseline for a 10B parameter LLM. Our results demonstrate that LLMs can be successfully updated via simple and scalable continual learning strategies, matching the re-training baseline using only a fraction of the compute. Finally, inspired by previous work, we propose alternatives to the cosine learning rate schedule that help circumvent forgetting induced by LR re-warming and that are not bound to a fixed token budget.

Motivation & Objective

  • To address the high computational cost of re-training large language models (LLMs) from scratch whenever new data becomes available.
  • To investigate whether simple, scalable continual learning strategies can maintain performance on prior data while adapting effectively to new data.
  • To evaluate the effectiveness of learning rate scheduling and data replay in mitigating catastrophic forgetting during continual pre-training.
  • To explore alternatives to standard cosine learning rate schedules that avoid the pitfalls of LR re-warming.
  • To demonstrate that continual pre-training can match full re-training performance at scale, even under strong distribution shifts.

Proposed method

  • Employ learning rate (LR) re-warming at the start of each new pre-training phase to improve adaptation to new data.
  • Apply LR re-decaying after re-warming to stabilize training and improve convergence on new data.
  • Use replay of a small subset (e.g., 1%) of previously seen data to mitigate catastrophic forgetting.
  • Introduce infinite learning rate schedules as alternatives to cosine decay to avoid the performance drop associated with LR re-warming.
  • Train on large-scale datasets (200B+ tokens) across two distribution shifts: weak (English→English) and strong (English→German).
  • Evaluate performance using final loss and average scores across multiple language modeling benchmarks.

Experimental results

Research questions

  • RQ1Can a simple combination of LR re-warming, re-decaying, and data replay enable continual pre-training of LLMs to match the performance of full re-training from scratch?
  • RQ2How does this strategy perform under a weak distribution shift (English→English) and a strong distribution shift (English→German)?
  • RQ3Does the proposed infinite learning rate schedule outperform standard cosine decay by avoiding the negative effects of LR re-warming?
  • RQ4To what extent can replay mitigate catastrophic forgetting during continual pre-training on massive new datasets?
  • RQ5Does the effectiveness of the strategy scale to larger models (e.g., 10B parameters) and larger data volumes?

Key findings

  • The proposed strategy of LR re-warming, re-decaying, and replay achieves performance on par with full re-training from scratch on all data, as measured by final loss and average benchmark scores.
  • The method successfully mitigates catastrophic forgetting even under a strong distribution shift (English→German), maintaining high performance on prior data.
  • For the 405M parameter model, the continual pre-training strategy matched the re-training baseline across both weak and strong distribution shifts.
  • For the 10B parameter model, the same strategy matched the re-training baseline on the weak distribution shift (English→English), confirming scalability.
  • The proposed infinite learning rate schedules circumvent the performance degradation caused by LR re-warming and achieve results comparable to cosine decay without requiring a fixed token budget.
  • The study demonstrates that continual pre-training is a viable, efficient alternative to full re-training, reducing compute costs significantly while maintaining model quality.

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.