[论文解读] Noise Is Not the Main Factor Behind the Gap Between SGD and Adam on Transformers, but Sign Descent Might Be
本文挑战了‘重尾随机梯度噪声是Adam在Transformer中优于SGD的主要原因’这一假设。相反,研究发现Adam在全批量训练设置下仍优于SGD,且该优势源于Adam的行为类似于带动量的符号下降,表明驱动性能差距的关键并非噪声鲁棒性,而是确定性的自适应梯度归一化。
The success of the Adam optimizer on a wide array of architectures has made it the default in settings where stochastic gradient descent (SGD) performs poorly. However, our theoretical understanding of this discrepancy is lagging, preventing the development of significant improvements on either algorithm. Recent work advances the hypothesis that Adam and other heuristics like gradient clipping outperform SGD on language tasks because the distribution of the error induced by sampling has heavy tails. This suggests that Adam outperform SGD because it uses a more robust gradient estimate. We evaluate this hypothesis by varying the batch size, up to the entire dataset, to control for stochasticity. We present evidence that stochasticity and heavy-tailed noise are not major factors in the performance gap between SGD and Adam. Rather, Adam performs better as the batch size increases, while SGD is less effective at taking advantage of the reduction in noise. This raises the question as to why Adam outperforms SGD in the full-batch setting. Through further investigation of simpler variants of SGD, we find that the behavior of Adam with large batches is similar to sign descent with momentum.
研究动机与目标
- 探究重尾随机梯度噪声是否为Adam在Transformer模型中优于SGD的主要原因。
- 通过将批量大小增加至全批量训练,评估随机性的作用。
- 探究为何Adam在低噪声、全批量设置下仍优于SGD,此时噪声影响应最小。
- 识别是否确定性特性(如梯度符号自适应)更能解释性能差距。
- 检查Adam在大批次设置下的行为是否类似于带动量的符号下降,从而为其实现提供新的理论解释。
提出的方法
- 在语言建模任务(PTB、Wikitext2、SQuAD)和图像任务(MNIST、CIFAR-10)上,对SGD和Adam在不同批量大小下进行实验评估,包括全批量训练。
- 使用QQ图将随机梯度误差(‖g − g̃‖)的分布与正态分布和α稳定分布进行比较,以评估尾部的厚重程度。
- 在全批量设置下分析优化器行为,以消除随机噪声,从而隔离确定性因素。
- 将Adam的更新动态与带动量的符号下降进行比较,尤其关注坐标级梯度符号估计的表现。
- 通过消融研究和简化优化器,隔离符号更新和动量的影响。
- 进行超参数的网格搜索,并报告训练损失趋势,使用验证指标支持泛化性能的洞察。
实验结果
研究问题
- RQ1SGD与Adam在Transformer上的性能差距是否主要由重尾随机梯度噪声驱动,如先前假设的那样?
- RQ2随着批量大小增加,特别是当噪声被最小化时,SGD与Adam之间的性能差距如何变化?
- RQ3Adam在全批量设置下仍表现更优,是否意味着噪声鲁棒性并非其成功的主要因素?
- RQ4Adam在大批次训练中的行为在多大程度上类似于带动量的符号下降?
- RQ5Transformer中哪些架构或优化特性导致其与CNN在图像任务上的SGD与Adam性能差距更大?
主要发现
- 即使在全批量设置下(随机噪声被消除),SGD与Adam之间的性能差距依然存在,这与‘噪声鲁棒性是Adam成功主因’的假设相矛盾。
- 随着批量大小增加,Adam持续优于SGD,而SGD并未从噪声减少中获益,表明该差距并非由噪声引起。
- Adam在大批次训练中的行为与带动量的符号下降高度相似,表明坐标级符号估计可能是其优势的根源。
- 在语言任务中,梯度误差分布的QQ图分析表明,其尾部并不如先前声称的那般厚重,因此性能差距不能由重尾梯度噪声解释。
- 在CIFAR-10等图像任务(使用ResNet18)上,SGD与Adam的差距更小且不一致,表明架构差异(如批量归一化)可能影响优化器行为。
- 在训练损失上表现更好的优化器也更快实现更低的验证损失,表明在此设置下,训练动态与泛化性能密切相关。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。