training

Optimization

Choose the update geometry, its memory and its scale—then test them together.

Published 2026-04-10 · Updated 2026-10-28
On this page

A training loss supplies gradients. An optimizer turns those gradients into parameter changes. A schedule sets how large those changes can be over time. Batch size changes the estimate and the number of updates available for a fixed data budget.

These choices interact. A small raw gradient can produce a substantial adaptive update. A larger batch can reduce noise yet reduce progress per token. Begin with the actual update, then connect it to the experiment budget.

A gradient is not yet an update

gt=∇θLbatch(θt)Δθt=−ηtgt\begin{aligned}g_t&=\nabla_\theta L_{\mathrm{batch}}(\theta_t)\\\Delta\theta_t&=-\eta_t g_t\end{aligned}
η is learning rate. The gradient and update occupy parameter space but are different quantities.

For local quadratic curvature H, the estimated loss change is gTΔθ+12ΔθTHΔθg^{\mathsf T}\Delta\theta+\tfrac12\Delta\theta^{\mathsf T}H\Delta\theta. Descending the linear term is not enough if the quadratic term overwhelms it. On a positive quadratic eigenvalue λ, plain gradient descent requires 0<ηλ<2 for convergence along that direction.

Neither this local calculation nor a decreasing training loss proves good generalization. For the gradient and curvature geometry, see Differentiation and Optimization Geometry →. The loss definition → determines what improvement means.

Remember directions, not just the current batch

mt=βmt−1+(1−β)gt=(1−β)∑j=1tβt−jgj\begin{aligned}m_t&=\beta m_{t-1}+(1-\beta)g_t\\&=(1-\beta)\sum_{j=1}^{t}\beta^{t-j}g_j\end{aligned}
Zero-initialized normalized EMA; some momentum implementations omit (1−β), changing its raw scale.

An exponential moving average (EMA) gives recent gradients greater weight. Consistent directions accumulate; alternating directions cancel. After a direction changes, momentum initially continues to include the earlier direction.

The approximate memory is 11−β\frac{1}{1-\beta} steps when β is near one. The exact e-folding time is −1log⁡β-\frac{1}{\log\beta} for 0<β<10<\beta<1. At β=0.9\beta=0.9, the approximation is ten steps; at β=0.99\beta=0.99, one hundred. These are steps, not tokens: changing batch size changes the amount of data in that memory.

Momentum is not merely an independent learning-rate multiplier. In a nonstationary sequence it changes direction, response delay and correlations as well as scale. Nesterov variants read a different combination of current gradient and momentum; identify the implementation convention.

Watch a direction reverse

A gradient reversal reaches the buffer

Hold the assigned gradients fixed; change the memory coefficient.

burgundy: gradient; blue: raw EMAStep 0/12; β=0.9

No gradient processed. Raw buffer is zero; corrected estimate is not defined at t=0t=0. No update direction exists before the first gradient.

Assigned sequence [1,1,1,1,1,−1,−1,−1,−1,2,0,0]. Playback steps are optimizer steps in this illustration, not seconds of training.

Exact small input, not a speed benchmark. Step order follows the algorithm; playback is optional. Blue is the uncorrected buffer. The caption also reports bias correction. No autoplay.

Adapt coordinates with two moments

mt=β1mt−1+(1−β1)gtvt=β2vt−1+(1−β2)gt⊙2Δθtadaptive=−ηtm^tv^t+ε\begin{aligned}m_t&=\beta_1m_{t-1}+(1-\beta_1)g_t\\v_t&=\beta_2v_{t-1}+(1-\beta_2)g_t^{\odot2}\\\Delta\theta_t^{\mathrm{adaptive}}&=-\eta_t\frac{\widehat m_t}{\sqrt{\widehat v_t}+\varepsilon}\end{aligned}
Squares, division and square roots are coordinate-wise. m estimates a recent mean; v a recent raw second moment.

The numerator smooths direction. The denominator rescales coordinates according to recent magnitude. A persistently large coordinate gradient can receive a comparable normalized step to a smaller one. Adam still has one base learning rate, but effective coordinate updates differ.

v is not a covariance matrix or a Hessian estimate. Even v−m⊙2v-m^{\odot2} is only a variance-like diagnostic under compatible averaging/stationarity conditions; the two buffers usually use different β values. Calling Adam a second-order optimizer obscures this distinction.

Correct the startup, not all uncertainty

m^t=mt1−β1t,v^t=vt1−β2t\widehat m_t=\frac{m_t}{1-\beta_1^t},\qquad\widehat v_t=\frac{v_t}{1-\beta_2^t}
t starts at one. Zero-initialized EMAs underweight a stationary mean during startup.

For a constant gradient g, the correction recovers m^=g\widehat m=g and v^=g⊙2\widehat v=g^{\odot2} at every step. It does not make a noisy mini-batch equal to the full-data gradient, nor does it make the ratio unbiased.

When ε is negligible and g≠0, the first adaptive step is approximately −η sign(g), not proportional to |g|. This explains the sign-like intuition but does not make every later Adam step SignSGD. Momentum, changing magnitudes and ε matter.

ε affects very small-gradient coordinates. With g² far below ε², the denominator is ε-dominated; the sign approximation fails. Epsilon location also matters: v+ε\sqrt v+\varepsilon and v+ε\sqrt{v+\varepsilon} are different rules.

Keep shrinkage outside the moments

θt+1=(1−ηtλ)θt−ηtm^tv^t+ε\theta_{t+1}=(1-\eta_t\lambda)\theta_t-\eta_t\frac{\widehat m_t}{\sqrt{\widehat v_t}+\varepsilon}
λ is decoupled weight decay. It does not enter the gradient moments.

Adding λθ to the loss gradient causes Adam to accumulate and adapt that term. It is not the same as applying a uniform shrink factor outside the moments. For ordinary SGD without momentum, the two forms coincide under matching conventions.

For θ=10\theta=10, η=0.01\eta=0.01 and λ=0.1\lambda=0.1, decay subtracts 0.01 before considering the adaptive contribution. A constant gradient of 2 gives an adaptive subtraction near 0.01 at step one. These are separate effects; decay is not evidence that the training objective decreased.

Implementation order, skipped parameters and mixed precision matter. For example, a parameter with no gradient may be skipped rather than decayed. Use the actual optimizer rule, not a generic “Adam plus L2” label. AdamW algorithm ↗

Weight decay discounts update history

θt+1=(1−ηλ)θt−ηutθT=(1−ηλ)Tθ0−η∑t=0T−1(1−ηλ)T−1−tut\begin{aligned}\theta_{t+1}&=(1-\eta\lambda)\theta_t-\eta u_t\\\theta_T&=(1-\eta\lambda)^T\theta_0\\&\quad-\eta\sum_{t=0}^{T-1}(1-\eta\lambda)^{T-1-t}u_t\end{aligned}
Constant η and λ; u is the adaptive update direction evaluated along the actual trajectory.

For 0<ηλ≪1, an older contribution decays approximately as e−ηλke^{-\eta\lambda k}. Its e-folding timescale is about 1ηλ\frac{1}{\eta\lambda} steps. With η=10−4\eta=10^{-4} and λ=0.1\lambda=0.1, that is about 100K steps.

With a varying schedule, replace powers by products of (1−ηtλ)(1-\eta_t\lambda). Equal ηλ gives equal direct forgetting timescale, not equal training dynamics: changing η also changes the trajectory and future u. This is a useful interpretation of decay, not a proof that two recipes are interchangeable. Learning rate and decay as memory ↗

Read settings as a recipe, not a law

Values retained from the original baseline discussion; sweep for the actual stack
QuantityIllustrative candidateWhat changes
Peak η10⁻⁴ to 5×10⁻⁴Model, batch, data, duration and parametrization
β₁0.9Momentum response
β₂0.95; historical 0.999 also commonMagnitude-estimator response
ε10⁻⁸Small denominators and precision
λ0.1 or 0.01Decay history and parameter group
Global clip1.0Gradient threshold, not Adam-update bound
Precision / scheduleBF16; cosine or WSDNumerics and update history

These are candidate settings from the atlas sources, not package defaults or current universal recommendations. AdamW is a useful controlled baseline. Smaller β₂ reacts faster to scale changes but adds estimator variability. Higher β₁ smooths more and responds more slowly.

Why treat a matrix differently?

A hidden weight W is a linear map, not only a flattened parameter vector. Adam rescales entries separately. Elementwise SignSGD discards each entry’s magnitude. Muon instead normalizes the singular geometry of a momentum matrix.

M=UΣVT,polar⁡(M)=UrVrTM=U\Sigma V^{\mathsf T},\qquad\operatorname{polar}(M)=U_rV_r^{\mathsf T}
Keep singular vectors and replace nonzero singular values with one; r is the rank.

The rectangular partial polar factor is often called Muon’s “matrix sign.” This is not the analytic matrix-sign function based on eigenvalues of a square matrix. A rank-deficient matrix uses only nonzero singular directions.

Equivalently, polar⁡(M)=M[(MTM)1/2]†\operatorname{polar}(M)=M\left[(M^{\mathsf T}M)^{1/2}\right]^\dagger, where the dagger is the Moore–Penrose pseudoinverse. A diagonal matrix reduces to coordinate signs. A column vector instead becomes L2-normalized: treating a vector as a diagonal matrix versus a column gives different geometry.

A conceptual update is W←(1−ηλ)W−ηpolar⁡(M)W\leftarrow(1-\eta\lambda)W-\eta\operatorname{polar}(M), with optional shape scaling. Actual Muon implementations differ in momentum normalization, Nesterov combination, polynomial approximation and scale. Do not identify an ideal formula with every implementation.

The norm defines steepest descent

min⁡∥ΔW∥2≤η⟨G,ΔW⟩=−η∥G∥∗ΔW=−ηpolar⁡(G)is one minimizer\begin{aligned}\min_{\|\Delta W\|_2\le\eta}\langle G,\Delta W\rangle&=-\eta\|G\|_*\\\Delta W&=-\eta\operatorname{polar}(G)\quad\text{is one minimizer}\end{aligned}
∥⋅∥2\|\cdot\|_2 is spectral norm; ∥⋅∥∗\|\cdot\|_* is nuclear norm, the sum of singular values.

A spectral-norm budget limits the largest linear action of the update on a unit input. A Frobenius budget limits total flattened energy. They define different steepest directions.

For the quadratic penalty ∥ΔW∥22η+⟨G,ΔW⟩\frac{\|\Delta W\|^2}{2\eta}+\langle G,\Delta W\rangle, the Frobenius solution is −ηG. With spectral norm, one solution is −η∥G∥∗polar⁡(G)-\eta\|G\|_*\operatorname{polar}(G). The nuclear-norm multiplier matters: the constrained direction and the penalized update are not identical formulas without rescaling.

This explains the appeal of matrix-aware geometry, not why it must outperform Adam on every architecture. The momentum direction can also differ from the current gradient. Learning rates are meaningful only together with normalization and scaling conventions.

Approximate the polar direction without an SVD

Computing a full singular-value decomposition (SVD) per matrix per step is expensive. Newton–Schulz-style polynomial iterations use matrix multiplications instead. Start with X0=M∥M∥FX_0=\frac{M}{\|M\|_F}, with an explicit zero-matrix case.

Xk+1=aXk+bXk(XkTXk)+cXk(XkTXk)2σk+1=aσk+bσk3+cσk5\begin{aligned}X_{k+1}&=aX_k+bX_k(X_k^{\mathsf T}X_k)\\&\quad+cX_k(X_k^{\mathsf T}X_k)^2\\\sigma_{k+1}&=a\sigma_k+b\sigma_k^3+c\sigma_k^5\end{aligned}
A polynomial changes singular magnitudes while retaining singular vectors in exact arithmetic.

The Taylor-derived coefficients (15/8,−5/4,3/8) move normalized nonzero singular values toward one. Tiny singular values can need more iterations. Zero stays zero; finite precision can change effective rank.

The checked Muon implementation instead uses (3.4445,−4.7750,2.0315), BF16 and a small fixed iteration count. Its own explanation says it does not converge to exactly UVᵀ everywhere. This fast approximation is not the same as the ideal polar factor. Muon implementation ↗

Use XXᵀ instead of XᵀX when the row dimension is smaller; the corresponding algebraic multiplication order is equivalent. Transposing rectangular matrices reduces intermediate cost. Test accuracy and dtype on the actual shapes rather than assuming more iterations are always better.

Transform singular magnitudes step by step

From an ellipse toward balanced directions

Hold the singular vectors fixed. Only the magnitudes change.

Unit input circle → update ellipseσ₁=0.9950; σ₂=0.0995; step 0

Initial singular values 4, 0.4 are divided by their Frobenius norm at step zero. Left singular vectors stay fixed at a 30° rotation. Both axes use the same scale; the dashed circle has radius one.

Taylor coefficients target nonzero singular values approaching one. A zero singular value remains zero in every polynomial step. This is exact scalar polynomial arithmetic, not a BF16 kernel or learned weight spectrum.

Exact small input, not a speed benchmark. Step order follows the algorithm; playback is optional. The plot shows linear action on a unit circle, not an empirical training result.

Normalize shape-dependent update RMS

RMS⁡(polar⁡(M))=rnmr=min⁡(n,m)⟹RMS⁡=1max⁡(n,m)\begin{aligned}\operatorname{RMS}(\operatorname{polar}(M))&=\sqrt{\frac{r}{nm}}\\r=\min(n,m)\quad&\Longrightarrow\quad\operatorname{RMS}=\frac{1}{\sqrt{\max(n,m)}}\end{aligned}
For an n×m matrix, the squared Frobenius norm of the partial polar factor is r.

A full-rank 4×4 polar update has RMS 0.50; a 4×16 update has 0.25. Equal learning rates do not give equal entry-wise RMS.

The original Moonlight-style rule multiplies by 0.2max⁡(n,m)0.2\sqrt{\max(n,m)}, targeting RMS≈0.2 for full-rank ideal factors. Rank deficiency and approximate singular values change that equality. The 0.2 is an empirical calibration, not a mathematical constant.

The checked Keller Jordan code uses a different aspect-ratio factor, max⁡(1,n/m)\sqrt{\max(1,n/m)}, with its own learning-rate convention. Do not combine the two scaling recipes blindly. Track update RMS and update/weight ratios for each parameter group.

Choose which geometry is normalized together

A combined Q/K/V projection joins multiple heads into one stored matrix. Whole-matrix orthogonalization couples the heads through shared singular directions. Splitting by functional head changes that coupling.

Kimi K3’s original note describes per-head Muon; GLM-5 describes Muon Split for MLA Q/K/V up-projections. Each head’s momentum block is processed separately, then concatenated. This is not equivalent to a different scalar learning rate per head.

The reported GLM comparison matches a GQA-8 baseline while keeping attention logits stable without clipping in that setting. Smaller polynomial matrices can reduce work, but partitioning changes update geometry as well as cost. Verify head axes, layouts and grouped-query sharing rather than splitting an arbitrary storage dimension. Kimi K3 report ↗

Assign parameters by function

A controlled starting partition, not a universal prescription
Parameter roleCandidate ruleReason to inspect
Dense attention/MLP/expert matricesMuon versus AdamW ablationMatrix geometry and update scale
Embeddings and output headAdamW or separately tested ruleVocabulary semantics, tying and sparsity
Norm gains, biases and scalarsAdamW/SGD; separate decay choiceNo natural hidden-matrix geometry
Router / small sensitive matricesStart with controlled baselineRouting/load instability
Large conditional-memory tablesMemory-aware optimizerState budget and sparse access

Two groups must not update the same tied parameter twice. A shape test alone is insufficient: embeddings are matrices but serve a different function from hidden projections. Check the parameter identity, not only its name.

Muon typically stores momentum without Adam’s second-moment buffer for those matrices, but total memory includes gradients, master weights, temporary products and distributed state. Communication and sharding can offset arithmetic savings. See Distributed Training →.

Weight spectra are evidence, not an explanation by themselves

pi=σi2∑jσj2Hnorm=−∑ipilog⁡pilog⁡n\begin{aligned}p_i&=\frac{\sigma_i^2}{\sum_j\sigma_j^2}\\H_{\mathrm{norm}}&=-\frac{\sum_i p_i\log p_i}{\log n}\end{aligned}
Use n listed singular directions. n=1 and a zero-energy matrix need explicit conventions.

A higher normalized singular-value entropy means energy is spread more evenly. Reported Moonlight-style analyses find more uniform spectra with Muon. The hypothesis is better use of matrix capacity and less compressibility; entropy alone does not prove either downstream benefit.

Normalize the same spectrum definition, matrix role and rank threshold when comparing optimizers. An optimizer’s update spectrum is not the trained weight spectrum. Also test pretraining-optimizer × fine-tuning-optimizer combinations: switching an Adam-pretrained model to Muon for SFT need not reproduce Muon pretraining gains.

What a larger batch actually changes

g^B=1B∑i=1BgiE[g^B]=g,Cov⁡(g^B)=ΣBE[Δθ]=−ηgCov⁡(Δθ)=η2ΣB\begin{aligned}\widehat g_B&=\frac{1}{B}\sum_{i=1}^{B}g_i\\\mathbb E[\widehat g_B]&=g,\qquad\operatorname{Cov}(\widehat g_B)=\frac{\Sigma}{B}\\\mathbb E[\Delta\theta]&=-\eta g\\\operatorname{Cov}(\Delta\theta)&=\frac{\eta^2\Sigma}{B}\end{aligned}
Independent identically distributed samples, mean reduction, fixed parameters and plain SGD.

A larger B reduces estimator covariance in this model. Correlated examples, repeated tokens and changing data mixtures reduce the effective independent sample count. Larger batches do not guarantee better generalization or better progress per compute.

Multiplying signal and noise by η leaves their instantaneous ratio unchanged. For SNR⁡=∥g∥22tr⁡(Σ)/B\operatorname{SNR}=\frac{\|g\|_2^2}{\operatorname{tr}(\Sigma)/B}, η cancels. A smaller learning rate reduces absolute step noise and curvature effects; it does not improve this estimator’s SNR by itself.

When the mean gradient shrinks while sampling variance stays substantial, SNR can fall. Learning-rate decay may help dynamics then, but it does not directly reduce gradient-estimation variance. Increasing B does under the stated sampling assumptions.

Separate signal, step noise and data budget

One batch versus the same 256 samples

Independent samples, mean gradient 1, per-sample variance 16; base η=0.1 at B=1
QuantityValue
Batch B16
Learning rate η0.1000
Gradient variance 16/B1.0000
Gradient SNR (squared)1.0000
One update mean-0.1000
One update standard deviation0.1000
Steps for 256 samples16
Fixed-data cumulative drift-1.6000
Fixed-data cumulative variance0.1600

Mode: constant. Changing η scales update signal and noise together, so instantaneous SNR does not change. The fixed-data totals assume a frozen gradient distribution and independent steps; real gradients evolve with the parameters.

These identities do not predict a stable learning rate. In particular, the large linear-scaled rates shown here may violate local curvature limits.

Noise can influence generalization and exploration, but “small dataset means small batch is best” and “one data pass means large batch is best” are not laws. Data quality, objective, repeated examples, architecture and update count still matter.

Linear and square-root rules preserve different quantities

With frozen independent SGD gradients, η∝B\eta\propto\sqrt B holds one-step update covariance η2ΣB\frac{\eta^2\Sigma}{B} constant. It does not hold signal-to-noise ratio constant: batch already changes that ratio.

At a fixed number D of examples, there are D/B updates. Cumulative mean displacement is approximately −DηgB-\frac{D\eta g}{B}; cumulative covariance Dη2ΣB2\frac{D\eta^2\Sigma}{B^2}. Linear η∝B\eta\propto B preserves both expressions in this frozen-gradient approximation. Real gradients and curvature invalidate unrestricted extrapolation.

The original AdamW example increases B=256→1024B=256\to1024 and η=10−4→2×10−4\eta=10^{-4}\to2\times10^{-4} using a square-root candidate. It is a candidate for a sweep, not a proved general Adam rule. Adaptive moments change the derivation; changing B also changes EMA memory measured in tokens, ε dominance, schedule duration and decay per token.

Record whether B counts examples, sequences, valid tokens or weighted loss elements. Gradient accumulation approximates a larger mean batch only when loss normalization and weighting match. BatchNorm statistics, randomness, clipping each microbatch and sequence-dependent weighting can break equivalence.

Why an adaptive optimum can turn over

A simplified Adam analysis replaces the update by coordinate signs. For Gaussian coordinate noise, the exact mean sign is erf⁡ ⁣(giB2 σi)\operatorname{erf}\!\left(\frac{g_i\sqrt B}{\sqrt2\,\sigma_i}\right). The original blog uses the approximation below:

μi≈sign⁡(gi)1+π2B(σigi)2\mu_i\approx\frac{\operatorname{sign}(g_i)}{\sqrt{1+\frac{\pi}{2B}\left(\frac{\sigma_i}{g_i}\right)^2}}
A sign-like model, not the full AdamW update. Handle gᵢ=0 with a limit rather than dividing by zero.

Assuming a shared noise/signal ratio κ², define the signal attenuation b below. A Hessian-based local approximation then gives:

b=(1+πκ22B)−1/2η∗≈ηmax⁡12(bnoise/b+b/bnoise)bnoise2=∑iHii∑i≠jsign⁡(gigj)Hij\begin{aligned}b&=\left(1+\frac{\pi\kappa^2}{2B}\right)^{-1/2}\\\eta^*&\approx\frac{\eta_{\max}}{\tfrac12\left(b_{\mathrm{noise}}/b+b/b_{\mathrm{noise}}\right)}\\b_{\mathrm{noise}}^2&=\frac{\sum_i H_{ii}}{\sum_{i\ne j}\operatorname{sign}(g_i g_j)H_{ij}}\end{aligned}
κ² is the shared squared noise/signal ratio. H is local curvature; b_noise is a model-derived scale, not an Adam memory coefficient.

The expression peaks at b=bnoiseb=b_{\mathrm{noise}} only if the relevant denominators are positive and the optimum lies in the reachable b∈(0,1]b\in(0,1] range. Negative/zero cross terms, unequal noise ratios or indefinite curvature invalidate the simplified interpretation. bnoiseb_{\mathrm{noise}} is not Adam’s β1\beta_1 or β2\beta_2.

This model motivates a possible learning-rate “surge”: growth with B can flatten or reverse. It does not prove noise always corrects sign updates or that every huge batch needs lower LR. The original linked analyses remain references; the 10542 page was unavailable for a fresh full review in this pass.

Search a joint near-optimal region

Hold architecture, data mixture, tokenizer, precision, loss reduction and schedule family fixed. Choose feasible global token batches from memory and throughput measurements. At each batch, sweep peak LR on a logarithmic grid.

Use equal token budgets for data-efficiency comparisons and also report elapsed time. Keep enough horizon to expose moment-state and routing instability; a brief favorable loss slope is not a stable long run. Repeat promising settings with more than one seed and a held-out evaluation.

Map the region within a stated tolerance of best validation loss. Prefer a robust region with good throughput and clipping behavior over one noisy winning point. Test larger-scale checkpoints before extrapolating.

Mean gradients of independent microbatches can estimate trace covariance: B_micro times their sample variance estimates per-sample trace under matching assumptions. Repeatedly evaluate at fixed checkpoint and record the sampling definition. This estimates a local noise scale, not a permanent global optimum.

Control early functional changes

Linear warmup uses ηt=ηpeaktTw\eta_t=\eta_{\mathrm{peak}}\frac{t}{T_w} for 0≤t≤Tw0\le t\le T_w. Here, t counts steps from the start, Tw>0T_w>0 is the warmup duration, and ηpeak\eta_{\mathrm{peak}} is the peak learning rate. Warmup limits early parameter changes while activations, optimizer statistics and the data-driven direction settle. Large initial gradients are one possible issue, not a necessary property of random initialization.

Bias correction already removes zero-start EMA attenuation under stationarity. Warmup has a different role: noisy ratios, rapidly changing states, normalization, depth and a large chosen peak can still destabilize updates. It is not waiting for Adam to learn a Hessian.

The original heuristics suggest 1–5% of pretraining steps, or 50–500 steps / 0.1–1% for some short fine-tuning runs. Treat them as examples, not guaranteed industry rules. Larger batches do not automatically make mean gradients larger or require longer warmup.

Too little warmup can expose an unstable peak early. Too much can waste budget at small steps; it does not prove the model is trapped in a bad local minimum. Sweep duration jointly with the peak and inspect functional update scale.

The original Transformer schedule grows linearly, then decays with the inverse square root of step:

ηt=dmodel−1/2min⁡(t−1/2, tTw−3/2),t≥1\eta_t=d_{\mathrm{model}}^{-1/2}\min\left(t^{-1/2},\ tT_w^{-3/2}\right),\qquad t\ge1
T_w is the warmup step count. The two branches meet at t = T_w. The width factor belongs to this recipe, not every Adam schedule.

Changing model width and warmup also changes its peak; do not compare schedules by shape alone.

Warm up, remain stable, then decay

Warmup–Stable–Decay (WSD) separates three decisions: reach a peak, keep it during an extendable plateau, then begin a cooldown for a selected endpoint. Cosine normally begins decreasing after warmup and ties the trajectory to a chosen horizon.

The practical advantage of WSD is shared trunk training. Several token-budget comparisons can branch from plateau checkpoints and receive their own cooldown. Comparing a cooled checkpoint with an uncooled plateau is not a fair final-quality comparison.

Late decay may refine the endpoint, but a sharp loss decrease is not proof that all useful learning happens in the cooldown. If data changes at the same time, schedule and mixture effects are confounded.

Discrete drops around 80% and 90% of tokens are one multi-step example. Linear, cosine or other cooldowns are possible. Extending training after a cooldown is not the same as simply extending the plateau; document resume policy and optimizer state.

Compare schedule shape at fixed peak

Choose when the plateau ends

100%100%blue WSD; burgundy cosine

Progress 50%: WSD η/ηpeak\eta/\eta_{\mathrm{peak}}=1.000; cosine=0.587. Both end at 0.1. WSD uses an illustrative linear cooldown, not a universal required decay shape.

The horizontal axis is fraction of a fixed token budget with a constant batch. This is a schedule, not a measured loss curve. Changing batch size requires tracking the token/step conversion.

Make small experiments predictive

Empirical hyperparameter laws fit settings across compute budgets. Using C≈6NDC\approx6ND for a dense training approximation, the retained empirical fits are ηopt=0.3118 C−0.1250\eta_{\mathrm{opt}}=0.3118\,C^{-0.1250} and Bopt=0.2920 C0.3271B_{\mathrm{opt}}=0.2920\,C^{0.3271}. Their coefficients require the original compute/batch units and setup; do not insert arbitrary GPU-hours or token units.

These fitted trends are priors, not universal laws. Different language/domain mixtures, data quality, tokenization, objectives, precision and architecture can move the region. Fit locally over several budgets, record residuals and uncertainty, and revalidate after distribution changes.

Maximal update parametrization (μP) addresses a different axis: width. Stable initialization variance alone does not ensure stable update-induced features. For y=xWy=xW, inspect Δy=xΔW\Delta y=x\Delta W, not merely ∥ΔW∥\|\Delta W\|. Forward signals, backward sensitivities and functional updates need compatible scaling.

A width-stable base learning rate is not a width-stable raw learning rate in every tensor. The reference μP implementation divides hidden-weight Adam LR by the width multiplier and treats readout/input dimensions separately. This corrects the old blanket hidden-matrix LR statement. μP parameter-group scaling ↗

Define base and changed-width shapes, configure initialization/readout/optimizer together, run coordinate checks across widths, tune on a small member and validate larger members. The reference family keeps depth fixed; changing depth is not automatically covered. Schedulers must preserve per-group ratios rather than overwrite every LR with the same absolute value. A resumed model must not be reinitialized by shape registration.

μP transfer and compute-law fitting are complementary. Neither eliminates the need to test changed heads, sparse experts or new data. The functional-scaling explanation below connects the spectral view to these parameter-group rules.

Follow the effect of an update through the layer

For a row-vector input x and a weight matrix W, the linear output is y = xW. Fan-in initialization can keep output variance bounded at initialization. It does not determine the effect of a learned update, because the gradient can be correlated with x.

Wij∼N ⁣(0,1din)Δy=xΔW∥Δy∥2≤∥x∥2 ∥ΔW∥2\begin{aligned}W_{ij}&\sim\mathcal N\!\left(0,\frac{1}{d_{\mathrm{in}}}\right)\\\Delta y&=x\Delta W\\\|\Delta y\|_2&\le\|x\|_2\,\|\Delta W\|_2\end{aligned}
The first line is a common fan-in initialization, not a complete μP prescription. The final matrix norm is spectral norm. The bound holds for the linear layer at a fixed input.

Small entry-wise changes can still combine into a large feature change. This is why keeping a weight norm or one raw learning rate constant is insufficient for width transfer. For a nonlinear layer hℓ+1=ϕ(hℓWℓ)h_{\ell+1}=\phi(h_\ell W_\ell), its Jacobian J describes local input-to-output sensitivity. Forward propagation, backward propagation and update-induced changes must all be considered.

Across several layers, sensitivities compose as Jacobian products. Large operator norms can amplify perturbations; small singular directions can suppress them. One layer's spectral norm alone does not certify stable gradients through the whole model. μP supplies coordinated scaling rules, not a universal requirement that every Jacobian be orthogonal.

The reference Transformer recipe also changes attention-score scaling from 1/dhead1/\sqrt{d_{\mathrm{head}}} to a multiple of 1/dhead1/d_{\mathrm{head}}. Its example uses 8/dhead8/d_{\mathrm{head}}, which matches the usual scale when the head width is 64. This belongs to that parametrization; do not independently replace attention scaling in an arbitrary pretrained model. Reference μP setup ↗.

Use coordinate checks to compare activation magnitudes over several widths and learning rates. Then inspect actual update-induced feature changes and validate training behavior. A failed check is a reason to inspect initialization, readout, head scaling and optimizer groups—not simply lower every learning rate.

μP width-transfer discussion ↗ · Spectral-scaling discussion ↗ · Further model-scaling discussion ↗ · Learning rate and batch foundations ↗.

Clip gradients before the optimizer transforms them

g′={g,∥g∥2≤τ,τ∥g∥2g,∥g∥2>τ.g'=\begin{cases}g,&\|g\|_2\le\tau,\\\displaystyle\frac{\tau}{\|g\|_2}g,&\|g\|_2>\tau.\end{cases}
For finite gradients and τ ≥ 0. Zero remains zero; a nonzero gradient keeps its direction.

Value clipping clamps each coordinate and can change direction. Global clipping’s SGD update satisfies ∥Δθ∥2≤ητ\|\Delta\theta\|_2\le\eta\tau, but Adam transforms the clipped gradients through moments and decay. It does not give that same universal bound on the final Adam update.

Accumulate correctly weighted gradients, unscale mixed-precision gradients, check finiteness, compute the logical global norm and clip before the optimizer step. Sharded norms require the appropriate collective and must not double-count replicated copies. Clipping each microbatch is generally different from clipping the accumulated gradient.

Use the norm distribution and clipping rate to choose τ. A threshold of 1.0 or 0.5 is a trial setting, not a unit-independent safeguard. Frequent clipping can be intentional or indicate an overly low threshold, a reduction bug or pathological batches; it is not automatically wrong.

Inspect actual parameter changes as well as raw norm. Stable norms can coexist with poor generalization or adaptive update spikes. The diagnostic table below separates raw gradients from actual parameter changes.

Read the gradient and the update separately

rgrad=∥g∥2∥θ∥2,rupdate=∥Δθ∥2∥θ∥2r_{\mathrm{grad}}=\frac{\|g\|_2}{\|\theta\|_2},\qquad r_{\mathrm{update}}=\frac{\|\Delta\theta\|_2}{\|\theta\|_2}
A zero parameter norm makes these ratios not defined. Log an absolute norm or specify an epsilon policy. The gradient ratio becomes an SGD update ratio only after accounting for learning rate; adaptive optimizers need the actual update.
Diagnostics are clues, not certificates of model quality
ObservationCheck next
Rare norm spikesIdentify the batch, reduction scale, precision and corresponding loss/update
Tiny early-layer gradientsInspect saturation, masks, disconnected paths and layerwise gradient flow
Large head gradients, small backbone gradientsCheck frozen parameters, intended adaptation targets and functional changes
Clipping on most stepsInspect the raw distribution and threshold; frequent clipping can be intentional
Smooth norms but poor validationCheck data, objective and generalization; stable optimization is not model quality

Record raw and clipped norms together. Inspect trends at matched loss reductions and batch definitions. Norms need not decrease monotonically; changing the schedule, data or parameterization changes their interpretation. A large norm is not automatically harmful, and a small gradient does not imply a small Adam update.

# After correctly weighted gradient accumulation; scaler is an AMP GradScaler.
scaler.unscale_(optimizer)
raw_norm = torch.nn.utils.clip_grad_norm_(
    model.parameters(), max_norm=threshold, error_if_nonfinite=True
)
scaler.step(optimizer)
scaler.update()
optimizer.zero_grad(set_to_none=True)

The function returns the total norm before clipping. This sketch assumes nonsharded gradients and an existing AMP training loop. Distributed/sharded training needs its framework's logical global-norm operation. Compare actual parameter values before and after the optimizer step to measure update scale. PyTorch clipping contract ↗.

Training stability and run diagnosis → · Gradient and curvature geometry →

Qwen Muon: choose the operator before orthogonalizing it

Muon normalizes a momentum matrix through a finite orthogonalization procedure. The unit of that operation should match a meaningful linear map, not whichever tensors the training framework stores together.

Qwen uses Nesterov momentum 0.95 and eight Newton–Schulz steps with the Polar Express coefficient schedule. More accurate orthogonalization reduces the frequency and magnitude of spikes in their stress tests. The pre-iteration Frobenius normalization uses a numerical constant of 10⁻¹⁴.

γ(A,B)=0.2max⁡(A,B)\gamma(A,B)=0.2\sqrt{\max(A,B)}
Multiply the orthogonalized A × B update by this shape-dependent scale. Full-rank ideal polar factors then have entry RMS 0.2; finite iterations and deficient rank need separate checks.
§3.1: assignment follows function, not merely tensor rank
ParameterRule / exception
Attention q/k/v and output; GDN input/output; routed and shared expert fc1/fc2; n-gram key/value projectionsMuon for suitable linear maps
Input embedding and output headAdamW
MoE routerAdamW; Muon destabilizes early routing and offers no significant later gain
GR low-rank projectionsAdamW; very elongated shapes perform better with it in their tests
N-gram lookup tableAdam, no weight decay
GDN decay and beta projectionsScalar per head: exclude from matrix orthogonalization
Attention and GDN output gatesAdamW performs as well as or slightly better than Muon

The report hypothesizes that router outputs lack the shared linear structure that makes orthogonalization helpful. That explanation is not established by the observed instability. Similarly, the shape explanation for GR is an author interpretation.

Split fused QKV and GDN input gradients into per-head semantic submatrices. Split SwiGLU fc1 into gate and up halves. Orthogonalize each eligible part independently, then restore the original layout. Otherwise singular directions couple unrelated operators and the shape scale uses the wrong dimensions.

# Schematic update grouping; not runnable Muon code.
for parameter in fused_parameters:
    for part in semantic_parts(parameter):
        if uses_muon(part):
            direction = polar_express(momentum(part), steps=8)
            direction *= 0.2 * sqrt(max(part.shape))
            apply_update(part, direction)
        else:
            apply_adam_family_update(part)
# Preserve one optimizer owner/state per logical parameter.

Splitting QKV/GDN improves both loss and benchmarks. Splitting fc1 leaves loss essentially unchanged while slightly improving benchmarks. These observations reinforce the distinction between storage fusion and update geometry.

The report does not supply every production learning rate, decay coefficient or polynomial coefficient. Eight steps alone do not reproduce Polar Express. Retain exact coefficients, normalization dtype, zero-matrix behavior and state ownership when implementing it. Distributed Muon and kernel overhead → · Retune LR and batch together →.

Qwen3.8-Next architecture report, §3.1, p. 16 (26 August 2026) ↗.

Model recipes use different groups and phases

These are disclosed settings retained from the original model notes, not recommendations to copy. Full data, architecture, precision and RL conditions remain in their report owners.

Pretraining optimization choices in the original report notes
RecipeGroups / geometrySchedule and selected settings
DeepSeek-V4.1-FlashMuon hidden/projector matrices; head-wise Q/K. AdamW nonmatrices. Nesterov + Sinkhorn for tables/embedding/head, no decay.100.6M-token global batch; 2K-step warmup; peak 2.6×10⁻⁴ until 28T, cosine to 2.6×10⁻⁵ at 40T, hold to 45T
GLM-5Muon Split for MLA Q/K/V up-projections; batch-size warmupPeak 2×10⁻⁴ → cosine 4×10⁻⁵; mid-training linear to 10⁻⁵
MAI-Thinking-1AdamW β1=0.95\beta_1=0.95, β2=0.925\beta_2=0.925, ε=10−8\varepsilon=10^{-8}; global clip 1.0Peak 2×10⁻⁴ → minimum 2×10⁻⁵; ~12B-token warmup; cosine; dropout .15
MiMo-V2.6Muown with row-norm control for hidden matrices; AdamW embedding/head/routerFlash 48T and Pro 30T pretraining; 32K→256K context, 1M in agent mid-training

DeepSeek’s original note records Muon momentum .95, decay .1 and target update RMS .18; AdamW betas 0.9/0.95, ε=10−20\varepsilon=10^{-20} and decay 0.1. Large conditional-memory tables get a 5× LR multiplier and 11 Sinkhorn-balancing iterations, τ=10−3\tau=10^{-3} and ε=10−20\varepsilon=10^{-20}. Alternating row/column squared-update balancing is not Muon’s polar normalization and not mHC’s forward residual mixing.

45T / 100.6M gives roughly 447K updates only if the global token batch stays fixed. It is not GPU-hours. Context grows from 64K to 1M at 34T; the phase transition also changes workload. Distributed state ownership and optimizer memory are part of this recipe.

GLM’s DSA indexer warmup uses 5×10⁻³→2×10⁻⁴; sparse adaptation uses 10⁻⁵. Those are different parameter/stage objectives, not contradictions in one peak LR. MAI reports less aggressive decay improves post-RL results; that is an observation about later trainability, not a universal pretraining loss law.

MiMo’s GRPO-like prompt means and entropy-controlled four-way clipping act on policy ratios/credit assignment. They are not gradient-norm clipping or a new Muon polynomial. Keep RL aggregation and rollout weighting in the RL topic rather than describing every “optimization” mechanism as an optimizer update.

Measure the update that the model receives

Verify gradient reduction, accumulation weighting and parameter-group identity first. Then log raw/after-clip norms, moment statistics, update RMS, update/weight ratio and effective decay by group. Layerwise values often reveal what one global scalar hides.

For Muon, test the zero matrix, rectangular shapes, rank deficiency, singular-value behavior, head partition and chosen polynomial dtype. Check state ownership and communication. A short pilot must include resume from a full optimizer checkpoint.

Compare optimizers at matched unique tokens, FLOPs and elapsed-time constraints; report all three rather than claiming they are equivalent. Include delayed instability, downstream transfer and post-training behavior. Prefer a stable near-optimal region to a single early loss winner.

Batch, learning rate, moment memory, clipping, decay and schedule form one recipe. Change one axis at a time when testing a mechanism, then retune jointly for a performance comparison. Neither fair experiment should be confused with blindly copying every Adam setting into Muon.

References and connected topics

Adam ↗ · Decoupled weight decay ↗ · Muon implementation and conventions ↗ · μTransfer ↗ · Smol training playbook ↗

Batch/LR analysis ↗ · Epsilon and LR scaling ↗ · Batch/LR foundations ↗ · EMA and batch ↗ · Muon geometry ↗ · Muon experiments ↗ · Muon details ↗

Optimizer settings belong to the model, data and phase that produced them. Frontier training recipes → · RL objectives and rollout consistency → · Run stability →

The visual experiments use exact synthetic calculations, not measured model-training results.