Chip Foundry Services Request Assessment

Exponential Moving Average

EMA (Exponential Moving Average) is an optimization technique that maintains a shadow copy of model weights as an exponentially weighted moving average — the EMA model is used for evaluation/inference while the original model is used for gradient-based training.

How Does EMA Work?

  • Update: After each training step: theta_EMA = alpha · theta_EMA + (1-alpha) · theta_train (typically alpha = 0.999 or 0.9999).
  • Train: The main model theta_train is updated by the optimizer normally.
  • Evaluate: Use theta_EMA for validation, testing, and deployment.
  • Smooth: EMA averages out the noise from individual gradient updates.

Why It Matters

  • Standard Practice: EMA is used in virtually all modern training recipes (ViT, diffusion models, LLMs).
  • Free Accuracy: Typically 0.3-1.0% accuracy improvement at no additional training cost.
  • Stability: The EMA model is more stable and less susceptible to overfitting than the raw model.

EMA is the smooth shadow model — maintaining a running average of weights that captures the model's best state throughout training.