Lifelong Pretraining: Continually Adapting Language Models to Emerging Corpora

Xisen Jin, Dejiao Zhang, Henghui Zhu, Wei Xiao, Shang-Wen Li, Xiaokai Wei, Andrew Arnold, Xiang Ren · DOI

Introduction

Most large language models (LLMs) are "frozen in time," trained on static snapshots of the internet. While effective for many tasks, this approach fails to account for the dynamic nature of the real world, where new scientific fields emerge and language itself evolves. This paper explores Lifelong Pretraining, a framework for continually updating models as new data domains and time periods emerge, ensuring they remain relevant and accurate.

The Challenge of Static Models

Standard Pretrained Language Models (PTLMs) like RoBERTa or GPT are typically trained once on a massive, static corpus. When these models are deployed, they face two major hurdles:

  1. Domain Shift: A model trained on general web text might struggle with specialized technical content, such as biomedical research.
  2. Temporal Shift: A model trained on 2014 data lacks the context to understand 2024 discourse, including new slang, hashtags, and global events.

Simply "fine-tuning" a model on new data usually leads to catastrophic forgetting, where the model loses its ability to perform tasks on the original data it was trained on. The goal of lifelong pretraining is to adapt to the "now" without forgetting the "then."

Lifelong Pretraining Framework

The researchers evaluated several Continual Learning (CL) strategies applied to the pretraining phase of a RoBERTa-base model. The core idea is to process data in a sequential stream rather than a single massive batch.

The sequential pretraining process across datasets $D_1$ to $D_T$ to produce a final model $f_T$.

Key methodologies included:

  • Knowledge Distillation (KD): This emerged as the most effective strategy. The "old" model acts as a teacher for the "new" model, ensuring that the student retains the logic and representational similarities of the previous state.
  • Regularization: Techniques like Online EWC (Elastic Weight Consolidation) penalize changes to weights that were important for previous tasks.
  • Memory Replay: Experience Replay (ER) involves mixing a small buffer of old data with new data during training to maintain performance on previous domains.
  • Model Expansion: Using Adapters or layer expansion to keep original model weights frozen while learning new domains.

Experimental Setup: Two Streams of Data

To rigorously test these methods, the authors constructed two distinct "streams" representing different types of data evolution.

Overview of the Domain-Incremental Research Paper Stream and the Chronologically-Ordered Tweet Stream.
  1. Domain-Incremental Research Paper Stream: Using the S2ORC dataset, they created a sequence of four academic domains: Biomedical $\rightarrow$ Computer Science $\rightarrow$ Materials Science $\rightarrow$ Physics. This tests how well a model retains specialized knowledge as it moves through different technical fields.
  2. Chronologically-Ordered Tweet Stream: This stream used tweets from 2014, 2016, 2018, and 2020 to test "temporal generalization"—the model's ability to handle the evolution of language and world events over time.

Key Insights and Results

The study yielded several critical insights for the development of future LLMs:

  • Distillation > Replay: While Experience Replay is common in computer vision, distillation proved more effective for language models. It provides a "richer" signal by forcing the student model to mimic the teacher's entire logic.
  • The "Curriculum" Advantage: Surprisingly, distillation-based methods sometimes outperformed Multi-Task Learning (training on all data at once). Learning domains sequentially can act as a natural curriculum, making individual tasks easier to digest.
  • Data Efficiency: Performance gains from continual adaptation were most pronounced in low-resource scenarios, where downstream tasks had very few training examples.
  • The "Outdated" Penalty: Using a 2014-specific model on 2020 data resulted in a significant performance hit, confirming that LMs do indeed "expire" if not updated.

Limitations and Future Work

While promising, lifelong pretraining faces challenges. Distillation increases computational costs (roughly 1.6x to 2.4x the training time). Additionally, this study used a fixed vocabulary; future work must address how to dynamically expand a model's lexicon to include new terms (e.g., "COVID-19"). Finally, the authors suggest exploring "selective forgetting" to remove biased or toxic content during the update process.

Summary updated

BibTeX
@inproceedings{jin2022lifelong,
  author = {Xisen Jin and Dejiao Zhang and Henghui Zhu and Wei Xiao and Shang-Wen Li and Xiaokai Wei and Andrew Arnold and Xiang Ren},
  title = {{Lifelong Pretraining: Continually Adapting Language Models to Emerging Corpora}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.351},
}
Figure