Share from 0:00
0:00
/

The AdEMAMix Optimizer: Better, Faster, Older

The Podcast is generated with Google's Illuminate, the tool trained on AI & science-related Arxiv papers.

Cool idea in this Paper from @Apple Researchers.

Claims that AdamW requires 95% more training tokens (ie, 1.95x as many gradient updates) than their proposed optimizer to reach the same loss.🀯

1.3B parameter AdEMAMix LLM trained on 101B tokens performs comparably to AdamW model trained on 197B tokens (+95%)

πŸ“š https://arxiv.org/abs/2409.03137

Results πŸ“Š:

β€’ Consistently outperforms AdamW on language modeling and vision tasks

β€’ Improves optimization stability and convergence speed

β€’ Forgets training data more slowly than AdamW

Original Problem πŸ”:

Current momentum-based optimizers use a single Exponential Moving Average (EMA) of gradients, which cannot effectively balance giving high weight to recent gradients and non-negligible weight to older gradients.

-----

Key Insights from this Paper πŸ’‘:

β€’ Gradients can remain relevant for tens of thousands of steps

β€’ A single EMA cannot simultaneously emphasize recent and older gradients

β€’ Combining two EMAs with different decay rates can leverage both recent and old gradient information

β€’ Older gradients help converge faster and often to lower minima

β€’ AdEMAMix significantly slows down model forgetting during training

-----

Solution in this Paper πŸ› οΈ:

β€’ Introduces AdEMAMix optimizer with two momentum terms:

- Fast EMA (low Ξ²) for adapting to recent landscape changes

- Slow EMA (high Ξ²) for leveraging very old gradients

β€’ Uses schedulers to gradually increase Ξ± (mixing coefficient) and Ξ²3 (slow EMA decay rate)

β€’ Modifies Adam update rule:

ΞΈ(t) = ΞΈ(t-1) - Ξ· * ((mΜ‚1(t) + Ξ±m2(t)) / √(Ξ½Μ‚(t) + Ξ΅) + λθ(t-1))

β€’ Initializes m2 to zero when switching from AdamW mid-training

Discussion about this video

User's avatar

Ready for more?