让大模型持续学习不遗忘,用重播和梯度对齐稳定训练。
Revisiting Replay and Gradient Alignment for Continual Pre-Training of Large Language Models
- 用经验重播与梯度对齐缓解新数据带来的遗忘问题。
- 在1000亿词跨语言训练中,避免旧任务性能下降。
- 首次证明梯度对齐适用于大模型预训练,效率高适合部署。
大规模语言模型通常需在海量语料上预训练,但当新数据出现时,往往需要从头开始。更高效的方法是持续预训练,即在不重新训练的前提下更新模型。然而,新数据常引发分布偏移,导致旧任务性能下降。本文深入研究了两类持续学习中的方法:经验重播与梯度对齐。我们在多语言环境下对Llama系列模型进行大规模持续预训练,每语言使用1000亿词数据,发现二者均能有效提升学习稳定性并减少遗忘。该结论在不同模型规模及任务数量与多样性下均成立。我们首次在大模型预训练中验证梯度对齐的有效性,并提出一种高效的元经验重播(MER)实现,在几乎无额外计算与内存开销下融合梯度对齐优势。跨模型规模与重播率的扩展分析表明,小比例重播比扩大模型规模更高效;而扩大模型规模又比高比例重播更节省算力。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。