MuonClip solves
two different problems.
The name compresses an optimization method and a stability controller into one word. Understanding it requires pulling them apart.
Muon—MomentUm Orthogonalized by Newton–Schulz—changes the geometry of updates for matrix-shaped hidden-layer weights. It begins with momentum, then approximately replaces the update’s singular values with values near one. Moonshot’s scalable form adds weight decay and a shape-dependent scale chosen to match AdamW-like update RMS.
QK-Clip watches the maximum pre-softmax attention score for each head. If a head crosses a threshold, it rescales that head’s query and key projection weights after the optimizer step. This is not ordinary gradient-norm clipping, and it does not clip model-output vocabulary logits.
MuonClip is the complete Kimi K2 recipe: Muon’s token efficiency plus weight decay, consistent RMS matching, and QK-Clip’s attention stability. The components operate at different moments and on different signals.
Muon
Transforms momentum matrices before applying parameter updates. The goal is efficient feature learning across matrix directions.
QK-Clip
Observes per-head attention scores already computed during forward and conditionally rescales Q/K weights after the update.
MuonClip
Combines Muon, decoupled weight decay, RMS-compatible scaling, and QK-Clip for very long, large-scale pretraining runs.
Momentum remembers.
Orthogonalization redistributes.
AdamW adapts each scalar coordinate using first and second moments. Muon respects the fact that a transformer’s hidden weights are matrices.
For a weight matrix W, Muon forms a momentum buffer Mt = μMt−1 + Gt. In common implementations a Nesterov-style lookahead may be applied. The key operation then takes the singular value decomposition M = UΣVᵀ and seeks the polar factor UVᵀ.
Why does that matter? A raw update can have a few large singular values and many tiny ones: it moves strongly in a narrow collection of matrix directions. Replacing the spectrum by values near one preserves the singular vectors but gives the weaker directions comparable scale. The update is semi-orthogonal—orthonormal columns for a tall matrix or rows for a wide one.
Computing an SVD for every hidden matrix at every training step would be expensive. Muon uses a short Newton–Schulz polynomial iteration built from matrix multiplications, which tensor cores execute efficiently. The widely used quintic coefficients are 3.4445, −4.7750, and 2.0315, commonly run for five steps after normalizing the matrix.
Accumulate a smoothed matrix direction instead of reacting to one noisy minibatch.
Keep singular vectors; flatten singular magnitudes.
With A = XXᵀ after choosing the cheaper orientation.
Raw momentum spectrum
A few dominant modes can monopolize update energy.
Approximate Muon spectrum
The practical polynomial produces noisy values around one, not a perfect SVD.
Orthogonalization alone
was not the production recipe.
Moonlight identified two additions that made Muon competitive beyond speedrun-sized models: weight decay and consistent update scaling.
Vanilla Muon could converge rapidly at first while some weights grew too large in longer training. Decoupled weight decay directly controls parameter growth. Moonshot’s experiments found Muon with weight decay outperformed both vanilla Muon and AdamW in the over-training regime they studied.
The second problem is dimensional: a semi-orthogonal n × m matrix has a predictable Frobenius norm, so its elementwise RMS changes with shape. A single raw learning rate would imply different effective update magnitudes for different projection shapes. Moonlight scales the orthogonalized update by 0.2√max(n,m) to match the RMS convention used by AdamW in its recipe.
This scale is not a universal mathematical constant. It is a transfer device: it allowed learning-rate and weight-decay choices tuned for AdamW to be reused in Moonshot’s setup. PyTorch now exposes “original” and “match_rms_adamw” adjustment modes because the reference Muon and Moonshot conventions differ.
Kimi K2 algorithm’s Adam-RMS matching factor.
Update direction and explicit parameter shrinkage.
Unlike Adam, base Muon does not require a second-moment buffer for its matrix group.
The loss spike begins
inside attention.
As Moonshot scaled Muon, a subset of attention heads developed rapidly growing pre-softmax QK scores.
For head h, attention forms queries and keys, then scores token pairs using qᵢᵀkⱼ with the model’s normal scaling and positional machinery. Softmax is shift-invariant but extremely sensitive to gaps. If query/key norms grow, scores become enormous, attention approaches a brittle one-hot selector, exponentiation becomes numerically demanding, and gradients can become pathological.
The Kimi K2 report’s 53B-total, 9B-active Muon experiment saw maximum attention logits exceed 1,000. The authors associate that regime with significant loss spikes and occasional divergence. They also report the issue occurring more often with Muon than AdamW in their experiments; that is an empirical observation, not a theorem that Muon must explode.
The max statistic matters because mean or RMS can remain ordinary while one head and one token pair runs away. A single pathological head can destabilize a training job that has already consumed enormous compute.
Controls update norm
Useful broadly, but it does not directly bound the forward attention score or identify which head caused it.
Clamps downstream
Bounds the value passed onward, while large QK dot products are still formed before the cap.
Normalizes activations
Effective in some architectures, but the K2 report says it is incompatible with MLA because full keys are not materialized at inference.
Rescales the source
Uses the observed maximum to shrink only the projection weights responsible for the exploding head.
Observe this step.
Correct the next one.
QK-Clip does not modify the current forward or backward pass. It uses a statistic from that pass to project selected weights back toward a safe region after Muon updates them.
For every attention head, the runtime retains Smaxh, the maximum input to attention softmax across the training batch and token pairs. Given threshold τ, it computes γh = min(1, τ/Smaxh). A head below threshold receives γ = 1 and is untouched.
For ordinary multi-head attention with balancing exponent α, query weights are multiplied by γα and key weights by γ1−α. Their dot product therefore scales by exactly γ. Kimi uses α = 0.5 in its explanation, so Q and K each receive √γ. Sharing the correction minimizes asymmetry between their paths.
If the observed maximum is 400 and τ = 100, then γ = 0.25; each side is scaled by 0.5, and their product is quartered. If the maximum is 80, γ = 1 and no clipping happens. Because this is weight rescaling, the change persists into subsequent batches.
The largest pre-softmax attention input observed for a head.
Inactive below threshold; proportional correction above it.
The next QK score inherits a multiplicative γ, all else equal.
Threshold τ = 100 and α = 0.5. Move the signal to see when QK-Clip activates.
CLIPPING ACTIVE
Shared components cannot be clipped
as if every head owned them.
Kimi K2 uses Multi-head Latent Attention. Its query and key construction includes head-specific and shared pieces, so naïve per-head scaling would spill across heads.
The report divides the relevant representations into content and rotary components. Head-specific content query qC and content key kC are each scaled by √γh. Head-specific rotary query qR is scaled by γh. The rotary key kR is shared and is left untouched.
This asymmetric-looking rule follows the score decomposition. The content term contains a head-specific Q and K, so the factor can be split across both. For the rotary term, only the query side can be adjusted independently without changing other heads, so it receives the full γ.
This is the engineering detail that turns a clean MHA equation into a deployable MLA mechanism. “Clip Q and K” is insufficient as an implementation specification; ownership and factorization determine which tensors can be changed without collateral effects.
qCh
× √γhHead-specific; shares the content-score correction with kC.
kCh
× √γhHead-specific component can be adjusted without touching peers.
qRh
× γhOwns the entire rotary correction because the other side is shared.
kR
× 1Shared across heads; left unchanged to avoid cross-head interference.
Optimization first.
Projection second.
The clip is post-update but its telemetry comes from pre-update weights.
This ordering makes QK-Clip easy to reason about: the ordinary model forward and backward equations remain unchanged for the current step. The attention kernel exports one extra maximum statistic per head; the optimizer uses that statistic after its parameter update.
But ordering also creates state-consistency questions. If the parameter is clipped while Muon’s momentum buffer is not, the next step’s optimizer state does not undergo the same projection. That is exactly what the published algorithm specifies, but independent implementations must reproduce it intentionally rather than assuming generic parameter-clipping semantics.
Mixed precision adds another obligation: the max should represent the actual pre-softmax computation, reductions must not overflow, and rescaling must update the authoritative master parameter consistently with sharded or cached copies.
A matrix-aware optimizer
becomes a collective-communication problem.
Muon saves one Adam-like moment buffer but spends matrix multiplications and may require communication inside Newton–Schulz.
AdamW keeps first and second moment state for each optimized parameter. Base Muon keeps momentum but no elementwise variance buffer for its matrix group, which can reduce optimizer-state memory. Yet five Newton–Schulz steps perform repeated matrix multiplications on every eligible weight update, making each optimizer step heavier.
Under tensor or fully sharded parallelism, a logical weight matrix may be split across ranks. Orthogonalizing each shard independently is generally not equivalent to orthogonalizing the global matrix. Distributed implementations must choose a compatible partition dimension and use collectives for the Gram products or gather/redistribute data. NVIDIA’s current implementation explicitly accepts a tensor-parallel process group and warns that sharding orientation is the caller’s responsibility.
QK-Clip adds a much smaller statistic but a subtle reduction. The per-head maximum must cover the intended data-parallel batch and token pairs. Local-only maxima can make clipping depend on rank assignment; a global max requires collective communication. The rescaled weights then need consistency across replicas and shards.
Five rounds of GEMMs.
Newton–Schulz is tensor-core friendly, but it is not free. Tall/wide orientation is chosen to operate along the smaller matrix dimension.
One matrix momentum.
Muon’s eligible group avoids Adam’s second moment; the separate AdamW group still carries Adam state.
Global geometry matters.
Sharded Gram products, maxima, and parameter rescaling must preserve the semantics of the unsharded algorithm.
| Concern | AdamW | Muon / MuonClip | Engineering consequence |
|---|---|---|---|
| Adaptive state | First + second moments | Momentum for Muon matrices | Potentially lower optimizer-state bytes |
| Per-step math | Elementwise operations | Repeated matrix products | Higher optimizer compute; accelerator-friendly |
| Parameter scope | Broad | Hidden 2D matrices | Requires explicit parameter grouping |
| Parallel semantics | Mostly elementwise | Matrix-global orthogonalization | Shard orientation and collectives matter |
| Attention telemetry | Not inherent | Per-head max for QK-Clip | Fused attention must expose/reduce statistic |
Muon delivered efficiency.
QK-Clip preserved the run.
Author-reported compute efficiency for scalable Muon versus AdamW under compute-optimal training.
Tokens used to train the 3B-active / 16B-total MoE model with scalable Muon.
Tokens in the Kimi K2 run using MuonClip.
Reported for the full 1.04T-total, 32B-active training run.
The strongest claim is operational: an optimizer family that had exhibited attention-logit instability completed an enormous run smoothly.
In the mid-scale Muon run, maximum attention logits quickly exceeded 1,000. In Kimi K2, MuonClip used τ = 100; the maxima initially sat at the cap, then decayed into a normal operating range after roughly 30% of training. The paper reports no observable loss spikes.
Its “harmlessness” experiments found QK-Clip controlled maxima without degrading the studied loss trajectory or downstream performance. That supports QK-Clip in the tested Muon/Kimi configurations. It does not establish that τ = 100, α = 0.5, or the same intervention is optimal for every architecture, scale, optimizer, or attention kernel.
Moonlight’s ≈2× claim and K2’s zero-spike claim answer different questions. The former concerns compute/token efficiency in scaling-law experiments; the latter concerns stability at unprecedented scale. MuonClip combines the mechanisms, but QK-Clip should not be credited with Muon’s full efficiency gain.
K2 completed cleanly.
1.04T total parameters, 32B activated, 15.5T tokens, τ = 100, no loss spike.
Clipping was targeted.
Per-head intervention regulated maxima while preserving tested loss and downstream results.
Universal optimizer dominance.
The reports do not prove MuonClip always beats a thoroughly tuned AdamW or works unchanged for fine-tuning/RL.
Clip the gradient, the logit,
or the weights?
Versus global gradient clipping
Gradient clipping limits the norm of the backward update. QK-Clip uses a forward statistic, identifies the offending head, and rescales the parameters that generate QK scores. The methods can coexist.
Versus attention soft-capping
A soft cap changes the attention function on every forward pass. QK-Clip leaves the forward equation unchanged and intervenes conditionally on weights after a threshold violation.
Versus QK-Norm
QK-Norm normalizes queries and keys continuously. QK-Clip is an event-driven parameter projection designed around MLA’s partially shared/factorized representation.
Versus AdamW
AdamW performs elementwise variance adaptation across a broad parameter set. Muon uses matrix-level spectral geometry for eligible weights, while an AdamW companion still handles the rest.
Stability has a price—
and a scope.
Extra optimizer FLOPs
Newton–Schulz adds several matrix products per eligible weight. Sample efficiency must outweigh slower steps in wall-clock and total training cost.
Head-wise weight distortion
Clipping is intentionally minimal, but it changes parameter norms discontinuously. Frequent activation could fight the optimizer or alter learned head specialization.
Threshold transfer
A fixed τ interacts with attention scaling, head dimension, positional encoding, activation precision, architecture, batch composition, and training stage.
State mismatch
QK weights are rescaled while momentum follows its published recurrence. The long-run dynamics of repeated projection deserve direct study.
Fine-tuning and RL
The flagship evidence is pretraining. Shorter, lower-data or policy-optimization regimes may prefer different parameter routing, learning rates, or no clipping.
Maximum as a statistic
Max is sensitive to a single outlier and distributed scope. Quantiles or persistent violation measures might offer different intervention tradeoffs.
What a serious implementation
must specify.
- Parameter groups.List exactly which attention, MLP, router, embedding, normalization, bias, and output-head tensors use Muon versus AdamW.
- Muon variant.Record momentum/Nesterov semantics, Newton–Schulz coefficients and steps, normalization, transpose rule, weight decay, and update-scaling convention.
- Logit definition.State whether Smax is measured before or after 1/√d scaling, positional terms, masks, soft-caps, and which batch/token axes participate.
- Distributed reduction.Clarify whether head maxima are local, data-parallel global, sequence-parallel global, or accumulated across microbatches.
- MLA tensor mapping.Identify the physical slices for qC, kC, qR, and shared kR; verify that per-head rescaling does not alter neighboring heads.
- Precision and master weights.Measure the max safely and apply clipping to the authoritative parameter so BF16/FP8 views, shards, and caches remain synchronized.
- Telemetry.Log per-layer/head maxima, clip frequency, γ distribution, weight norms, momentum norms, loss spikes, overflow events, and throughput.
- Ablation budget.Compare AdamW, vanilla Muon, scalable Muon, and MuonClip at matched model, data, FLOPs, tokens, batch, scheduler, and tuning effort.
MuonClip separates
learning speed from stability control.
The architecture of the solution is more important than the branding: use a matrix-aware optimizer where it helps, then enforce a model-aware invariant where it fails.
Muon takes momentum matrices and flattens their singular spectrum using a few accelerator-friendly Newton–Schulz iterations. Moonlight added the weight decay and shape-aware RMS scaling needed for long, large-model training. That produced strong author-reported token and compute efficiency.
At Kimi K2 scale, a few attention heads still drove QK scores toward instability. QK-Clip watched the actual forward-pass maximum, calculated a per-head correction, and rescaled only the independently owned query/key projections after the update. It controlled the mechanism generating the explosion rather than merely hiding its output.
The resulting MuonClip stack carried a 1.04-trillion-parameter MoE through 15.5 trillion tokens with no reported loss spikes. That is compelling systems evidence—not proof of universal superiority, but a concrete demonstration that optimizer geometry, attention architecture, telemetry, and distributed implementation can be designed as one training system.
Primary evidence first.
Algorithm details and K2 results come from Moonshot’s technical report and official launch article. Muon design and scaling claims use the original implementation write-up, Moonlight report, and current framework documentation. Accessed 18 July 2026.
- 01Kimi Team — Kimi K2 Technical Report↗
- 02Moonshot AI — Kimi K2 launch article↗
- 03Official Kimi K2 repository and report↗
- 04Liu et al. — Muon Is Scalable for LLM Training↗
- 05Official Moonlight distributed Muon repository↗
- 06Keller Jordan — Muon design and implementation↗
- 07Reference Muon repository↗
- 08PyTorch — Muon optimizer documentation↗
- 09NVIDIA NeMo — Muon and distributed Newton–Schulz↗
- 10Kimi Team — Kimi Linear Technical Report↗
- 11Vaswani et al. — Attention Is All You Need↗
- 12Kingma & Ba — Adam↗