纪元锯齿现象:揭示Adam及其他优化器中的训练损失振荡
The Epochal Sawtooth Phenomenon: Unveiling Training Loss Oscillations in Adam and Other Optimizers
AI总结:
本文识别并分析了Adam等自适应优化器训练中的纪元锯齿现象(ESP),揭示其源于二阶矩估计导致的自适应学习率调整及数据洗牌中的样本即时重曝光效应,并通过高维二次任务验证其普遍性。
摘要:
在本文中,我们识别并分析了一种反复出现的训练损失模式,我们将其称为“纪元锯齿现象(ESP)”,这种现象在使用自适应梯度优化器(尤其是Adam优化器)训练时普遍存在。该模式的特征是每个纪元开始时损失急剧下降,随后逐渐增加,形成锯齿状的损失曲线。通过实证观察,我们证明虽然这种效应在Adam中最为显著,但在其他优化器(如RMSProp)中也会出现,尽管程度较轻。我们实证分析了ESP背后的机制,重点关注Adam的β参数、批量大小、数据洗牌和样本替换等关键因素。我们的分析表明,ESP源于由二阶矩估计控制的自适应学习率调整。此外,我们识别出数据洗牌过程中的“样本即时重曝光”效应,这导致模型在每个纪元开始时学习或记忆更多。我们还发现,较小的β2值会加剧ESP,但可以起到一种正则化的作用。虽然ESP不一定表示过拟合,但更高的模型容量会放大该现象。为进一步支持我们的分析,我们通过一个高维二次最小化任务复现了ESP。我们证明,即使在简单的优化场景中,ESP也会出现,这强化了该模式的普遍性。复现我们实验的代码可在https://github.com/qiliuchn/training-loss-pattern获取。
英文摘要:
In this paper, we identify and analyze a recurring training loss pattern, which we term the \textit{Epochal Sawtooth Phenomenon (ESP)}, commonly observed during training with adaptive gradient-based optimizers, particularly Adam optimizer. This pattern is characterized by a sharp drop in loss at the beginning of each epoch, followed by a gradual increase, resulting in a sawtooth-shaped loss curve. Through empirical observations, we demonstrate that while this effect is most pronounced with Adam, it persists, although less severely, with other optimizers such as RMSProp. We empirically analyze the mechanisms underlying ESP, focusing on key factors such as Adam's $β$ parameters, batch size, data shuffling, and sample replacement. Our analysis shows that ESP arises from adaptive learning rate adjustments controlled by the second moment estimate. Additionally, we identify the ``immediate re-exposure to samples'' effect during data shuffling, which causes the model to learn or memorize more at the beginning of each epoch. We also find that smaller values of $β_2$ exacerbate ESP but can act as a form of regularization. While ESP is not necessarily indicative of overfitting, higher model capacity can amplify the phenomenon. To further support our analysis, we replicate ESP through a high-dimensional quadratic minimization task. We demonstrate that ESP can emerge even in simple optimization scenarios, reinforcing the generality of this pattern. The code for reproducing our experiments is available at https://github.com/qiliuchn/training-loss-pattern.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。