# Poster 28625

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/28625

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

I'm David Granger and I'm going to talk today about the AdimaMix optimizer, an optimizer to get better model faster by using older updates. This work is by Matteo Pelagliardini in collaboration with Pierre Abland. Most of the models today are trained with the Adam optimizer which is a momentum-based optimizer.
Do Memento keep track of older gradients to go faster? In typical Adam, the gradients are kept for about six steps. In Adamomix, we want to keep track of gradients for a much longer timescale, over thousand steps old. And I will tell you how to do that.
In regular ADAM, the way we keep track of past gradient is with an exponential moving average, which is a way to keep track of past gradients with little memory. The EMA is controlled by a single beta parameters which trade off keeping track of the far past for a large beta and the recent past for small betas.
This trade-off is an exponential trade-off, meaning that if you give a high weight to the recent past, like the blue curve here for example, you mechanically give a very low weight for the far past and the converse is true as well. If you give a high weight to the far past, you give a very low weight to the recent past.
So this is not very flexible. In particular in optimizer you want to react to a recent change in the low loss landscape, meaning that you want to have a decent amount of weight on the recent past. Mechanically this removes some weight on the far past if you have this EMA. In a DEMA mix we do suggest a simple solution which is to use a mixture of two EMA terms instead.
So we just do the linear combination of two EMA terms with different betas, which give extra flexibility. For example, you can do a trade-off between summing the red and the blue curve at the same time. So you could have high weight on the recent past and this slowly decaying far past tracking as well.
This is very simple to do you change only two lines in the regular Adam you keep track of the extra EMA term and when you are about to use those EMA terms you just do an inner combination between them
The results are shown in these plots here for language modeling with transformers. You see three model sizes and different number of tokens. In all cases you will see that the Adamax optimizer in red end up with a lower loss than the Adam optimizer or conversely you get the same loss earlier when you use Adamax so you can train the models faster.
We have a lot more results in the paper. We use a state-space model or recurrent nets. We show results on vision transformers. We show results with larger models. We also show results with a trick to make the ADIMAMICS optimizer use as little memory as ADAM. If we want to look a bit why ADIMAMICS work,
It's because one reason is that it minimize forgetting. Those curves they quantify forgetting. So for example here we see the Adam average training loss and here we see the loss on a single batch of data which is seen at this step and what we see is that the loss on this batch drops a lot when you see the batch in training and then it goes back to the average behavior. That's forgetting this batch is no longer special.
When we use a DimaMix, we see that the same thing does not happen. The batch gets much better when you see it and then that forgetting is way slower. So that's one reason why a DimaMix work better. So I thank you for your attention. Of course, welcome to come to my poster and also you can read the paper. You can also use optimizer because it's available in PyTorch.
It's also available in OP-DEX and then you can start saving on your training times and therefore saving on training costs. Thank you very much.
