| Momentum | |
|---|---|
| gradient of a hidden matrix on step t | |
| decay rate of a single EMA (0.95); Nesterov mixing coefficient (0.95) | |
| single-EMA momentum; update before orthogonalization, | |
| number of EMA buffers; buffer index, 1 to K, shortest memory first | |
| buffer k; its decay rate; its mean age in steps | |
| weight of buffer k at step t; mixed momentum | |
| weight of the gradient from a steps ago in | |
| Benchmark | |
| number of runs; their mean validation loss in nats | |
| Constants | |
| Track 3's target loss; the margin in | |
| shortest and longest buffer mean ages on Muon, in steps | |
| mean age of the Muon mix at step 1000 and at step 3250 | |
| switch step on Muon; number of annealing steps after it | |
Context. In Muon, as in Adam, the momentum is a single exponential moving average (EMA)a running average updated as , so the gradient from steps ago carries weight ; is the decay rate of past gradients with one fixed decay rate, 0.95 in the speedrun's Muon. Jack Neo Zheng's post K-Maxwell Momentum, with Jeffrey Cheng as collaborator, asks what a more flexible momentum is worth when everything else is already tuned. The test bed is Track 3the optimization track of the modded-nanogpt speedrun: model, data and batch size are fixed, one forward-backward pass per step, and an entry is scored by the number of optimizer steps it needs to reach a validation loss of 3.28 of the NanoGPT speedrun. Mixing several EMAs is older (AggMo, Lucas et al., 2019, averages momentum buffers with different decay rates); the post builds on two recent two-EMA mixes, AdEMAMixPagliardini et al. (2025): Adam with a second, slow EMA of gradients added to the fast one; the slow buffer's weight and decay rate are ramped up over training to avoid early instability and Bi-MaxwellHu et al. (2026): Muon whose momentum is a fixed mix of two EMAs, of one with decay 0.85 plus of one with decay 0.98, from a model of momentum as a stress that relaxes on a fast and a slow timescale (a Maxwell element relaxes exponentially). A momentum is a weighting of past gradients by their age; the post's results suggest that the shape of that weighting matters beyond its average age, and the shape that helped here keeps a long tail of old gradients and shortens as training ends.
K-Maxwell keeps eight EMA buffers whose memories are fixed and evenly spaced on a log scale from 3 to 64 steps, and changes only how they are mixed: from step 1000 to the end of training it moves the mixture weights linearly from a mix whose mean gradient age, the average age in steps of the gradients in the momentum, where is the weight the momentum puts on the gradient from steps ago; 19 steps for a single EMA with decay 0.95 is 58 steps to one whose mean age is 26. On Track 3's tuned Muon baseline this reached the target in 3160 steps instead of 3250 (2.8% fewer), and on MuonHMuon with a hyperball constraint: each hidden weight matrix is kept at a fixed norm after every step in 3065 instead of 3125 (1.9%); on the SOAP-Muonthe stack that holds Track 3's overall record (2690 steps): Muon whose momentum is first preconditioned with SOAP's row and column gradient statistics, plus several other changes stack it did not help. The schedule carries the gain: the same eight buffers with fixed weights did not beat the baseline in any configuration tried (Step 4). Why it works is open; the post's explanations, about gradient noise, curvature and the edge of stabilitythe regime, observed by Cohen et al. (2021) in full-batch training, in which the largest Hessian eigenvalue rises until it hovers near , the stability limit of gradient descent at learning rate , while the loss keeps falling, are not tested (Step 6).
Setting. Track 3 trains GPT-2 small (124M parameters) on FineWeb with 524,288 tokens per step; only the optimizer, its hyperparameters and the initialization may change. An entry passes at the first checked step where the mean validation loss the validation cross-entropy in nats, averaged over the independent runs of the entry of the number of independent runs (seeds) submitted, all reported runs satisfies , a one-sided z-test at that assumes a run-to-run standard deviation of 0.0013 nats. For each hidden matrix, write the gradient of the training loss with respect to that matrix on step 's batch for its gradient. The baseline Muon keeps one EMA with , mixes it with the new gradient in the Nesterovlook-ahead form of momentum: the step uses , the new gradient plus the updated buffer, in place of alone form with , and orthogonalizes with Newton-Schulz steps before taking the step. K-Maxwell replaces only; the Nesterov mix, the orthogonalization, the learning rates and their schedule stay those of the baseline (Track 3 result #36).
Consequences and limits. For someone training with Muon, the change is a few lines in the momentum plus two tuned weight vectors, for a few percent fewer steps on this benchmark and seven extra buffers per matrix, a memory cost the post calls prohibitive at very large scale. The endpoint mixes were tuned jointly with the Nesterov coefficient for one model, one data set and one training length. The anneal also spans the same steps as the learning-rate decay, linear to zero from step 975 in this trainer, and the post does not separate the two (my reading of the trainer), so a different schedule likely needs new endpoints.
A mixture of EMAs is a weighting of past gradients by age, and its mean age is linear in the weights. Let there be the number of EMA buffers: 8 on Muon, 6 on MuonH and SOAP-Muon buffers with decay rates the fixed decay rate of buffer , set from its mean age by , mixed with weights the weight of buffer at step ; the weights are nonnegative and sum to 1 into . Unrolling each EMA (ignoring how the buffers were started) gives the weight the memory kernel: the weight the mixed momentum puts on the gradient from steps before step on each past gradient: Write the mean age of buffer in steps, ; its newest gradient has weight for buffer 's mean age; the mixture's mean age is then , linear in the weights, so interpolating the weights moves it linearly, from 58 steps to 26. The mean age does not fix the shape. In the post's example a single EMA with and an equal mix of EMAs with mean ages 3 and 35 both have mean age 19, but the newest gradient gets 5% of the weight in the first and 13.9% in the second. The tuned mixes differ the same way (my computation from the published weights): the final mix has the single EMA's median age, 13 steps, yet puts 0.11 of its weight on gradients older than 64 steps against 0.04; the starting mix puts 0.33 there.
# m: the 8 buffers; betas: their decay rates
# w_start, w_end: the two tuned mixes; g: this step's gradient
for k in range(8):
m[k] = betas[k] * m[k] + (1 - betas[k]) * g
frac = (step - 1000) / 2250 # 0 at step 1000, 1 at step 3250
w = [(1 - frac) * w_start[k] + frac * w_end[k] for k in range(8)]
m_mix = sum(w[k] * m[k] for k in range(8))
u = (1 - mu) * g + mu * m_mix # Nesterov mix, mu = 0.95
update = newton_schulz5(u) # Muon's orthogonalization
On tuned Muon, K-Maxwell passes 90 steps before the single EMA and 50 before Bi-Maxwell. Eight seeds were evaluated every 10 steps from 2900 to 3250. At step 3150 the statistic is , short of 0.004; at 3160 the mean is 3.27794 and the statistic 0.0058. The seeds' own first crossings of 3.28 average 3141 steps; the reported step is later because the mean must sit nats below the target. Against the single-EMA baseline's ten runs the gap is significant at equal steps by the track's two-sample form of the rule, at step 3250. K-Maxwell's mean loss is also below Bi-Maxwell's at every checked step from 2900 to 3250, by 0.0072 nats at 2900 and 0.0034 at 3250.
The annealing carries the gain, transfers to MuonH, and fails on the SOAP-Muon stack. Per the experiment report, fixed-weight eight-buffer mixes did not beat the baseline in any configuration tested, even after extensive tuning; the first annealed schedules won clearly. On MuonH the recipe, lightly retuned (six buffers, switch at step 750, mean age 50 to 22), passes at 3065 against 3125. The SOAP-Muon record stack also evaluates a Tail-EMAan exponential moving average of the weights over the last few hundred steps, evaluated in place of the final weights of the weights. On it a fixed six-buffer mix with mean age 35 passes at 2680 against 2690, not significant at equal steps (two-sample statistic 0.0010). Bi-Maxwell on that stack passes at 2635 and, per the authors' companion report, beats their mix in a paired comparison; annealing made the loss worse. The post attributes the failure to overlap between momentum and SOAP's preconditioning, the companion report to Tail-EMA, which already averages the end of training; neither is tested.
At larger batches K-Maxwell keeps its gain and Bi-Maxwell loses it. From three seeds' step-2000 states, Muon with momentum off (), single-EMA Muon, Bi-Maxwell and K-Maxwell were each run to step 2750 at 1, 2, 4, 8 and 16 times the standard batch. Against momentum off at the same seed and batch, K-Maxwell lowered the validation loss by 0.0047 to 0.0067 nats at every batch size, while Bi-Maxwell's gain fell from 0.0105 nats at the standard batch to 0.0020 at 8 times and at 16 times, with seed-to-seed standard deviations of about 0.0002 or less. A larger batch already averages noise within the step, so a gain that comes only from averaging noise across steps should fade as the batch grows; the post reads K-Maxwell's persistent gain as doing more than that. The post's text leaves out two features of the table, both stated in the authors' linked ablation log. At the standard batch Bi-Maxwell's gain is twice K-Maxwell's, the reverse of the full runs in Step 3 (my comparison), so these short continuations do not reproduce the full-run ordering. And single-EMA Muon is within 0.0004 nats of momentum off at every batch size: over these steps ordinary momentum gives no measurable gain, and what the mixtures add is something a 19-step EMA does not provide.
The post's explanations are untested. They are that long memory keeps persistent gradient directions early and short memory reacts faster to oscillations late, near the edge of stability; that mixing very different timescales cancels recurring errors, loosely like Richardson extrapolationcombining estimates computed at different step sizes so that their leading error terms cancel; and that at large batches K-Maxwell lets training reach sharper regions. None of the experiments measures curvature or oscillation. The direction of the schedule is also open: the Bi-Maxwell paper's model predicts that the best memory grows over training, because gradient directions change more slowly later, and AdEMAMix lengthens its memory, as the post notes; K-Maxwell's memory jumps from the single EMA's 19 steps to 58 at step 1000 and then shortens.
Terms
- K-Maxwell
- EMA buffers with fixed log-spaced mean ages (3 to 64 steps), mixed by weights interpolated linearly from a long-memory mix to a shorter one
- Memory kernel
- , the weight of the gradient from steps ago in the momentum
- Mean gradient age
- , linear in the weights; it does not fix the kernel's shape
- Annealed mix
- mean age 58 at step 1000 to 26 at step 3250 on Muon; fixed weights never beat the baseline
- Switch at step 1000
- all buffers start from the single EMA's value, so the switch step's update equals the baseline's
- Track 3 pass rule
- : a one-sided z-test at assuming run-to-run standard deviation 0.0013 nats
- Bi-Maxwell
- fixed mix of two EMAs (decays 0.85 and 0.98, mean age 30); its gain fades at large batch
- Edge of stability
- largest Hessian eigenvalue hovering near , the stability limit of gradient descent at learning rate
- Results
- Muon 3250 to 3160 steps; MuonH 3125 to 3065; SOAP-Muon no significant gain
Quiz
- A single EMA with decay 0.95 and an equal mix of EMAs with mean ages 3 and 35 both have mean age 19 steps. What separates them?The newest gradient gets from each EMA: 5% for the single EMA, for the mix, whose 35-step component also leaves a heavier tail. Same mean, different shape.
- On the SOAP-Muon record stack, K-Maxwell passed at 2680 steps against 2690. What should a practitioner conclude?At equal steps the statistic is 0.0010, below 0.004; Bi-Maxwell reaches 2635 on the same stack, and annealing the mix made validation loss worse. The post and the companion report give two different untested reasons (SOAP overlap, Tail-EMA).
- In the batch-size continuations, single-EMA Muon with momentum 0.95 is within 0.0004 nats of momentum off at every batch size. What does that imply for reading the mixtures' gains?If ordinary momentum adds nothing measurable here while K-Maxwell lowers the loss by 0.005 to 0.007 nats at every batch size and Bi-Maxwell by up to 0.0105, the difference lies in the kernel's shape, such as its longer tail, and not in having momentum at all.
- You keep Muon and the model but switch to a different learning-rate schedule. What does the note suggest about reusing K-Maxwell's endpoints?In this trainer the learning rate decays linearly to zero from step 975, over the same steps as the anneal, and the endpoints were tuned for that run. The post does not separate the two effects, so the endpoints may not carry over.
Sources
- Jack Neo Zheng. K-Maxwell Momentum. Blog post, 2026.
- Jack Neo Zheng and Jeffrey Cheng. Record: Track 3 optimization, K-Maxwell annealed momentum on the tuned Muon baseline, 3160 steps (n=8). Experiment report, GitHub, 2026.
- Yinze Hu, Hongjun Xiang, Xingao Gong, and Hongyu Yu. A Physical Response-and-Memory Model for Muon Optimization. arXiv preprint, 2026.
- Matteo Pagliardini, Pierre Ablin, and David Grangier. The AdEMAMix Optimizer: Better, Faster, Older. ICLR, 2025.
- James Lucas, Shengyang Sun, Richard Zemel, and Roger Grosse. Aggregated Momentum: Stability Through Passive Damping. ICLR, 2019.
- Jeremy Cohen, Simran Kaur, Yuanzhi Li, J. Zico Kolter, and Ameet Talwalkar. Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability. ICLR, 2021.