Simple and Scalable Strategies to Continually Pre-train Large Language Models
作者: Adam Ibrahim, Benjamin Thérien, Kshitij Gupta, Mats L. Richter, Quentin Anthony, Timothée Lesort, Eugene Belilovsky, Irina Rish
分类: cs.LG, cs.AI, cs.CL
发布日期: 2024-03-13 (更新: 2024-09-04)
💡 一句话要点
提出简单可扩展策略以持续预训练大型语言模型
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 持续学习 学习率调整 数据重放 自然语言处理
📋 核心要点
- 现有方法在新数据引入时,往往导致模型在旧数据上的性能下降或对新数据的适应性差。
- 本文提出结合学习率重热、重衰和数据重放的策略,以实现高效的持续预训练。
- 实验结果表明,该方法在多个评估基准上与完全重新训练的性能相当,且计算资源消耗显著降低。
📝 摘要(中文)
大型语言模型(LLMs)通常在数十亿个标记上进行预训练,但一旦有新数据可用,就会重新开始训练。本文提出了一种更高效的持续预训练方法,结合学习率重热、学习率重衰和以前数据的重放,能够在多个语言模型评估基准上匹配从头开始完全重新训练的性能。我们展示了在弱分布转移(英语到英语)和强分布转移(英语到德语)下,使用405M参数模型和数百亿标记的数据集,持续学习策略能够与10B参数LLM的重新训练基线相匹配。我们的结果表明,LLMs可以通过简单且可扩展的持续学习策略成功更新,计算资源节省显著。
🔬 方法详解
问题定义:本文旨在解决大型语言模型在新数据引入时性能下降的问题。现有方法在面对新数据时,通常需要重新训练,导致计算资源浪费和适应性不足。
核心思路:论文提出了一种简单而可扩展的持续预训练策略,通过学习率重热、重衰和以前数据的重放,来有效应对分布转移带来的挑战。这样的设计旨在保持模型在旧数据上的性能,同时提高对新数据的适应能力。
技术框架:整体架构包括三个主要模块:学习率调整模块、数据重放模块和模型评估模块。学习率调整模块负责动态调整学习率以适应不同阶段,数据重放模块用于保持旧数据的影响,而模型评估模块则用于验证模型在各项基准上的表现。
关键创新:最重要的技术创新在于提出了一种结合学习率重热和重衰的策略,能够有效减少因学习率调整而导致的遗忘现象。这与传统的固定学习率策略有本质区别。
关键设计:在参数设置上,学习率的重热和重衰采用了非线性调度策略,损失函数则基于标准的交叉熵损失,网络结构保持与现有大型语言模型一致,确保了实验的可比性。通过这些设计,模型能够在保持性能的同时,减少计算资源的消耗。
🖼️ 关键图片
📊 实验亮点
实验结果显示,使用提出的持续学习策略,模型在多个语言模型评估基准上的表现与完全重新训练的基线相当,且在405M和10B参数模型上均实现了显著的计算资源节省。这表明该方法在实际应用中具有良好的可行性和有效性。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和机器翻译等。通过持续预训练,模型能够更快速地适应新数据,提高实际应用中的响应能力和准确性。未来,这种方法可能会在大规模语言模型的更新和维护中发挥重要作用,降低计算成本并提升效率。
📄 摘要(原文)
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$\rightarrow$English) and a stronger distribution shift (English$\rightarrow$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.