Introduction
The task fixes a mixture-of-experts transformer, its data, the order of that data and the number of training tokens for each model size, and asks for the optimizer: the update rule, how matrix updates are orthogonalised or preconditioned, how weight norms are controlled, how experts, router and embeddings are treated, and the batch-size and learning-rate schedules. The objective is the held-out cross-entropy after training, and the same algorithm must work across model sizes; only values computed from the size may differ.
The starting point is the Hyperball optimizer [1]: MuonH orthogonalises the momentum of every hidden matrix by a Newton–Schulz iteration [2] and moves the weight on a sphere of fixed Frobenius norm, and an Adam-type update with the same norm control (AdamH) or plain Adam handles the output head, embeddings, router, gates and gains. Recent benchmarking of pretraining optimizers [3] and of how the best optimizer changes with batch size [4] frame the problem. Among this task's own baselines, matrix-aware methods such as SOAP [5], KL-SOAP and the Muon variants lead AdamW, and batch size is itself one of the variables those studies compare. A fixed budget of tokens also leaves the batch size as a free variable: a small batch gives more updates per token early on, a large batch averages gradient noise later [6].
Three properties of this model shaped our design. The routed experts receive sparse and unequal gradients, which suggested treating them specially; our measurements did not support that, and we explain why in Section 4. The query and key projections are followed by a normalisation applied to each head separately, so the loss is invariant to rescaling each head on its own, yet the starter treats the fused projection as one matrix on one sphere. And the default batch is constant through training, although the right batch changes as training proceeds.
Method
We call the method PG-MuonH (product-geometry MuonH). It has three parts: a per-head update for the query and key projections, a staged batch schedule with square-root learning-rate scaling, and a separate AdamW treatment for every non-matrix parameter. All other hidden matrices, including the routed and shared experts, keep the starter's MuonH update.
Per-head Hyperball updates for queries and keys
A query or key projection with heads of width is split into blocks . The model normalises each head's query and key independently, so the forward pass is unchanged by for any positive . The weight therefore lives on a product of scale classes, not on one sphere. The starter applies one Newton–Schulz polar factor and one norm constraint to the whole of , which couples the heads' norms although the forward pass does not. We give each head its own state and its own step. With gradient block , momentum and Nesterov look-ahead,
where is the starter's Newton–Schulz orthogonalisation in bfloat16 and is its Hyperball step, which keeps each block's Frobenius norm fixed and moves it in the direction of by an amount set by . All blocks are processed as one batch along a leading head axis. Momentum, the number of Newton–Schulz steps and its coefficients are the task's defaults for the run. Every other matrix goes through the starter's MuonH update, with the learning rate set below.
@torch.no_grad()
def step(self, step):
lr = self.base.lr(self.count)
for pi in self.qk:
p, g = pi.param, pi.param.grad
if g is None:
continue
heads = p.shape[-1] // 128
ph = p.view(p.shape[0], heads, 128).transpose(0, 1)
gh = g.view(g.shape[0], heads, 128).transpose(0, 1)
st = self.state.setdefault(p, {})
if "buf" not in st:
st["buf"] = torch.zeros_like(ph)
buf = st["buf"]
buf.mul_(self.cfg.momentum).add_(gh)
u = self.cfg.momentum * buf + gh
u = O.zeropower_ns(u, self.cfg.backend_steps, self.cfg.muon_epsilon,
self.cfg.coefficient_type, dtype=torch.bfloat16)
O.hyperball_(ph, u, lr, per_leading=True)
info = self.base.step(step)
if self.adam is not None:
for group, schedule in zip(self.adam.param_groups, self.schedules):
group["lr"] = schedule(self.count)
self.adam.step()
self.count += 1
return infoStaged batch growth
The trainer lets the optimizer choose the number of sequences in every step, provided the total is the run's token budget. With the total number of sequences and the run's default batch, we use
where is the number of sequences already consumed, and the last step is shortened to finish exactly on . The first stage is always 16 sequences; the second is capped at the default, so for a run whose default batch is 16 sequences the schedule is the default constant batch. The planner checks that the steps sum to and that every batch divides evenly among the GPUs.
def batch_sizes(ctx):
total = ctx.tokens // ctx.seq_len
if total * ctx.seq_len != ctx.tokens:
raise ValueError("invalid token budget")
first = int(total * 0.276)
second = int(total * 0.827)
out, done = [], 0
while done < total:
if done < first:
b = 16
elif done < second:
b = min(32, ctx.batch_size)
else:
b = ctx.batch_size
b = min(b, total - done)
out.append(b)
done += b
if sum(out) != total or any(b <= 0 or b % ctx.world_size for b in out):
raise ValueError("invalid batch schedule")
return outThe schedules are indexed by the fraction of sequences consumed, , not by step count, so that fewer, larger steps late in training do not distort the decay. Every learning rate is multiplied by , the square-root rule. The hidden matrices decay linearly from the start, and the auxiliary groups hold their peak for 60% of the sequences and then decay linearly to zero:
Momentum and Adam's decay rates stay fixed through the batch changes.
def _schedule(self, peak, ctx, hidden):
sizes = batch_sizes(ctx)
total = sum(sizes)
cumulative = [0]
for b in sizes[:-1]:
cumulative.append(cumulative[-1] + b)
def lr(k):
k = min(k, len(sizes) - 1)
progress = cumulative[k] / total
if hidden:
eta = max(0.0, 1.0 - progress)
else:
eta = 1.0 if progress < 0.6 else max(0.0, (1.0 - progress) / 0.4)
return peak * eta * math.sqrt(sizes[k] / ctx.batch_size)
return lrThe auxiliary parameters and the hidden learning rate
The starter's AdamH and Adam groups are merged into one plain AdamW without weight decay or norm control, with a separate peak rate per kind of parameter: for the embedding, where is the embedding's initial scale, 0.00313 for the output head, router and attention gates, and 0.01 for the norm gains and any other vector. The betas are and , with the sequence length, which converts a constant defined for gradients summed over the loss-bearing tokens of a step into one for the averaged gradients this trainer supplies. The hidden matrices get a peak rate of 0.009. All these rates are multiplied by the ratio of the run's default Adam rate to a fixed reference value, so they follow the task's own size-dependent defaults. These values are carried over from the auxiliary treatment and learning rate of the KL-SOAP-H recipe for a batch of about 128K tokens in [4]; we did not tune them ourselves, and we found in development that this treatment was the largest single gain at small widths (Section 4).
class ProductGeometryMuon(O.PluginOptimizer):
def __init__(self, groups, ctx):
self.cfg = ctx.defaults
self.qk = [pi for pi in groups["muonh"] if pi.name.endswith("w_q") or pi.name.endswith("w_k")]
qk_params = {pi.param for pi in self.qk}
mats = [pi for pi in groups["muonh"] if pi.param not in qk_params]
self.base = O.MuonHRecipe({"muonh": mats, "adamh": [], "adam": []}, ctx, self.cfg)
self.base.lr = self._schedule(0.009 * self.cfg.adam_lr / REF_ADAM_LR, ctx, True)
aux = list(groups["adamh"]) + list(groups["adam"])
init_std = 0.5 / math.sqrt(ctx.hidden_dim)
rates = {"embedding": 0.3 * init_std, "lm_head": 0.00313, "router": 0.00313,
"attn_gate": 0.00313, "norm_gain": 0.01}
tr = self.cfg.adam_lr / REF_ADAM_LR
by_rate = {}
for pi in aux:
peak = rates.get(pi.kind, 0.01 if pi.param.ndim < 2 else 0.00313) * tr
by_rate.setdefault(peak, []).append(pi.param)
pg = [{"params": ps, "lr": peak} for peak, ps in sorted(by_rate.items())]
grad_scale = float(ctx.batch_size * (ctx.seq_len - 1))
cuda = any(p.is_cuda for g in pg for p in g["params"])
self.adam = torch.optim.AdamW(pg, betas=(0.434, 0.994), eps=1e-10 / grad_scale,
weight_decay=0.0, fused=cuda) if pg else None
self.schedules = [self._schedule(g["lr"], ctx, False) for g in pg]
self.aux_params = [pi.param for pi in aux]
self.state = {}
self.count = 0The method keeps no state beyond the starter's: one momentum buffer per hidden matrix, reshaped by head for queries and keys, and AdamW's two moments for the auxiliary parameters. It uses no extra passes over a step's batch.
Results
| Method | ① | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Held-out loss, small model ↓ | Held-out loss, medium model ↓ | Held-out loss, large model ↓ | Paloma loss, small model ↓ | Paloma loss, medium model ↓ | Paloma loss, large model ↓ | training PFLOPs, small model ↓ | training PFLOPs, medium model ↓ | training PFLOPs, large model ↓ | |
| Kimi K3.1 Pro | 3.497 | 3.199 | 2.868 | 3.874 | 3.568 | 3.216 | 72.71 | 381.6 | 2,637 |
| MuonH | 3.511 | 3.211 | 2.880 | 3.892 | 3.574 | 3.226 | 72.71 | 381.6 | 2,637 |
| KL-SOAP | 3.498 | 3.198 | 2.872 | 3.877 | 3.558 | 3.224 | 72.71 | 381.6 | 2,637 |
| KL-SOAP, Hyperball | 3.496 | 3.202 | 2.869 | 3.885 | 3.570 | 3.220 | 72.71 | 381.6 | 2,637 |
| SOAP | 3.525 | 2.894 | 3.938 | 3.638 | 3.268 | 72.71 | 381.6 | 2,637 | |
| PSGD-Kron | 3.592 | 3.275 | 2.902 | 3.988 | 3.664 | 3.259 | 72.71 | 381.6 | 2,637 |
| Scion | 3.551 | 3.249 | 2.899 | 3.966 | 3.660 | 3.275 | 72.71 | 381.6 | 2,637 |
| Muon | 3.557 | 3.981 | 3.674 | 3.287 | 72.71 | 381.6 | 2,637 | ||
| Polar Express | 3.551 | 2.892 | 3.973 | 3.640 | 3.259 | 72.71 | 381.6 | 2,637 | |
| Muon, tuned polynomials | 3.552 | 2.892 | 3.975 | 3.638 | 3.255 | 72.71 | 381.6 | 2,637 | |
| Muon, fixed polynomial | 3.544 | 3.955 | 3.637 | 3.256 | 72.71 | 381.6 | 2,637 | ||
| MuonW | 3.526 | 3.959 | 3.669 | 3.299 | 72.71 | 381.6 | 2,637 | ||
| NorMuon | 3.547 | 3.980 | 3.666 | 3.290 | 72.71 | 381.6 | 2,637 | ||
| Shampoo | 3.602 | 3.301 | 2.945 | 3.980 | 3.669 | 3.299 | 72.71 | 381.6 | 2,637 |
| AdamH | 3.624 | 4.017 | 3.646 | 3.280 | 72.71 | 381.6 | 2,637 | ||
| NAdamW | 3.624 | 4.040 | 3.666 | 3.314 | 72.71 | 381.6 | 2,637 | ||
| AdamW | 3.640 | 4.079 | 3.735 | 3.337 | 72.71 | 381.6 | 2,637 | ||
| MARS-AdamW | 3.616 | 3.306 | 2.954 | 4.017 | 3.695 | 3.322 | 72.71 | 381.6 | 2,637 |
| Schedule-Free AdamW | 3.670 | 3.325 | 2.954 | 4.077 | 3.718 | 3.315 | 72.71 | 381.6 | 2,637 |
| Lion | 3.647 | 3.311 | 2.954 | 4.068 | 3.727 | 3.335 | 72.71 | 381.6 | 2,637 |
| LionW, 128K batch | 3.584 | 3.977 | 3.651 | 3.303 | 72.71 | 381.6 | 2,637 | ||
| MuonH, stable-then-decay | 3.536 | 3.266 | 3.916 | 3.626 | 3.276 | 72.71 | 381.6 | 2,637 | |
| MuonW, 128K batch | 3.526 | 2.934 | 3.959 | 3.669 | 3.355 | 72.71 | 381.6 | 2,637 | |
| MuonW, stable-then-decay | 3.523 | 3.952 | 3.655 | 3.287 | 72.71 | 381.6 | 2,637 | ||
| MuonW, batch warmup | 3.508 | 3.209 | 2.889 | 3.916 | 3.602 | 3.263 | 72.71 | 381.6 | 2,637 |
| MuonW, batch switch | 3.555 | 3.225 | 2.878 | 3.948 | 3.597 | 3.240 | 72.71 | 381.6 | 2,637 |
| MuonH, 128K batch | 3.511 | 3.211 | 3.892 | 3.574 | 3.234 | 72.71 | 381.6 | 2,637 | |
| AdamW, 128K batch | 3.640 | 4.079 | 3.735 | 3.395 | 72.71 | 381.6 | 2,637 | ||
- ① Grug MoE scaling ladder of three sizes, 330M / 747M / 2.04B parameters trained on 0.66B / 1.44B / 4.42B tokens · the curve of held-out loss against training compute over the ladder
PG-MuonH improves on the MuonH starter on every reported loss. The held-out loss of the small model is 3.497 against 3.511, of the medium model 3.199 against 3.211, and of the large model 2.868 against 2.880. The training compute is the same as the starter's on all three sizes, since the token budget is fixed and the method adds no passes.
Against the strongest baselines the picture is close. On the large model our held-out loss of 2.868 is the lowest in the table; the best baseline there is KL-SOAP + Hyperball [5] at 2.869. On the small model we reach 3.497, against 3.496 for KL-SOAP + Hyperball [5], and on the medium model 3.199, against 3.198 for KL-SOAP + wd [5]; both differences are in the fourth decimal place, so on these two sizes we are level with the KL-SOAP baselines rather than ahead of them. The batch-warmup baseline [6], whose staged schedule is closest to ours, reaches 3.508, 3.209 and 2.889, above our values on all three sizes.
The Paloma losses follow the same pattern with one exception. We have the lowest Paloma loss on the small model, 3.874, and on the large model, 3.216, but on the medium model our 3.568 is behind KL-SOAP with weight decay at 3.558.
How we got here
Our final design is narrower than the one we set out to build. Most of the mechanisms we designed were measured, did not hold up, and were removed.
- Noise-aware steps for the experts did not help. We began from the observation that MuonH gives every active expert the same relative step after discarding the gradient's magnitude, although routed experts see few, noisy gradients. Redistributing the step across experts by an estimated signal-to-noise ratio, normalised to keep the mean step, was neutral in our development runs. Our diagnostics showed why: every expert was active, but the estimated reliability of the gradient fell from about 0.33 to about 0.001 during training and consecutive gradient and momentum directions were often negatively aligned, so suppressing steps where the signal is weak suppresses nearly all of them. Sharing the second-moment estimate across experts while keeping each expert's own polar update was also neutral, a change of 0.00028 nats in our development measurement.
- Slow momentum in flat directions did not generalise. We added a second, slow momentum outside the top singular subspace of each matrix, transported along the sphere. It improved our smallest development model by 0.0144 nats, but was 0.0040 nats worse than the starter at the next width and not reliably better on a second training seed. An adaptive mixing coefficient and two cheaper spectral variants, a two-band reweighting and a single-state retention, were rejected; the cheaper ones were clearly worse.
- The auxiliary treatment was the largest single factor. Running the KL-SOAP-H baseline with the starter's auxiliary groups instead of its own made it worse than MuonH, while with its own it was far ahead. We concluded that most of its advantage came from how it treats the embeddings, output head and other non-matrix parameters and from its learning rates, not from its matrix preconditioner, and we moved that treatment under MuonH. In our development runs MuonH with this treatment improved on the starter by 0.0734 nats at our second width and tracked KL-SOAP-H closely.
- Changes to the embedding and the output head were abandoned. Updating each token's embedding row only when the token occurs, on its own sphere, was worse, also after we corrected a scale error in its first version. For the output head, sharing the second moment across the vocabulary was unstable; AMSGrad on the Hyperball head improved the starter by 0.0171 nats but gave nothing once the stronger auxiliary treatment was in place; and a polar update of the output head was clearly worse by mid-training.
- Iterate averaging was rejected. A uniform average over the tail of training was worse on both of our held-out sets.
- The per-head update came from the model's normalisation. Noticing that the queries and keys are normalised per head led to the per-head update. Its effect was small and positive in most pairs and tied or negative in others: 0.0055 nats under the starter's auxiliary treatment and 0.0018 under the stronger one at our second width; at that width a second training seed gave a loss of 0.0014 and a third a gain of 0.0044, and a full-length run at a larger width gave a gain of 0.00345 nats, all in our development runs. We kept it because it never regressed by a meaningful amount and because it follows from a symmetry of the model; the idea of normalising queries and keys per head is older, but the per-head optimizer step is ours.
- A constant small batch was good early and bad later. Following the batch of about 128K tokens at which the KL-SOAP recipe was tuned [4], we first trained wide models at a constant 16 sequences per step. This was a large gain at matched tokens early in training, 0.046 nats at the end of one development run, but in other runs it fell behind the default batch from mid-training on. That is the pattern a growing critical batch predicts [6], and it led to the staged schedule, whose switch points we took from the task's batch-warmup reference. In our development runs, on shortened but fully decayed schedules, the staged schedule beat the default batch with fused query and key updates by about 0.013 nats at two wide models and by much more at the two widest, so these margins belong to the schedule and the per-head update together; against the default batch with the same per-head update the margins were positive, smaller at the same seed and between 0.009 and 0.053 nats in further runs.
- Changing momentum with the batch was worse. Doubling the batch at fixed momentum doubles the momentum's averaging horizon in tokens, so we tried lowering the momentum (and, separately, Adam's decay rates) at each batch change to keep the horizon fixed in tokens, , with the momentum buffer rescaled at the switch. All variants were worse after the switch, the hidden-only one by 0.046 nats in our development measurement. Our reading is that the square-root learning-rate rule already keeps the angular noise of an update roughly constant, so the momentum horizon in steps need not change.
- Growing the batch beyond the default hurt our smallest model. The batch-warmup reference grows the batch to 64 at every size. Applied to our method at our smallest width this was 0.048 nats worse than capping the schedule at the default batch, and the reference itself did worse still, so we cap at the default.
Two further ideas guided the work without a citable source in our reference list: the argument that the efficient batch grows with the gradient noise scale, from the empirical model of large-batch training, and the normalisation of queries and keys over the head dimension. We state both without citation.
Limitations
- Most of the gain is borrowed. The largest improvement over the starter in our development runs came from the auxiliary treatment and hidden learning rate carried over from a published KL-SOAP-H recipe [4], not from a mechanism of our own. Its constants, including the rates for the output head, router and gates, are copied, not derived, and are transferred across sizes only through the ratio of the task's default Adam rates.
- The per-head update is small and seed-sensitive. In our development runs its effect was a few thousandths of a nat, with one negative pair and several ties. We have no evaluated ablation that isolates it, so its share of the final result is unknown.
- The batch schedule is partly taken over. The switch points 0.276 and 0.827 come from the task's batch-warmup reference, not from a measurement of the critical batch in this model, and the first stage size of 16 sequences is fixed for every size. When the default batch is 16 sequences the schedule is constant, so the batch component acts only on sizes whose default batch is larger.
- We are not ahead of KL-SOAP everywhere. On the small and medium models our held-out loss is within the third decimal place of the KL-SOAP baselines and behind the best of them, and on the medium model our Paloma loss is behind KL-SOAP with weight decay.
- Several development comparisons were shortened. At the widest models our development comparisons of the batch schedule used shortened schedules with full decay, not the full token budget, so the size of those margins at full length is not established.
- The implementation assumes a head width of 128. The query and key split hard-codes it, and is set from the default batch even while a smaller batch is in use.
References
- Kaiyue Wen, Xingyu Dang, Kaifeng Lyu et al. (2026). Fantastic Pretraining Optimizers and Where to Find Them II: Hyperball Optimization.
- Noah Amsel, David Persson, Christopher Musco et al. (2026). The Polar Express: Optimal Matrix Sign Methods and Their Application to the Muon Algorithm. ICLR.
- Kaiyue Wen, David Hall, Tengyu Ma et al. (2026). Fantastic Pretraining Optimizers and Where to Find Them. ICLR.
- Xingyu Dang, Kaiyue Wen, Sadhika Malladi (2026). The Best Optimizer Depends on Batch Size.
- Nikhil Vyas, Depen Morwani, Rosie Zhao et al. (2024). SOAP: Improving and Stabilizing Shampoo using Adam.
- William Merrill, Shane Arora, Dirk Groeneveld et al. (2025). Critical Batch Size Revisited: A Simple Empirical Approach to Large-Batch Language Model Training. NeurIPS.
- Xi-Lin Li (2018). Preconditioned Stochastic Gradient Descent. IEEE Transactions on Neural Networks and Learning Systems.
- Thomas Pethick, Wanyun Xie, Kimon Antonakopoulos et al. (2025). Training Deep Learning Models with Norm-Constrained LMOs. ICML.
- Zichong Li, Liming Liu, Chen Liang et al. (2026). NorMuon: Making Muon more efficient and scalable. ICML.
- Vineet Gupta, Tomer Koren, Yoram Singer (2018). Shampoo: Preconditioned Stochastic Tensor Optimization. ICML.
- George E. Dahl, Frank Schneider, Zachary Nado et al. (2023). Benchmarking Neural Network Training Algorithms.
- Ilya Loshchilov, Frank Hutter (2019). Decoupled Weight Decay Regularization. ICLR.
- Huizhuo Yuan, Yifeng Liu, Shuang Wu et al. (2025). MARS: Unleashing the Power of Variance Reduction for Training Large Models. ICML.
- Aaron Defazio, Xingyu Alice Yang, Harsh Mehta et al. (2024). The Road Less Scheduled. NeurIPS.
- Xiangning Chen, Chen Liang, Da Huang et al. (2023). Symbolic Discovery of Optimization Algorithms. NeurIPS.