[论文解读] Continual Pre-Training of Large Language Models: How to (re)warm your model?
本论文研究大语言模型的持续预训练的热身策略,表明重新热身学习率可以在提升下游适应性的同时影响上游遗忘,并且从最近的检查点重新热身比从头训练更好。
Large language models (LLMs) are routinely pre-trained on billions of tokens, only to restart the process over again once new data becomes available. A much cheaper and more efficient solution would be to enable the continual pre-training of these models, i.e. updating pre-trained models with new data instead of re-training them from scratch. However, the distribution shift induced by novel data typically results in degraded performance on past data. Taking a step towards efficient continual pre-training, in this work, we examine the effect of different warm-up strategies. Our hypothesis is that the learning rate must be re-increased to improve compute efficiency when training on a new dataset. We study the warmup phase of models pre-trained on the Pile (upstream data, 300B tokens) as we continue to pre-train on SlimPajama (downstream data, 297B tokens), following a linear warmup and cosine decay schedule. We conduct all experiments on the Pythia 410M language model architecture and evaluate performance through validation perplexity. We experiment with different pre-training checkpoints, various maximum learning rates, and various warmup lengths. Our results show that while rewarming models first increases the loss on upstream and downstream data, in the longer run it improves the downstream performance, outperforming models trained from scratch$\unicode{x2013}$even for a large downstream dataset.
研究动机与目标
- 在有新数据可用时,将持续预训练作为比完全重新训练更便宜的替代方案来提出动机。
- 研究热身策略在持续预训练两大文本语料库上的遗忘和适应性影响。
- 确定在选择热身时长、最大学习率和检查点选择以在上游和下游性能之间取得平衡时的实用指南。
提出的方法
- 使用在Pile上进行预训练的410M Pythia模型作为上游数据,在SlimPajama(≈297B token)上继续预训练作为下游数据。
- 尝试线性热身和余弦衰减学习率计划。
- 改变热身长度(0–2% 的下游数据)和最大学习率(1.5e-4、3e-4、6e-4)。
- 通过对上游(Pile)和下游(SlimPajama)数据集的验证困惑度来评估性能。
- 测试不同的预训练检查点(最新、接近最大损失的早期点、以及一个介于两者之间的点)。
- 在相同时间表下,将持续预训练与从头训练进行比较。
实验结果
研究问题
- RQ1在持续预训练期间,热身阶段的长度是否显著影响下游或上游的困惑度?
- RQ2重新热身时的最大学习率如何影响下游改进与上游遗忘之间的权衡?
- RQ3当继续在与上游语料库(Pile)相似的数据上进行预训练,还是在一个截然不同的下游语料库(SlimPajama)上进行时,重新热身是否有益?
- RQ4在新数据的持续预训练中,早期检查点是否阻碍或有助于适配?
- RQ5在大规模下游数据集上,带有重新热身的持续预训练是否能超过从头训练?
主要发现
- 短热身长度(0–2% 的数据)对下游或上游困惑度没有显著影响。
- 较大的最大学习率提高下游性能,但增加对上游数据的遗忘;较小的学习率保留上游性能但限制下游适应。
- 使用衰减的余弦计划进行重新热身在下游性能上优于从头训练或常数LR基线,但在热身阶段初期存在不稳定性。
- 使用最新检查点的持续预训练优于从头训练,并且在下游结果上优于使用较早检查点。
- 在同一数据(Pile)上的重新热身也会引发稳定性差距,但仍可能带来下游收益,表明优化动力学超出分布转变的影响。
- 在各实验中,带热身的微调模型优于从头训练的模型;使用常数LR的早停在适应新分布方面可能更经济。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。