Lifelong Pretraining: Continually Adapting Language Models to Emerging Corpora

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

Introduction

Pretrained Language Models (PTLMs) like BERT and RoBERTa have revolutionized natural language processing, but they are typically "frozen in time." Because they are trained on static snapshots of data, these models struggle to remain relevant in a dynamic world where language, knowledge, and social contexts evolve rapidly. This paper introduces a framework for lifelong pretraining, where models are continually updated on a stream of emerging corpora rather than being treated as static artifacts.

The Challenge of Distribution Shift

Deploying a model trained on historical data (e.g., from 2019) into a modern context (e.g., 2024) exposes it to significant distribution shifts. This leads to two primary failures:

  1. Outdated Knowledge: The model lacks context for recent global events, technical breakthroughs, or evolving social media slang.
  2. Catastrophic Forgetting: If a model is naively updated on new data, it often abruptly loses the foundational linguistic patterns and knowledge acquired during its initial training phase.

Methodology: Continual Learning for PTLMs

To address these challenges, the researchers evaluated several Continual Learning (CL) strategies designed to balance the acquisition of new information with the retention of old knowledge.

Overview of the lifelong pretraining framework and evaluation metrics.

The study compared several approaches:

  • Baselines: Sequential pretraining (naive updates) and Multi-Task Learning (training on all data simultaneously, serving as an "oracle" upper bound).
  • Model-Expansion: Utilizing Adapters or layer expansion to keep original model weights frozen while learning new domains.
  • Memory Replay: Experience Replay (ER), which refreshes the model's memory by re-training on a small subset of historical data.
  • Distillation-based Methods: These were found to be the most effective. By using the previous model iteration as a "teacher," techniques like Logit Distillation, Representation Distillation, and SEED-Logit-KD regularize the current "student" model to prevent forgetting.

Experimental Setup

The researchers simulated real-world data shifts using two distinct streams:

The two data streams used to evaluate domain and temporal shifts.
  1. Domain-Incremental Research Paper Stream: A sequence of scientific papers across four fields (Bio-Medicine, Computer Science, Material Science, and Physics) to test adaptation across technical vocabularies.
  2. Chronologically-Ordered Tweet Stream: Tweets collected from 2014 to 2020 to test the model's ability to handle temporal drift within a single social domain.

Key Insights and Results

  • Distillation is King: Unlike many other AI domains where Experience Replay is the standard, distillation-based approaches were significantly more effective for language model pretraining. They provided the best balance between learning and retention.
  • The Curriculum Effect: Surprisingly, sequential lifelong pretraining occasionally outperformed Multi-Task Learning. The authors suggest that sequential learning may act as a natural curriculum, simplifying the learning process.
  • Temporal Generalization: Continually updating the model improves its ability to generalize to future data. A model updated through 2018 performs better on 2020 data than a static model, even before it has seen any 2020 samples.
  • Performance Gains: On the research paper stream, distillation methods improved F1 scores on earlier domains by over 1.0% compared to naive training. On the Tweet stream, the SEED-Logit-KD method achieved a hashtag prediction score of 60.74, compared to 56.42 for the base RoBERTa model.

Conclusion

Lifelong pretraining is a necessary evolution for maintaining the utility of PTLMs. While distillation-based methods require more computational resources (1.5x to 2.5x wall-clock time), the specific regularization they provide is essential for stable adaptation. Future research may explore "selective forgetting," allowing models to intentionally discard biased or outdated facts while retaining core linguistic capabilities.

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 O. 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