Explore the research collection
2 entries · Follow this search
- Paper
Phases of Muon: When Muon Eclipses SignSGD
An exactly solvable theory of when Muon beats its Adam-like baseline - with a phase diagram, not a blanket verdict. Setup: stochastic Muon (orthogonalize an EMA of minibatch gradients via Newton-Schulz) vs stochastic SignSGD on a high-dimensional matrix-valued least-squares problem whose per-sample gradients are rank-one outer products, mimicking a linear layer under backprop; as dimension and batch grow the loss dynamics become deterministic and the derived theory tracks simulations. Two data knobs organize everything: the covariance spectrum decays as a power law with exponent alpha (large alpha = steep spectrum, effectively low-rank data), and the target's loss in direction i decays with exponent zeta (large zeta = easy target, little loss in the hard small-eigenvalue directions). PHASES: Muon is favored for steep spectra with rich/hard targets (alpha > 2 and zeta < alpha + 1); SignSGD is favored for flat spectra (alpha < 1) and for easy targets generally; in the middle region the winner flips with the accuracy demanded - SignSGD reaches mediocre solutions first, Muon wins late at low loss; elsewhere the winner depends on how target loss scales with dimension. MECHANISM: Muon performs only a SQUARE-ROOT preconditioning in the data spectrum, not a full inverse - small directions get boosted by roughly sqrt(N/B_eff), and that half-strength boost is exactly right when the target loads loss onto hard directions, but over-boosts them for easy targets, where SignSGD's no-preconditioning wins. BATCH: everything runs through the effective batch B_eff = B(1+beta)/(1-beta) - momentum multiplies the effective batch - because Muon can only whiten directions the batch actually spans (batch rank ~ B_eff); with exact whitening and small B_eff it fails to resolve small eigenmodes and slows down, a transition SignSGD does not have. Muon's optimal learning rates are larger than SignSGD's and are derived exactly in the isotropic case, with a sqrt(N) gap at beta = 0.9 unless the batch grows. A practically relevant bonus: finite Newton-Schulz (NS-5) acts as a RIDGE on small singular values, which can help - Muon's speedup over SignSGD peaks around 1.13x at small B_eff/N and 1.46x at large B_eff/N, and in the large-batch regime the inexact NS-5 iteration BEATS the exact polar decomposition. In the isotropic setting the two optimizers' convergence rates match up to a constant factor once each uses its own optimal LR. Scope: this is a least-squares surrogate with rank-one gradients - a theory of the optimization geometry, not an LM experiment; the SignSGD baseline stands in for Adam (no second-moment adaptivity), and the data spectrum of real gradient covariances is an empirical question the paper does not measure. Proofs are accompanied by a Lean 4 formalization (project page: mlexpos.github.io/phases-of-muon). In the catalog's Muon thread this is the theoretical member, complementary to ID 1809's empirical fine-tuning reversal: 1809 says the Muon-vs-AdamW ranking flips with pretraining data scale AFTER fine-tuning; this says the ranking during optimization itself is a function of data spectrum and target hardness - both argue 'Muon vs Adam' has no data-free answer, and this one names the data property that decides it.
- Paper
Simulating Training Spikes of Deep Neural Networks by Layer-wise Random Feature Models
A mechanism paper for training spikes — the sharp temporary train+validation loss surges in LLM pretraining. Diagnostic starting point: ordinary loss fluctuations are driven by data shuffling and reproduce identically across seeds, but spikes occur at DIFFERENT steps for runs differing only in initialization, so spikes are not caused by a single bad data point and outlier removal cannot fully fix them. TOY MODEL (PLRF): a Power-Law Random Feature model — fixed random Gaussian features feeding linear regression, inputs power-law scaled with exponent α. Two necessary conditions for spikes in PLRF: (1) heavy-tailed data (large α) and (2) learning rate near the divergence threshold. At α=0.3 raising the LR just diverges cleanly; at α=0.9 BOTH SGD and Adam produce genuine spikes before divergence (claimed as the first explicit link between training spikes and heavy-tailed data). MECHANISM: decompose the iterate into deterministic full-batch descent plus a random walk accumulating stochastic gradient noise. Concentration of measure makes the loss concentrate on its expectation IFF α ≤ 0.5 (equivalently Σλ_i diverges for eigenvalues λ_i ∝ i^(−2α)); for α > 0.5 a few very large eigenvalues dominate, and when the noise random-walks into alignment with a large-eigenvalue direction, the loss surges. The EXPECTED loss stays smooth — average-case scaling-law analyses remain valid but stop describing individual runs. Side result: spikes occur in convex quadratic models under stochastic optimization — the 3rd-order terms needed for Edge-of-Stability spikes under full-batch GD are NOT necessary once gradient noise exists; and the SGD divergence threshold is not 2/λ_max but solves (1/B)·Σ γλ_i/(2−γλ_i) = 1 — sharpness (λ_max) is only distantly relevant; the whole eigenvalue distribution is what matters. LAYER-WISE SIMULATOR (Algorithm 1): each layer gets a 2nd-order Taylor expansion of validation loss around a checkpoint (per-example gradient second moments factorize through the activation-correlation spectrum — Prediction 5, verified with relative error <0.1, mostly within 5%, across layer types and steps); from ONE checkpoint + one validation pass (activation-correlation eigendecomposition, mean gradient, mean squared per-batch gradient norm, Hessian trace via Hutchinson probing), synthesize Gaussian per-batch gradients and roll the real optimizer map forward — ~5 seconds on CPU for 1,500 steps for one layer, vs 8 min–1.7 hrs of measurement on TPUv4×32 and 40 hrs to train the case-study model. CASE STUDY: vanilla 1.3B decoder-only Transformer (24 blocks, d=2048, C4, ~25.5B tokens, AdamW β2=0.95, peak LR 8.2e-4, NO gradient clipping); changing only β2 0.95 → 0.999 induces spikes (two seeds). Simulating from the step-21k checkpoint, the normal configuration stays comparatively smooth while both spiky configurations show clear bumps — matching the qualitative fact of spikiness, NOT the step (spike timing is random by construction). Activation-correlation eigenvalues are power-law distributed and MORE heavy-tailed for the spiky configuration, especially in lower layers. EQUIVALENT BATCH FACTOR: despite ~524K tokens per batch, the measured equivalent batch factor 𝔅 ≈ 1 — for gradient-noise purposes Transformer LM training sits in the SMALL-BATCH stochastic regime, because per-token gradients vary wildly; token-count batch size does not buy the gradient-noise suppression sequence-count reasoning suggests. β2 RECIPE: make Adam's second-moment decorrelation time ~1/√(η_t·H) instead of ~1/(η_t·H), giving β2 ≈ 1 − √(η_t·𝔗/√𝔑) from measured Hessian trace 𝔗 and per-batch gradient norm 𝔑 — generically an INCREASING β2 schedule as LR decays; fitted schedule β2 0.982 → 0.992 gave final val loss 2.4404 vs 2.4421 for constant 0.95 and 2.4502 (visibly spiky) for constant 0.992 — real but TINY margins (0.0017 over the original; 0.0001 over the best constant), single runs, no seed variance; the sharper finding is the sensitivity — a 0.01 change in constant β2 flips training between smooth and spiky. Caveats (authors' own, unusually candid): the simulator explains spikes only PARTIALLY — measured 2nd-order terms show level "jumps" rather than spike-and-recovery, 1st-order terms are ~20× larger than the quadratic model predicts; cross-layer correlations and >2nd-order terms are needed and absent; the honest claim is "quadratic models at least partially reveal the mechanism," weaker than the abstract's "successfully predicts." "Prediction" is qualitative — a spike-RISK screen from a checkpoint, not a forecast of when. The layer framework rests on imposed assumptions (Gaussian latents with negligible drift; isotropic output-gradient covariance) and EXCLUDES tied embedding/LM-head weights entirely. The β2 mechanism is admittedly unexplained ("a curious mystery"); the recipe is offered as proof of concept. Simulator accuracy degrades badly with batch size in the PLRF check (severe overestimation at B=64) — the DNN case is argued safe only because 𝔅 happens to be ≈1 for this recipe. Single case study: one size (1.3B), one dataset, one recipe, spikiness constructed by pushing β2, no gradient clipping (atypical for production pretraining); Muon is mentioned only as neighboring spectrum work, NOT simulated. All results first-party, no independent replication, paper ~2 weeks old.