Skip to main content
QUICK REVIEW

[论文解读] Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits

Daniel Morales Brotons, Thijs Vogels|arXiv (Cornell University)|Nov 27, 2024
Machine Learning and Data ClassificationComputer Science被引用 16
一句话总结

本论文系统地研究深度学习中权重的指数移动平均(EMA),结果显示 EMA 能提高泛化、校准、对标签噪声的鲁棒性、预测一致性以及在训练循环外使用时的迁移学习效果。

ABSTRACT

Weight averaging of Stochastic Gradient Descent (SGD) iterates is a popular method for training deep learning models. While it is often used as part of complex training pipelines to improve generalization or serve as a `teacher' model, weight averaging lacks proper evaluation on its own. In this work, we present a systematic study of the Exponential Moving Average (EMA) of weights. We first explore the training dynamics of EMA, give guidelines for hyperparameter tuning, and highlight its good early performance, partly explaining its success as a teacher. We also observe that EMA requires less learning rate decay compared to SGD since averaging naturally reduces noise, introducing a form of implicit regularization. Through extensive experiments, we show that EMA solutions differ from last-iterate solutions. EMA models not only generalize better but also exhibit improved i) robustness to noisy labels, ii) prediction consistency, iii) calibration and iv) transfer learning. Therefore, we suggest that an EMA of weights is a simple yet effective plug-in to improve the performance of deep learning models.

研究动机与目标

  • 将 EMA 作为训练循环之外的独立技术来激励并评估权重平均。
  • 表征 EMA 的训练动态及其隐含的正则化效应。
  • 评估 EMA 对泛化、校准、对标签噪声的鲁棒性以及迁移学习的影响。

提出的方法

  • 研究在 SGD 路径上的 EMA 动态,方程为 x_EMA,t+1 = alpha x_EMA,t + (1-alpha) x_{t+1};分析 alpha 和 BN 统计的影响。
  • 在多个数据集和架构上将 EMA 与 SGD 基线以及 SWA 进行比较。
  • 使用余弦退火学习率并结合早停来调整正则化强度与 EMA 衰减。
  • 研究 BN 统计的处理以及重新计算 BN 统计对 EMA 表现的影响。

实验结果

研究问题

  • RQ1就收敛性和泛化而言,EMA 动态与标准 SGD 有何不同?
  • RQ2EMA 是否可以作为一个简单、低开销的插件,在不影响 SGD 路径的前提下提升最终模型属性?
  • RQ3EMA 对标签噪声鲁棒性、校准、预测一致性和迁移学习的影响是什么?
  • RQ4BN 统计与 EMA 衰减如何交互以影响泛化和稳定性?

主要发现

  • EMA 在各数据集和架构上持续优于 SGD 基线的测试准确度,并且与 SWA 相当。
  • EMA 降低预测抖动并提升 JS 散度,表示独立运行之间的预测更一致。
  • EMA 提高对标签噪声的鲁棒性,在某些设置下可以与专门的鲁棒训练方法相媲美。
  • 使用 EMA 表示的迁移学习在冻结的骨干网络上比仅使用 SGD 的线性可分性更好。
  • BN 统计起着关键作用;重新计算 BN 统计允许更大的平均窗口并获得更好的泛化。
  • 在训练早期使用 EMA 提供强劲的早期表现,解释了 EMA 教师的成功,并在结合早停时可能减少总训练计算量。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。