直接到零:为什么线性衰减学习率到零在大语言模型中效果最佳
Straight to Zero: Why Linearly Decaying the Learning Rate to Zero Works Best for LLMs
AI总结:
本研究发现线性衰减到零的学习率调度在训练大语言模型时效果最佳,相比其他调度方式具有显著优势。
摘要:
大语言模型通常使用学习率(LR)预热,随后进行余弦衰减到最大值的10%(10倍衰减)。在大规模实证研究中,我们显示,在最优峰值LR下,简单的线性衰减到零(D2Z)调度在训练时最优数据集大小时,始终优于其他调度方式。D2Z在各种模型大小、批大小、数据集和词汇量中均表现优异。随着数据集大小的增加,优势也相应增加。通过一种新的AdamW解释,将其视为权重更新的指数移动平均,我们展示了线性D2Z如何最佳平衡早期训练(远离初始条件)和晚期训练(通过更多更新平均以减轻梯度噪声)的需求。在实验中,一个610M参数模型使用D2Z训练80个token每参数(TPP)时,其损失低于使用10倍衰减训练200 TPP的情况,对应着惊人的60%计算节省。如Llama2-7B模型,使用10倍衰减训练286 TPP时,可能通过使用D2Z训练可节省大部分计算资源。
英文摘要:
LLMs are commonly trained with a learning rate (LR) warmup, followed by cosine decay to 10% of the maximum (10x decay). In a large-scale empirical study, we show that under an optimal peak LR, a simple linear decay-to-zero (D2Z) schedule consistently outperforms other schedules when training at compute-optimal dataset sizes. D2Z is superior across a range of model sizes, batch sizes, datasets, and vocabularies. Benefits increase as dataset size increases. Leveraging a novel interpretation of AdamW as an exponential moving average of weight updates, we show how linear D2Z optimally balances the demands of early training (moving away from initial conditions) and late training (averaging over more updates in order to mitigate gradient noise). In experiments, a 610M-parameter model trained for 80 tokens-per-parameter (TPP) using D2Z achieves lower loss than when trained for 200 TPP using 10x decay, corresponding to an astonishing 60% compute savings. Models such as Llama2-7B, trained for 286 TPP with 10x decay, could likely have saved a majority of compute by training with D2Z.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。