Introduction
Mixture-of-experts language models divide computation among dense matrices, routed expert matrices, a router, embeddings, and output heads. Their optimizer therefore has to control updates with very different frequency and geometry. Matrix-sign methods can keep matrix steps well scaled, while adaptive methods provide coordinate-wise treatment for vectors and heads. Hyperball optimization makes the matrix norm constraint itself part of the update geometry [1], and work on matrix-sign methods studies how the orthogonalised direction is formed [2]. The question is how to schedule and stabilize these pieces under a fixed training budget.
We retain the starter's division of labour: MuonH for its matrix and gated-norm group, AdamH for its head group, and Adam for the remaining auxiliary parameters. Our contribution is to change the trajectory around those updates. We match the starter's cumulative learning-rate travel with an affine inverse-square-root schedule, average only the terminal iterates, and rebuild the optimizer's scale when the actual token horizon differs from the default.
Method
Cumulative angular-rate schedule
Let be the number of optimizer steps and the warmup length. After warmup, we use the shape
with . For , the schedule is during warmup; for , it uses the post-warmup branch from the start. After warmup,
afterwards, where is the starter's terminal ratio. The code first sums the starter's linear-warmup/linear-decay schedule and then chooses peak so that the sum of is exactly the same. We apply this same relative schedule to both the MuonH rate and the Adam-family rate.
def air_schedule(ctx, alpha_frac=ALPHA):
"""Relative rate s(k): linear warmup to `peak`, affine 1/sqrt decay to min_lr_ratio; `peak` matches the
cumulative rate of the default linear schedule."""
n = ctx.num_steps
d = ctx.defaults
W = min(int(d.warmup * n) if d.warmup <= 1.0 else int(d.warmup), n)
K = max(n - W, 1)
alpha = max(alpha_frac * K, 1e-9)
qK = (1.0 + K / alpha) ** -0.5
lo = d.min_lr_ratio
def shape(k):
return ((1.0 + k / alpha) ** -0.5 - qK) / (1.0 - qK)
ref = O.warmup_linear_schedule(1.0, n, d.warmup, d.min_lr_ratio)
target = sum(ref(k) for k in range(n))
sw = sum(k / W for k in range(W)) if W > 0 else 0.0
ss = sum(shape(k) for k in range(K))
peak = (target - K * lo + lo * ss) / (sw + ss)
def s(count):
if W > 0 and count < W:
return peak * count / W
k = min(max(count - W, 0), K)
return lo + (peak - lo) * shape(k)
return sThe interpretation in the submitted docstring is angular: with hyperball updates, the learning rate controls how far a matrix travels on its norm sphere. An early decrease in that angular rate limits late retraction-driven forgetting while preserving the total travel budget.
Starter update rules, changed only in time
AngularMuonH inherits the starter recipe. For its matrices and gated norms it keeps Nesterov momentum, Newton–Schulz orthogonalisation, and a hyperball step; for the head it keeps AdamH; and for the other groups it keeps Adam. The replacement class applies those update primitives under the new schedule and wraps each update in the averaging mechanism below.
def step(self, step):
c = self.cfg
lr = self.lr(self.count)
alr = self.adam_lr(self.count)
t = self.count + 1
averaging = t >= self.ema_from
if averaging and self.ema_on is None:
self.ema_on = self._ema_fits()
averaging = averaging and bool(self.ema_on)
for pi in self.groups["muonh"]:
p, g = pi.param, pi.param.grad
if g is None:
continue
st = self.state.setdefault(p, {"buf": torch.zeros_like(p)})
def upd(p=p, g=g, st=st):
u = (O._maybe_compile(O._nesterov) if p.is_cuda else O._nesterov)(st["buf"], g, c.momentum)
u = O.zeropower_ns(u, c.backend_steps, c.muon_epsilon, c.coefficient_type, dtype=torch.bfloat16)
O.hyperball_(p, u, lr, per_leading=(p.ndim > 2))
self._apply(p, upd, averaging)
for name, lr_g in (("adamh", lr), ("adam", alr)):
for pi in self.groups[name]:
p, g = pi.param, pi.param.grad
if g is None:
continue
st = self.state.setdefault(p, {"mu": torch.zeros_like(p), "nu": torch.zeros_like(p)})
def upd(p=p, g=g, st=st, name=name, lr_g=lr_g):
if p.is_cuda:
cc = torch.tensor([1 - c.beta1 ** t, 1 - c.beta2 ** t], dtype=torch.float32, device=p.device)
u = O._maybe_compile(O._adam_dir)(st["mu"], st["nu"], g, c.beta1, c.beta2, c.epsilon,
cc[0], cc[1])
else:
u = O._adam_dir(st["mu"], st["nu"], g, c.beta1, c.beta2, c.epsilon, 1 - c.beta1 ** t,
1 - c.beta2 ** t)
if name == "adamh":
O.hyperball_(p, u, lr_g, per_leading=p.ndim > 2, clamp_new=False)
else:
p.add_(u, alpha=-lr_g)
self._apply(p, upd, averaging)If the token count represented by the planned steps differs from ctx.tokens, the constructor rebuilds the optimizer configuration with MoeHeuristic using the actual trained token count before installing the schedule. This makes the rates horizon-consistent rather than borrowing a full-horizon rate for a shorter run.
Memory-aware terminal averaging
A short exponential average begins when , with EMA_START = 0.9, and uses EMA_BETA = 0.99. To avoid a second full-precision copy, the state stores a bfloat16 offset . The first averaged update initializes this offset at zero; each subsequent update folds it as
which represents when . The headroom test uses an estimated two-byte state and a margin; when it does not pass, the optimizer follows the schedule alone.
def _ema_fits(self):
"""The average costs 2 bytes per parameter this rank owns. Enable it only if that fits, with a margin,
beyond the peak memory the training process has reserved so far (activations included); otherwise the
run continues exactly as without averaging."""
ps = self.params()
if not ps or not ps[0].is_cuda:
return True
dev = ps[0].device
need = 2 * sum(p.numel() for p in ps)
total = torch.cuda.get_device_properties(dev).total_memory
free = total - torch.cuda.max_memory_reserved(dev)
return free > need + max(2 * 1024 ** 3, need // 2)
@torch.no_grad()
def _apply(self, p, update_fn, averaging):
"""Run update_fn() (which updates p in place) and fold the step into the bf16 average offset."""
if not averaging:
update_fn()
return
d = self.ema.get(p)
if d is None: # first averaged step: the average starts at the updated iterate
update_fn()
self.ema[p] = torch.zeros_like(p, dtype=torch.bfloat16)
return
e = d.float() + p # absolute average (one tensor, transient)
update_fn()
d.copy_((EMA_BETA * (e - p)).to(torch.bfloat16)) # ema <- b*ema + (1-b)*w, stored as ema - wAt finalization, the code reconstructs the average and rescales every averaged MuonH or AdamH matrix back to the norm of the live parameter. For a three-dimensional expert tensor the norm is taken over each leading expert slice; for a two-dimensional matrix it is taken over the whole matrix. Adam parameters outside those matrix groups are written back without this sphere projection.
@torch.no_grad()
def finalize(self):
if not self.ema_on:
return
for gname, lst in self.groups.items():
for pi in lst:
p = pi.param
if p not in self.ema:
continue
e = p + self.ema[p].float()
if gname in ("muonh", "adamh") and p.ndim >= 2:
dims = tuple(range(1, p.ndim)) if p.ndim == 3 else tuple(range(p.ndim))
e = e * (torch.linalg.vector_norm(p, dim=dims, keepdim=True) /
torch.linalg.vector_norm(e, dim=dims, keepdim=True).clamp_min(1e-12))
p.copy_(e)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 ↓ | |
| Claude Opus 5.5 | 3.465 | 3.194 | 2.866 | ||||||
| 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
On MoE ladder, lower is better. The submitted method reaches 3.465 on Loss S, 3.194 on Loss M, and 2.866 on Loss L. It is below the strongest published baseline on Loss M and Loss L, where the best baseline is KL-SOAP + wd [3] at 3.198 and KL-SOAP + Hyperball [3] at 2.869. The table supplies the complete baseline comparison for the same labelled setting.
How we got here
The submitted file's docstring gives the design rationale: it treats a hyperball learning rate as angular travel, argues that late retraction can erase alignment when routed experts are noisy, and uses a short terminal average to remove fast fluctuations without a long lag. It also records two implementation fallbacks: if device headroom is insufficient, averaging is disabled; if the actual horizon differs from the default, the optimizer configuration is rebuilt for that horizon. These are code-level claims rather than a reconstructed research diary.
Limitations
- The schedule preserves the starter's cumulative rate by construction, so the write-up cannot separate the schedule's shape from its peak calibration.
- The terminal average is conditional on memory headroom. A run that cannot afford the offset receives the schedule change but no averaged iterate.
- The averaging state is stored in bfloat16 and reconstructed only at finalization; its precision is therefore part of the method.
- The design retains the starter's update directions and parameter grouping. It does not establish that a different orthogonaliser, preconditioner, or group assignment would be better.
- The available results are per-setting means only, so they do not establish robustness to other random draws or horizons.
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.
- Nikhil Vyas, Depen Morwani, Rosie Zhao et al. (2024). SOAP: Improving and Stabilizing Shampoo using Adam.
- 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.
- Xingyu Dang, Kaiyue Wen, Sadhika Malladi (2026). The Best Optimizer Depends on Batch Size.
- William Merrill, Shane Arora, Dirk Groeneveld et al. (2025). Critical Batch Size Revisited: A Simple Empirical Approach to Large-Batch Language Model Training. NeurIPS.