An optimiser turns each gradient into a step in two moves: it smooths the gradient over time (momentum) and it reshapes it (per coordinate in Adam, per matrix in Shampoo and Muon, to a sign in Lion); the schedule then multiplies the step by a base rate ηt that warms up, holds and decays. The two are always chosen as a pair, because adaptive methods only rescale relative to η.
You need: what one training step does with a gradient (the parent Topic: ml-fundamentals, Reading section 5) and why a badly conditioned valley is slow (the Hessian and the stable-rate bound 2/λmax are on Calculus and optimisation for ML: section 4 also derives momentum's rate, 0.519 per step on diag(1, 10); section 10 the minibatch noise floor; section 11 sharpness and the edge of stability). How the schedule's anneal phase is combined with a data switch in real pretraining runs is on Pretraining.
| Optimiser | Update, in one line | state per parameter | What it fixed | Its catch |
|---|---|---|---|---|
| SGD (mini-batch) | θ ← θ − ηg | 0 | the baseline | one step size for every direction |
| Momentum (heavy ball), Nesterov | v ← βv + g; θ ← θ − ηv (Nesterov: gradient at the look-ahead) | 1 | zig-zag across ravines; speed along them | still one step size |
| AdaGrad | divide by √(sum of all past g²) | 1 | per-parameter steps; sparse features | the sum only grows, so the rate dies |
| RMSProp | divide by √(decaying average of g²) | 1 | AdaGrad's dying rate | no momentum, no bias correction |
| AdaDelta | no global rate; step scaled by a running average of past updates | 2 | choosing η | rarely used now |
| Adam | momentum m and RMSProp's v, both bias-corrected | 2 | a robust default | L2 in the loss is rescaled per parameter |
| AdamW | Adam plus decoupled decay θ ← θ − ηλθ | 2 | uniform weight decay; the LLM default | two buffers of state |
| Adafactor | Adam's v factored into row and column sums | about 0 | optimiser memory | a coarser second moment |
| Lion | sign of an interpolated momentum | 1 | memory; found by program search | needs a smaller rate and larger decay |
| Shampoo, SOAP | precondition rows and columns with L−1/4, R−1/4; SOAP runs Adam in their eigenbasis | 2 + factors | directions that are not coordinates | memory and matrix roots; one more knob |
| Muon | orthogonalise the momentum of each hidden matrix (5 Newton-Schulz steps) | 1 | updates dominated by a few directions | matrices only; the rest stays on AdamW |
| Schedule-free | constant rate; gradient at an interpolation; iterates averaged | 1 or 2 | knowing the run's length | evaluate at the average, not at the training point |
On the parent page, not repeated here: its Training lab trains SGD, momentum, Adam, AdamW and Muon live on a small network with step, cosine or WSD schedules, and its Defaults across models tab lists the optimiser, betas, epsilon, rate, warmup, schedule, final rate, decay and clipping of 21 landmark models. This page owns the rules, the evidence and the schedule family.
Read left to right (top to bottom on a phone): the gradient gt is smoothed, reshaped, scaled by the schedule and applied with decoupled weight decay. The number under each box is the state it keeps per parameter, which is what an optimiser costs in memory (section 3). The schedule's shape is illustrative.
The problem every method below answers is conditioning. When the loss curves 100 times more sharply across a valley than along it (condition number 100), the largest stable step for the steep direction is tiny for the shallow one, and gradient descent crawls along the floor while zig-zagging across it. Momentum adds up the gradients of successive steps: the components along the floor agree and grow, the ones across it flip sign and cancel.
Fig. 1, step by step
Each optimiser at its own best constant rate (a log grid, checks/tune.mjs), the exact torch.optim.SGD rule in float64 (checks/race_facts.json). All 13 rules on five surfaces are in the Optimiser race.
| Variant | Gradient computed on | Trade-off |
|---|---|---|
| Batch gradient descent | the entire training set | deterministic descent to a (local) minimum, but slow and expensive per step |
| Stochastic gradient descent (SGD) | one random example | cheap and fast, but noisy; may never settle at the minimum |
| Mini-batch gradient descent | a small batch | standard in practice: efficient, less noisy than one example, hardware-friendly. "SGD" in code (torch.optim.SGD) almost always means this |
The noise matters for the schedule: with a noisy gradient a constant rate cannot converge, only hover in a region whose size grows with the rate (section 7).
Scale each parameter's step by its own gradient history: divide by the square root of an average of its squared gradients, coordinate by coordinate (a diagonal preconditioner). AdaGrad sums every past g², so its rate only falls; RMSProp replaces the sum with a decaying average; Adam adds momentum and a bias correction; AdamW moves weight decay out of the division.
The step m̂/√v̂ is roughly the sign of the gradient, scaled by how consistent it has been: about 1 when every recent gradient agrees, smaller when they disagree. So Adam's step is bounded by about η per parameter, whatever the size of the gradient, which is why one learning rate works across very different layers.
AdaGrad, RMSProp and Adam rescale each coordinate. That helps exactly when the directions of very different curvature are the coordinates. In a network, the weight-space directions of high curvature are rarely single weights.
Fig. 2, step by step
Same valley, same start relative to the minimum, each optimiser at its best rate for each surface (checks/race_facts.json); Shampoo is the one rotation-invariant preconditioner here.
| Optimiser | Idea | Strength and weakness |
|---|---|---|
| AdaGrad (Duchi, Hazan and Singer 2011) | θ ← θ − η g / (√(Σ g²) + ε), the sum over every past step | Good for sparse features (a rarely seen feature keeps a large step). But the denominator only grows, so the rate decays towards nothing. |
| RMSProp (Hinton, lecture 6e, 2012) | v ← ρv + (1 − ρ)g² (0.9 in the lecture, 0.99 in PyTorch) | Fixes AdaGrad's dying rate; good for online and non-stationary problems. Never published as a paper: the citation is a slide. |
| AdaDelta (Zeiler 2012) | no global learning rate at all: the step is scaled by a running average of past updates divided by one of past gradients, so its units match θ's | Removes the choice of η; rarely used now. |
Bias correction. Both averages start at zero, so for the first steps they are too small; dividing by 1 − βt undoes that. Without it a steady gradient's step overshoots, by 6.57 times at step 12 with β2 = 0.999 (the figure, which opens on step 12; the dashed lines are the uncorrected run). The overshoot is the paper's own warning: "values β2 close to 1 indeed lead to instabilities in training when no bias correction term was present, especially at first few epochs" (Kingma and Ba, section 6.4). With β2 = 0.95, the value most LLM runs use, the uncorrected step is within 10% of correct from step 6 on (numbers below).
In numbers (recompute.py): without correction a steady gradient gives a step of (1 − 0.9t)/√(1 − β2t) times η. With β2 = 0.999 that is 3.16η on step 1, a peak of 6.57η at step 12, still 3.24η at step 100 and 1.26η at step 1,000. With β2 = 0.95 the uncorrected step starts too small (0.45η), peaks 10% too large around step 20 and stays within 10% of correct from step 6 on, one reason the correction matters less for LLM runs, which mostly use 0.95.
Bias correction removes the bias of v̂, not its noise. On step 1, m̂/√v̂ = g/|g|: every parameter moves by exactly η, whatever its gradient, and for the next few steps v̂ is an average of a handful of squares, so per-parameter steps are large and erratic. Liu et al. 2019 (RAdam) name this: the variance of the adaptive learning rate "is problematically large in the early stage", and warmup works as variance reduction. Warmup ramps η from near zero until the statistics can be trusted; RAdam instead switches the adaptive term on only once enough steps have accumulated. A post-norm transformer is especially sensitive (the original Transformer warmed up for 4,000 steps). Warmup length is optimiser-dependent and worth tuning rather than copying (Semenov et al. 2025, takeaway 5).
Try: three parameters receive three kinds of gradient: a steady tiny one, pure noise, and a sparse one that fires every tenth step. Scrub through Adam as published, then switch to uncorrected and scrub the same 40 steps again (dashed lines show the other mode). Then set β2 to 0.95, the value most LLM runs use.
Bars are to scale within each column across all 40 steps and both modes; the step column runs from −7 to 7 times the learning rate. Chart: |step| ÷ lr per parameter, solid for the mode shown, dashed for the other. β1 = 0.9, ε = 10−8; the gradient streams are illustrative (the noisy one is seeded). The corrected rule is torch.optim.Adam's.
Put L2 in the loss and its gradient λθ goes through Adam's division by √v̂ like everything else: a weight whose gradient is large and noisy is barely decayed, and a weight whose gradient is tiny is pulled towards zero at up to the full step η. AdamW applies θ ← θ − ηλθ outside the division, so every weight decays alike (Loshchilov and Hutter 2017).
For plain SGD the two are the same up to a rescaling of λ by the learning rate (Loshchilov and Hutter, abstract). Because AdamW's decay per step is ηλ, it shrinks with the schedule. In code, torch.optim.Adam(weight_decay=...) is the L2 version; AdamW is the decoupled one.
derived: one weight θ = 1 with λ = 0.1 and η = 10−3, at steady state, its gradient noise of mean 0 and RMS σ. L2 in Adam: m̂ ≈ λθ and √v̂ ≈ √(σ² + λ²θ²), so the shrink per step is ηλθ/√(σ² + λ²θ²). AdamW: ηλθ = 10−4 for every weight. The ratio runs from 10 at σ = 0.001 to 0.1 at σ = 10 (ns_data.py). The step-by-step animation of both on the same noise, and the regularisation side, are on Regularisation, section 3.
A weight is a matrix W (m × n), and its gradient's high-curvature directions mix rows and columns. Matrix-aware preconditioners act on both sides of it.
Fig. 3, step by step
config.json). Every step a gradient G of the same shape arrives. Every plate in the figure is drawn to the same scale, so a slab the size of W is one state value per weight.In mixed precision with Adam, each parameter needs 2 bytes for the bf16 weight, 2 for its gradient, 4 for an fp32 master copy and 4 each for m and v: 16 bytes (ZeRO; 2 + 2 + 4 + 4 × 2 = 16, reproduced by construction). Optimiser states "use 33–75% of the total memory footprint during training" (Dettmers et al. 2021). Where that state lives across GPUs (ZeRO stages, FSDP) is on Distributed Training.
State values per parameter are counted per matrix: Adam 2mn, Muon mn on hidden matrices and 2mn on the embedding, output head and every 1-D parameter (norms, router biases), Adafactor m + n, SOAP 2mn plus, for each side d ≤ 10,000, a d × d factor and its d × d eigenbasis (max_precond_dim = 10000 and precondition_1d = False are soap.py's defaults; larger sides, such as a vocabulary, get no factor). Bytes: 4 per state value, 1 for 8-bit Adam. Training bytes per parameter = 2 (bf16 weight) + 2 (bf16 gradient) + 4 (fp32 master) + state bytes, before activations and before any ZeRO sharding. Parameter recounts: SmolLM3 3.08B, OLMo 2 7.30B, Llama 3.1 405.85B, Kimi K2 1,026.41B (within 3,416 parameters of Hugging Face's count; the K2 report's 1.04T is discussed on Moonshot AI: Kimi). Shampoo is not listed because its memory depends on the blocking an implementation chooses.
Try: switch models. Muon's state is a little more than half on small models, whose embedding is a bigger share (89% of OLMo 2 7B sits in hidden matrices, 99.8% of Kimi K2). SOAP's state on Kimi K2: each of its 69,300 expert matrices (7,168 × 2,048) carries a 7,168 × 7,168 factor and a 2,048 × 2,048 one, each with its eigenbasis.
Counted per matrix from each model's config.json, 4 bytes per state value (1 for 8-bit Adam), before activations and ZeRO sharding; the counting rules are in the closed block below.
A gradient matrix is usually dominated by a few singular directions, so an SGD or Adam step moves mostly along them. Muon (Keller Jordan, 2024; "MomentUm Orthogonalized by Newton-Schulz") replaces each hidden matrix's momentum by the nearest semi-orthogonal matrix, so every direction the gradient spans gets a comparable step and rare directions are not drowned out. Bernstein derives it as steepest descent under the spectral norm.
Fig. 4, step by step
inputs/root_gradient_sv.json), normalised to Frobenius norm 1, has singular values from 0.04 to 0.32: the strongest direction is 7.3 times the weakest, so an SGD or Adam step moves mostly along the first few.Because each iteration keeps the singular vectors, the five scalar maps in Fig. 4 are exact (ns_data.py).
For one m × n hidden weight with gradient G (the defaults of the reference code and of torch.optim.Muon):
adjust_lr_fn options.torch.optim.Muon (docs; first in the PyTorch 2.9 documentation, inferred from the versioned docs) and optax.contrib.muon in JAX (docs). PyTorch runs the Newton-Schulz iterations in bfloat16 and defaults to weight decay 0.1.Lion ("EvoLved Sign Momentum", Chen et al. 2023) was found by a program search over update rules. Its step is the sign of an interpolation between the momentum and the current gradient, and the momentum is updated afterwards with a different rate:
A new optimiser's paper compares against a baseline its authors tuned. Independent benchmarks that tune every method the same way keep finding smaller gains. Speed-ups are "how many times fewer steps or FLOPs to reach the same loss".
| Optimiser | Claimed by its authors | claim, as a speed-up | Independent evidence |
|---|---|---|---|
| Muon | "~2x computational efficiency" vs AdamW, 52% of the FLOPs (Liu et al. 2025) | 1.92× | About 1.3× at 0.1B parameters, about 1.1× at 1.2B (8× Chinchilla tokens), the best matrix method at 1 to 4× Chinchilla tokens, overtaken by SOAP and Kron beyond (Wen et al. 2025). Keeps its data efficiency at batch sizes far beyond AdamW's critical batch, up to 4B parameters and 16M-token batches (Essential AI 2025). |
| SOAP | at least 40% fewer iterations than AdamW at 2M-token batches (Vyas et al. 2024) | ≥1.67× | About 1.3× at 0.1B, about 1.1× at 1.2B; overtakes Muon at higher token-to-parameter ratios (Wen et al.). "Surprisingly consistent" across batch sizes (Semenov et al. 2025). |
| Shampoo (distributed) | (benchmark entry) | no separate claim | Won the AlgoPerf 2024 external-tuning track: score 0.7784 against the NAdamW baseline's 0.5707, about 28% faster training averaged over eight workloads (Kasimbeg et al. 2025). |
| Schedule-free AdamW | matches or beats tuned schedules with no schedule (Defazio et al. 2024) | no single number | Won the AlgoPerf 2024 self-tuning track, the only entry above the baseline (0.8542 against 0.8194, about 8% faster), and second in external tuning (0.7077) (Kasimbeg et al.). AlgoPerf scores are not comparable between the two tracks. |
| Sophia | 2× fewer steps than Adam at 125M to 1.5B (Liu et al. 2023) | 2× | Gains "vanish" against a baseline with a fully decayed learning rate on BERT and T5 (Kaddour et al. 2023); diverges in small-batch runs beyond the Chinchilla horizon (Semenov et al.). |
| Lion | similar or better than Adam on language modelling; large gains on vision (Chen et al.) | no single number for LMs | Gains vanish against a fully decayed baseline (Kaddour et al.); benefits greatly from larger batches (Semenov et al.); scalar-based methods average under 1.2× once tuned (Wen et al.). |
Bars: claimed speed-up on a scale from 0 to 3×, the thin line at 1× (AdamW). Derived: 1/0.52 = 1.92; 1/(1 − 0.40) = 1.67 (a lower bound, iterations only). Independent figures are quoted, not converted.
A larger batch averages more examples per gradient, so the gradient is less noisy and a larger step is safe. Up to a point that buys fewer steps for the same data; beyond it, extra examples per step are wasted. McCandlish et al. 2018 fit this trade-off with one relation, (S/Smin − 1)(E/Emin − 1) = 1 (their equation 2.11), where S and E are the steps and training examples needed to reach a given loss, and define the critical batch Bcrit = Emin/Smin (equation 2.12). Solving with E = BS gives S = Smin(1 + Bcrit/B) and E = Emin(1 + B/Bcrit).
Predict what an 8 times larger batch than Bcrit saves in steps, then drag.
derived from McCandlish et al.'s equations 2.11 and 2.12; the default (B = Bcrit) lands on their statement that training then "takes twice as many passes through the training data as an optimally data-efficient (small-batch) run would take, and twice as many optimization steps as an optimally time-efficient (large-batch) run would take", by construction of the formula. At 8 Bcrit: 1.12 times the minimum steps for 9 times the minimum data. Their critical batch grows during a run ("the noise scale increases as the loss decreases") and is predicted, at the order-of-magnitude level, by the gradient noise scale. The rate rules below are relative to a batch you have tuned, scaled by κ.
A high rate early travels quickly towards a basin; a low rate late settles at its bottom. With noisy gradients there is a second reason: at a constant rate the iterate never converges but hovers in a region whose size grows with η, so the final loss is set by how low the rate gets at the end.
Fig. 5, step by step
300 steps, the same peak rate under each schedule. For plain SGD the 20-seed floor is 0.103 and cosine ends at 0.062 (checks/race_facts.mjs).
Two questions separate every schedule family: does it need the total number of steps T in advance, and what shape is the decay.
| Scheduler | shape | Rule | Needs T? | Where it lives |
|---|---|---|---|---|
| Warmup + cosine | a linear ramp from about 0, then ηmin + (ηmax − ηmin)(1 + cos(πt/T))/2 (here to 10% of the peak) | yes | classic LLM pretraining (Kaplan, Chinchilla, Llama); still the single most common recipe | |
| WSD, trapezoid (MiniCPM) | warmup, a long constant plateau, a short cooldown over the last 10 to 20% | no: the decay start is chosen later | MiniCPM, DeepSeek-V3, Kimi K2, ERNIE 4.5, SmolLM3 | |
| Linear decay to zero | a straight line from the peak to 0 | yes | the fine-tuning default: the Hugging Face Trainer's lr_scheduler_type defaults to "linear", with 0 warmup steps unless set (docs) | |
| Inverse square root (Noam) | η ∝ 1/√t after a linear warmup | no | the original Transformer: d−0.5·min(t−0.5, t·w−1.5) with w = 4,000 (Equation 3), a peak of 512−0.5·4,000−0.5 = 6.99 × 10−4 (derived); degrades gracefully if the run is extended | |
| Constant (after warmup) | flat at ηpeak | no | the base case of every decay-free method (section 8); on its own it ends visibly above an annealed run |
Sparklines: 100 steps, rate as a share of its own peak; equal to torch.optim.lr_scheduler to 10−15 where PyTorch has the shape (checks/sched_check.py); warmup lengths are illustrative. Eight more shapes (step, exponential, warm restarts, one-cycle, plateau, schedule-free, WSM) are in the closed reference table in Depth.
Cosine's cost is easiest to see when you want models at several lengths, say 250, 500 and 1,000 steps (to fit a scaling law, or because you do not yet know how long you can train). Fig. 6 runs plain SGD on the noisy quadratic model of Zhang et al. 2019 (illustrative toy, exact expected losses); each curtain is one run's rate as a share of its peak, and its length is what it costs.
Fig. 6, step by step
The model: 10 coordinates with curvatures from 1 down to 0.01 (condition number 100), start at 1, gradient noise with covariance 0.09·H, plain SGD. The losses are exact expected values computed by recursion (no sampling); checks/nqm_check.py matches them with 4,000 seeded PyTorch runs (torch.optim.SGD and schedulefree.SGDScheduleFree), largest deviation 2.1 standard errors. Learning rates: the best of a log grid (10k/8), cosine re-tuned per length, the others tuned once for 1,000 steps. Grey line: the same SGD at its best constant rate, never decayed. Re-tuned for each length, cosine reaches the lowest loss at every endpoint here, by 1.3 to 2.2 times; schedule-free and WSD, tuned once, come within 26% and 54% at 1,000 steps and are further behind at 250, where their single rate is too low; all three end 2.9 to 4.4 times below the never-decayed rate. A quadratic favours schedules that decay throughout; in LLM pretraining tuned constant-plus-cooldown runs match cosine (below), and schedule-free gives "strong (but not optimal)" results there (Hägele et al., section 4.2). What the toy shows exactly is the cost structure.
The schedule's shape is less sensitive than its peak. The learning-rate range test (Smith 2015, section 3.3): train for a few epochs "while letting the learning rate increase linearly between low and high LR values", and read off where the loss starts to fall and where it turns noisy or rises: one run gives both a good rate and a good range, in Smith's words. For LLMs, sweeps at small scale and transfer (section 6).
WSD removed the need to know T, but not the decay: you still choose when to start it, over how many tokens and with which curve, and extending training after the decay has begun means rolling back to the pre-decay checkpoint. Two methods remove the decay itself.
optimizer.eval() before evaluating or saving: the weights held during training are y, not the average x (practice notes below).schedulefree package; on the noisy ravine they go below the constant-rate floor with no schedule.optimizer.train() and optimizer.eval() wherever you call them on the model, and keep the optimiser in eval mode when saving checkpoints, because the weights held during training are y, not the average x you should evaluate; warmup is still recommended; β = 0.9 by default, and 0.95 or 0.98 may be needed for very long runs; rates 10 to 50 times larger than classical ones for SGD, 1 to 10 times for AdamW.The rate warms up, then stays constant forever; checkpoints are saved periodically, and a weighted merge of the last n of them stands in for the annealed model. The link to decay is exact: merging checkpoints with weights cj is algebraically the same as applying per-step weights wi = Σj≥i cj to the updates after the base checkpoint, so any monotone decay curve can be inverted into merge weights (ck = wk, cj = wj − wj+1, c0 = 1 − w1). Mean averaging corresponds to linear decay, EMA to a convex decay, and cosine or 1−sqrt can be built directly. The framework is optimiser-agnostic and needs no change to the training loop. Details, a live toy and the equivalence test are on the WSM paper page.
| Scheduler | shape | Rule | Needs T? | Where it lives |
|---|---|---|---|---|
| StepLR, MultiStepLR | multiply by γ (often 0.1) at fixed milestones | yes (milestones) | the ResNet and ImageNet era; still fine for small supervised jobs | |
| ExponentialLR | ηt = η0γt | no | convex and fiddly to tune; rarely competitive | |
| CosineAnnealingLR | ηmin + (ηmax − ηmin)(1 + cos(πt/T))/2, no warmup | yes | the PyTorch building block of warmup + cosine | |
| CosineAnnealingWarmRestarts (SGDR) | cosine cycles, each restarting at ηmax | per cycle only | snapshot ensembles (Huang et al. 2017: one model saved at the end of each cycle) and vision; essentially absent from LLM pretraining | |
| OneCycleLR (super-convergence) | ramp to a peak well above the usual rate, then anneal far below the starting rate | yes | short fine-tuning runs, the fastai lineage | |
| ReduceLROnPlateau | cut the rate by a factor when a monitored metric stops improving (sparkline illustrative) | no | reactive: good for small supervised runs; bad for LLM runs (feedback from noisy evaluations, and a schedule nobody can reproduce) | |
| Schedule-free (Defazio et al.) | constant rate plus principled iterate averaging instead of a decay curve | no | open-ended runs; NeurIPS 2024 oral (section 8) | |
| WSM (Tian et al. 2025) | constant rate forever; the decay is emulated afterwards by merging saved checkpoints | no | 2025, Ant Group's Ling team (section 8) |
PyTorch settings of the sparklines: MultiStepLR milestones 50 and 75; ExponentialLR γ = 0.97; SGDR T0 = 25; OneCycleLR defaults.
| Run | Optimiser | Schedule | final rate / peak |
|---|---|---|---|
| Transformer (2017) | Adam (0.9, 0.98), ε 10−9 | 4,000 warmup steps, then inverse square root (section 5.3) | no end |
| Llama 2 (2023) | AdamW | 2,000 warmup steps, cosine "down to 10% of the peak" (section 2.2) | 10% |
| Llama 3 405B (2024) | AdamW, peak 8 × 10−5 | 8,000 warmup steps, cosine to 8 × 10−7 over 1.2M steps (section 3.4.1) | 1% |
| DeepSeek-V3 (2024) | AdamW (0.9, 0.95), decay 0.1 | 2K warmup steps to 2.2 × 10−4, constant until 10T tokens, cosine to 2.2 × 10−5 over 4.3T, then 2.2 × 10−5 for 333B and 7.3 × 10−6 for the last 167B (section 4.2) | 3.3% |
| Kimi K2 (2025) | MuonClip | WSD: 500 warmup steps, 2 × 10−4 constant for 10T tokens, cosine to 2 × 10−5 over 5.5T, then an anneal to 7 × 10−6 over 400B + 60B (section 2.5) | 3.5% |
| SmolLM3 (2025) | AdamW (0.9, 0.95), decay 0.1 | WSD: 2,000 warmup steps, linear decay to 0 over the final 10% (blog) | 0 |
| GLM-4.5 (2025) | Muon (+ AdamW for embeddings, biases, norms) | warmup to 2.5 × 10−4, cosine to 2.5 × 10−5; chose cosine over WSD (section 2.4) | 10% |
| ERNIE 4.5 (2025) | not stated here | "All models use the Warmup-Stable-Decay learning rate schedule" (report, section 3.3) | not stated |
Final rate / peak derived from the quoted values. Every other landmark model's settings are on the parent page's Defaults across models tab.
| Sense | What it means | Where you meet it |
|---|---|---|
| 1. Classical, optimisation | Lowering the learning rate, full stop. Borrowed from simulated annealing, where a temperature is reduced so the search settles. Here annealing and decay are exact synonyms. | "cosine annealing", CosineAnnealingLR, eta_min; anything before 2023 |
| 2. Modern LLM pretraining | A training phase (the final 10 to 30% of tokens or so) defined by two simultaneous changes: the rate decays towards zero and the data mixture switches to curated high-quality tokens (mathematics, code, instruction-like, reasoning). | Llama 3's annealing, OLMo 2's Dolmino mid-training mix, MiniCPM's WSD decay phase; "the annealed model" |
| 3. Annealing as an experiment | A cheap evaluation protocol: take a fixed mid-run checkpoint, anneal it on a candidate dataset, compare scores. Used to price a dataset, not to train a final model. | Llama 3 and OLMo both evaluate candidate corpora this way |
torch.optim.Adam(weight_decay=...)); they are the same only for plain SGD.optimizer.eval() first.Learning-rate failure modes in training curves (oscillation, NaN, plateaus, spikes) are diagnosed on the parent page's When training goes wrong tab.
src/inputs/extracts.txt. Every optimiser rule is checked against PyTorch (src/checks/torch_ref.py), every schedule against torch.optim.lr_scheduler, every derived number in src/recompute.py and src/ns_data.py. Data as of October 2026.Each optimiser starts from the same point on the same two-parameter loss surface and takes the steps its published update rule prescribes. Nothing is simulated loosely: every rule is the line-by-line update of the implementation named under it, run in double precision, and checks/torch_ref.py reruns all 350 combinations (13 optimisers, 5 surfaces, 3 schedules, 2 learning rates) in PyTorch: they agree to 10−13, or, where a run is chaotic (Rosenbrock at large rates), to within what PyTorch itself moves when its start is nudged by 10−12.
The surfaces are toys with two parameters, chosen because each isolates one difficulty: a badly conditioned valley, the same valley rotated, a curved valley, a saddle, and noise. They teach the geometry of each rule; they do not rank optimisers for networks with billions of parameters (that evidence is in the Reading tab's section 5, The evidence).
checks/tune.mjs. The slider multiplies every optimiser's rate by the same factor, so you can see how sensitive each one is.Shading and contour lines: log10 of the loss, one line per half decade. Ring: the start. Triangle: the minimum. Dot: where each optimiser is at the step shown.
checks/race_facts.mjs). That is the reason schedules decay.Thirteen optimisers, exact update rules checked against PyTorch, on five 2-D surfaces; rates, schedules and noise seeds to change. (4 min)
Reading, section 5 (Update): the optimiser families and the schedule question (must it know the run's end?) at the level of one training step, with links to the sections here; the step strip runs one real SGD and AdamW step on the toy whose 64 × 176 gradient section 4 orthogonalises. Training lab: SGD, momentum, Adam, AdamW and Muon with step, cosine or WSD schedules, trained live. Defaults across models: optimiser, betas, epsilon, learning rate, warmup, schedule, final rate, weight decay and clipping for 21 models. When training goes wrong: learning-rate failure modes (oscillation, NaN, plateaus, spikes), which used to live on the "Debugging training" page. (30 min, plus 1 in closed details)
The NanoGPT speedrun record by record (where Muon was born), the anneal as a data lever, and a toy that separates the learning-rate decay from the data switch. (24 min, plus 4 in closed details)
MuonClip and QK-Clip at trillion scale: why Muon let attention logits grow and how K2 capped them. (38 min, plus 10 in closed details)
Weight decay from the regularisation side, and Adam with L2 against AdamW animated on the same noise (section 3). (32 min, plus 8)
What goes into the anneal mixture while the rate falls. (45 min)
Hessians, Newton's method and conditioning as mathematics. (32 min)
Where the optimiser state lives across GPUs (ZeRO stages, FSDP). (32 min, plus 5 in closed details)
Sampling temperature, the other thing called "temperature" (unrelated to annealing). (22 min, plus 4 in closed details)
Merge instead of decay, trained live at toy scale, with the equivalence test and every table rebuilt. (20 min)
The 16 bytes per parameter of mixed-precision Adam, and how to shard them. (24 min)
The inverse-square-root schedule with 4,000 warmup steps (Equation 3), with a live control. (20 min)
Why the cosine length must match the run, and what that did to Kaplan's scaling laws. (23 min)
A 1.2M-step cosine schedule at 405B, and the annealing experiments. (31 min)
A WSD-shaped schedule with a two-step tail at 14.8T tokens. (32 min)
Mid-training anneals, microanneals and souping. (29 min)
The canonical survey, SGD through Adam and Nadam. (40 min)
Interactive intuition for momentum on quadratics. (30 min)
The design, the Newton-Schulz coefficients, the records. (25 min)
Muon as steepest descent under a matrix norm. (30 min)
Constant rate plus cooldown, cooldown shape and length. (45 min)
What is actually implemented, with the exact formulas. (30 min)
Eleven optimisers against a well-tuned AdamW, up to 1.2B parameters: what the speed-ups shrink to. (45 min)
The only benchmark that times optimisers end to end across eight workloads. (45 min)
Schedule-free optimisation. (45 min)
Adam in Shampoo's eigenbasis. (45 min)
Why linear decay to zero beats 10× decay at compute-optimal sizes. (45 min)
The critical batch and the gradient noise scale behind section 6. (45 min)
The linear scaling rule and gradual warmup. (30 min)
The square-root rule for Adam, with its betas and epsilon. (45 min)
Cosine cycles with restarts. (45 min)
The one-cycle policy. (45 min)
Where WSD was named. (90 min)
The paper behind the WSM page. (45 min)