Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits

Daniel Morales-Brotons, Thijs Vogels, Hadrien Hendrikx
11/27/2024
cs.LG

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{moralesbrotons2024exponential,
  title  = {Exponential Moving Average of Weights in Deep Learning: Dynamics and Benefits},
  author = {Daniel Morales-Brotons and Thijs Vogels and Hadrien Hendrikx},
  year   = {2024},
  eprint = {2411.18704},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.18704v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.18704.svg)](https://codeofpaper.com/paper/2411.18704)

Discussion