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










