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

📄 arXiv: 2508.01908v1 📥 PDF

作者: Istabrak Abbes, Gopeshh Subbaraj, Matthew Riemer, Nizar Islah, Benjamin Therien, Tsuguchika Tabaru, Hiroaki Kingetsu, Sarath Chandar, Irina Rish

分类: cs.LG, cs.AI, cs.CL

发布日期: 2025-08-03


💡 一句话要点

提出持续预训练方法以解决大语言模型的分布偏移问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 持续预训练 大语言模型 经验重放 梯度对齐 分布偏移 机器学习 自然语言处理

📋 核心要点

  1. 现有的大语言模型训练方法在新数据出现时需要完全重启,导致资源浪费和性能下降。
  2. 论文提出通过持续预训练,结合经验重放和梯度对齐技术,来应对分布偏移问题。
  3. 实验结果显示,在不同模型规模和任务多样性下,采用新方法能显著提高学习稳定性,减少遗忘现象。

📝 摘要(中文)

训练大型语言模型(LLMs)通常需要在庞大的语料库上进行预训练,但在新数据出现时往往需要完全重启训练。本文提出了一种更高效的持续预训练方法,通过引入新数据来更新模型,而非从头开始训练。研究表明,经验重放和梯度对齐能够有效应对分布偏移,提升模型的学习稳定性,避免遗忘。我们首次在LLM预训练中展示了梯度对齐技术的有效性,并提出了一种高效的元经验重放实现,能够在几乎不增加计算和内存开销的情况下,结合经验重放与梯度对齐的优势。

🔬 方法详解

问题定义:本文旨在解决在持续预训练过程中,由于新数据引入导致的分布偏移问题。现有方法通常需要从头开始训练,造成计算资源的浪费和性能的下降。

核心思路:论文提出的核心思路是结合经验重放和梯度对齐技术,以实现更稳定的学习过程。通过不断更新模型而非重启训练,来有效应对新数据带来的挑战。

技术框架:整体架构包括持续预训练的模型更新流程,主要模块包括经验重放机制和梯度对齐策略。通过这两个模块的协同作用,提升模型在新任务上的表现。

关键创新:本文的主要创新在于首次在LLM预训练中有效应用梯度对齐技术,并提出了一种高效的元经验重放实现,能够在几乎不增加计算和内存开销的情况下,结合两者的优势。

关键设计:在参数设置上,实验中探索了不同的模型规模和重放率,发现小比例的旧样本重放比增加模型规模更具计算效率,同时也提出了相应的损失函数设计以优化学习过程。

📊 实验亮点

实验结果表明,结合经验重放和梯度对齐的持续预训练方法在不同模型规模和任务多样性下均表现出更高的学习稳定性。具体而言,模型在新任务上的性能提升幅度达到了X%,显著优于传统的重启训练方法,且计算效率更高。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和机器翻译等。通过提升大语言模型在新数据环境下的学习能力,能够更好地适应不断变化的用户需求和数据分布,从而提高实际应用的效果和用户体验。未来,该方法可能推动更高效的模型更新机制在各类智能系统中的广泛应用。

📄 摘要(原文)

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.