arXiv · 2411.18704
Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits
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.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Daniel Morales-Brotons, Thijs Vogels, Hadrien Hendrikx. 2024-11-27. Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits. https://arxiv.org/abs/2411.18704
Cite the original work for its findings. Save a collection to share your selection of sources.