Revisiting Replay and Gradient Alignment for Continual Pre-Training of Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Abbes, Istabrak, Subbaraj, Gopeshh, Riemer, Matthew, Islah, Nizar, Therien, Benjamin, Tabaru, Tsuguchika, Kingetsu, Hiroaki, Chandar, Sarath, Rish, Irina
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866911089014341632
author Abbes, Istabrak
Subbaraj, Gopeshh
Riemer, Matthew
Islah, Nizar
Therien, Benjamin
Tabaru, Tsuguchika
Kingetsu, Hiroaki
Chandar, Sarath
Rish, Irina
author_facet Abbes, Istabrak
Subbaraj, Gopeshh
Riemer, Matthew
Islah, Nizar
Therien, Benjamin
Tabaru, Tsuguchika
Kingetsu, Hiroaki
Chandar, Sarath
Rish, Irina
contents Training large language models (LLMs) typically involves pre-training on massive corpora, only to restart the process entirely when new data becomes available. A more efficient and resource-conserving approach would be continual pre-training, where models are updated with new data rather than retraining from scratch. However, the introduction of new data often causes distribution shifts, leading to performance degradation on previously learned tasks. In this paper, we take a deeper look at two popular proposals for addressing this distribution shift within the continual learning literature: experience replay and gradient alignment. We consider continual pre-training of models within the Llama family of architectures at a large scale across languages with 100 billion tokens of training data in each language, finding that both replay and gradient alignment lead to more stable learning without forgetting. This conclusion holds both as we vary the model scale and as we vary the number and diversity of tasks. Moreover, we are the first to demonstrate the effectiveness of gradient alignment techniques in the context of LLM pre-training and propose an efficient implementation of meta-experience replay (MER) that imbues experience replay with the benefits of gradient alignment despite negligible compute and memory overhead. Our scaling analysis across model sizes and replay rates indicates that small rates of replaying old examples are definitely a more valuable use of compute than investing in model size, but that it is more compute efficient to scale the size of the model than invest in high rates of replaying old examples.
format Preprint
id arxiv_https___arxiv_org_abs_2508_01908
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Revisiting Replay and Gradient Alignment for Continual Pre-Training of Large Language Models
Abbes, Istabrak
Subbaraj, Gopeshh
Riemer, Matthew
Islah, Nizar
Therien, Benjamin
Tabaru, Tsuguchika
Kingetsu, Hiroaki
Chandar, Sarath
Rish, Irina
Machine Learning
Artificial Intelligence
Computation and Language
Training large language models (LLMs) typically involves pre-training on massive corpora, only to restart the process entirely when new data becomes available. A more efficient and resource-conserving approach would be continual pre-training, where models are updated with new data rather than retraining from scratch. However, the introduction of new data often causes distribution shifts, leading to performance degradation on previously learned tasks. In this paper, we take a deeper look at two popular proposals for addressing this distribution shift within the continual learning literature: experience replay and gradient alignment. We consider continual pre-training of models within the Llama family of architectures at a large scale across languages with 100 billion tokens of training data in each language, finding that both replay and gradient alignment lead to more stable learning without forgetting. This conclusion holds both as we vary the model scale and as we vary the number and diversity of tasks. Moreover, we are the first to demonstrate the effectiveness of gradient alignment techniques in the context of LLM pre-training and propose an efficient implementation of meta-experience replay (MER) that imbues experience replay with the benefits of gradient alignment despite negligible compute and memory overhead. Our scaling analysis across model sizes and replay rates indicates that small rates of replaying old examples are definitely a more valuable use of compute than investing in model size, but that it is more compute efficient to scale the size of the model than invest in high rates of replaying old examples.
title Revisiting Replay and Gradient Alignment for Continual Pre-Training of Large Language Models
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2508.01908