[Paper Review] Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits
The paper systematically studies Exponential Moving Average (EMA) of weights in deep learning, showing EMA improves generalization, calibration, robustness to label noise, prediction consistency, and transfer learning when used outside the training loop.
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.
Motivation & Objective
- Motivate and evaluate weight averaging via EMA as a standalone technique outside the training loop.
- Characterize the training dynamics of EMA and its implicit regularization effects.
- Assess EMA’s impact on generalization, calibration, robustness to label noise, and transfer learning.
Proposed method
- Study EMA dynamics on SGD trajectories with equation x_EMA,t+1 = alpha x_EMA,t + (1-alpha) x_{t+1}; analyze effects of alpha and BN statistics.
- Compare EMA to SGD baseline and to SWA across multiple datasets and architectures.
- Use cosine annealing for learning rate with early stopping to tune regularization strength and EMA decay.
- Investigate BN statistics handling and the impact of recomputing BN stats on EMA performance.
Experimental results
Research questions
- RQ1How do EMA dynamics differ from standard SGD in terms of convergence and generalization?
- RQ2Can EMA serve as a simple, low-overhead plug-in to improve final model properties without affecting SGD trajectory?
- RQ3What are EMA’s effects on robustness to label noise, calibration, prediction consistency, and transfer learning?
- RQ4How do BN statistics and EMA decay interact to affect generalization and stability?
Key findings
- EMA consistently improves test accuracy over the SGD baseline across datasets and architectures, and performs comparably to SWA.
- EMA reduces prediction churn and improves JS divergence, indicating higher prediction consistency between independent runs.
- EMA enhances robustness to label noise and can rival specialized robust-training methods in some settings.
- Transfer learning with EMA representations yields better linear separability on frozen backbones than SGD alone.
- BN statistics play a critical role; recomputing BN stats allows larger averaging windows and better generalization.
- Using EMA early in training provides strong early performance, explaining EMA teachers’ success, and may reduce total training compute when combined with early stopping.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.