学习率退火下的缩放定律
Scaling Law with Learning Rate Annealing
AI总结:
本文提出带学习率退火的损失缩放定律,仅拟合少量训练曲线即可预测不同调度器下任意步数的损失,并扩展至模型规模效应。
摘要:
我们发现,神经语言模型的交叉熵损失曲线在经验上遵循一种随训练步数进行学习率(LR)退火的缩放定律:$$L(s) = L_0 + A\cdot S_1^{-α} - C\cdot S_2,$$其中$L(s)$是第$s$步的验证损失,$S_1$是LR曲线下面积,$S_2$是LR退火面积,而$L_0$、$A$、$C$、$α$为常数参数。该公式考虑了两个因素:(1)数据规模上的幂律缩放,以及(2)LR退火期间额外的损失下降。因此,该公式能够描述每一步的完整损失曲线,而非训练结束时的单一损失点。应用带LR退火的缩放定律,并仅拟合一条或两条训练曲线,我们就能准确预测任意学习率调度器(LRS)下任意给定步数的损失。该方法显著降低了构建缩放定律时的计算成本,同时为训练动态提供了更高的准确性和表达能力。大量实验表明,我们的发现在一系列超参数和模型架构中均成立,并且该方程可以扩展到模型规模的缩放效应。此外,我们的公式为以往众多研究中观察到的经验结果(尤其是关注LR调度和退火的研究)提供了准确的理论验证与解释。我们相信,这项工作有望增进对LLM训练动态的理解,同时极大推动缩放定律的普及,并能指导研究人员为后续LLM改进训练策略(例如关键LRS)。
英文摘要:
We find that the cross-entropy loss curves of neural language models empirically adhere to a scaling law with learning rate (LR) annealing over training steps: $$L(s) = L_0 + A\cdot S_1^{-α} - C\cdot S_2,$$ where $L(s)$ is the validation loss at step $s$, $S_1$ is the area under the LR curve, $S_2$ is the LR annealing area, and $L_0$, $A$, $C$, $α$ are constant parameters. This formulation takes into account two factors: (1) power-law scaling over data size, and (2) the additional loss reduction during LR annealing. Therefore, this formulation can describe the full loss curve at each step, rather than the single loss point at the end of training. Applying the scaling law with LR annealing and fitting only one or two training curves, we can accurately predict the loss at any given step across any learning rate scheduler (LRS). This approach significantly reduces computational cost in formulating scaling laws while providing more accuracy and expressiveness for training dynamics. Extensive experiments demonstrate that our findings hold across a range of hyper-parameters and model architectures, and our equation can extend to scaling effect of model sizes. Moreover, our formulation provides accurate theoretical verification and explanation for empirical results observed in numerous previous studies, particularly those focusing on LR schedule and annealing. We believe that this work is promising to enhance the understanding of LLM training dynamics while greatly democratizing scaling laws, and it can guide researchers in refining training strategies (e.g. critical LRS) for further LLMs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。