Simple and Scalable Strategies to Continually Pre-train Large Language Models

大型语言模型(LLMs)通常会在数十亿个标记上进行预训练,一旦有新数据可用,就会重新开始这个过程。一个更加高效的解决方案是不断地预训练这些模型,相比重新训练可以节省大量计算资源。然而,由新数据引起的分布变化通常会导致以前数据的性能下降或新数据的适应性不佳。在这项工作中,我们展示了一种简单且可扩展的学习率(LR)重新升温、LR重新衰减和重放以前数据的组合,足以匹配使用所有可用数据从头开始完全重新训练的性能,这是通过最终损失和语言模型(LM)评估基准来衡量的。具体而言,我们展示了在两个常用的LLM预训练数据集(英语$\rightarrow$英语)之间的一个弱但现实的分布变化和一个更强的分布变化(英语$\rightarrow$德语)下,具有$405$M参数模型规模和大型数据集大小(数百亿个标记)的情况下,这种方法是可行的。选择较大规模的实验的弱但现实的变化,我们还发现我们的持续学习策略可以匹配10B参数LLM的重新训练基线。我们的结果表明,LLMs可以通过简单和可扩展的持续学习策略成功地进行更新,而只使用一小部分计算资源即可匹配重新训练的基线。最后,受以前的工作启发,我们提出了替代余弦学习率调度的方法,帮助规避由LR重新升温引起的遗忘,并且不受固定标记预算的限制。
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 final loss and 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.
许愿