Simple Algorithm
Deep Learning · Emergence · 28 min

Schedules Without a Horizon

Warmup–stable–decay, schedule-free optimization and why cooldowns work.

A cosine schedule has to be told when training will end. Stop early and the model never cools down; carry on past the end and the rate is too small to make progress; compare two run lengths and you need two runs from scratch. This lesson covers the two ways out, holding the rate constant and branching off a short cooldown whenever a model is needed, or averaging iterates instead of decaying at all, and the convex theory that, surprisingly, predicts the shape of real loss curves under cosine and warmup–stable–decay schedules.

What you’ll learn

  • Explain why a horizon-dependent schedule complicates stopping, extending and comparing runs, and why the last iterate of SGD cannot be good at every step without a known horizon.
  • Describe warmup–stable–decay training and its evidence: the length and shape of the cooldown, its match with cosine and the savings for scaling-law studies.
  • Estimate how much noise a cooldown of length KK leaves, and use the convex last-iterate bound for a general schedule: a constant rate pays a factor 1+HT−1≈ln⁡T\sqrt{1+H_{T-1}}\approx\sqrt{\ln T} that a cooldown removes, and linear decay attains DG/TDG/\sqrt T.
  • Derive that averaging SGD's iterates implements a linear decay ending at the current step, state schedule-free SGD and its guarantee, and weigh its practical record.

Training without an end date

Learning-Rate Schedules & Warmup listed the symptoms of tying a schedule to its horizon TT: a run stopped early never cools down, a finished run cannot usefully be continued, and every training length to be compared costs a run from scratch. Behind them sits a theorem from the same lesson: for least squares, whatever the step sizes, the last iterate of SGD is far from optimal infinitely often unless TT is fixed in advance (Ge, Kakade, Kidambi & Netrapalli, 2019). An anytime method must therefore change what it returns, not only its step sizes. Three ideas have been tried.

ApproachFixed in advanceCost of a model at a new stepRecord
Warm restarts (SGDR)the cycle lengths, e.g. doubling each timenone, but only at the end of a cycledesigned for anytime performance (Loshchilov & Hutter, 2017); each restart temporarily worsens the loss
Constant rate with branched cooldowns (WSD)the peak ratea cooldown of 10–20% of the steps taken so farmatches cosine on language models (Hu et al., 2024; Hägele et al., 2024)
Averaging the iterates (schedule-free methods, tail averages)the averaging rulenone: the average is always currentSchedule-Free AdamW won the self-tuning ruleset of the 2024 AlgoPerf competition; plain averages trail a cooldown
The last two rows are the subject of this lesson; Weight Averaging: SWA, EMA & Model Soups treats averaging for its own sake.

Warmup–stable–decay

Zhai, Kolesnikov, Houlsby & Beyer (2022) wanted to train each vision transformer for several durations, to map the trade-off between model size and training time. With linear decay each duration needed its own run, so they tried "infinite" schedules (a constant rate, a reciprocal square root, or a trapezoid of warmup, constant phase and decay), each finished by a linear cooldown toward zero. Linear decay was still slightly better when the duration was known in advance, but all three came reasonably close and allowed indefinite training, with many durations evaluated from one run. Hu et al. (2024) named the trapezoid warmup–stable–decay (WSD) while training the MiniCPM language models: the loss fell sharply as soon as the decay began, a decay over 10% of the tokens was enough while 2.5% fell short, and training could resume at the high rate from the checkpoint taken before a decay.

Hägele, Bakouch, Kosson, Ben Allal, Von Werra & Jaggi (2024) then compared WSD with cosine systematically, on language models of up to 8 billion parameters:

  • With each peak tuned, a constant rate followed by a linear cooldown over the last 20% of the steps matched cosine's final loss at every training length tested, and the best constant rate was about half the best cosine peak.
  • A cooldown shaped like 1−⋅1-\sqrt{\cdot} beat a linear one, increasingly so for longer runs. The gain from a longer cooldown leveled off near 20% of the steps, and long runs needed even less: 10,000 cooldown steps at the end of a 200,000-step run nearly matched cosine.
  • The loss falls smoothly along the straight line from the checkpoint before a cooldown to the one after it; in their words, "the cooldown phase is a smooth transition to a basin in the loss landscape."
  • Averaging the weights along the constant-rate branch improved the loss without any decay, but did not reach a cooldown.
ηt=ηmax⁡×{t/Tw,t<Tw1,Tw≤t<T−Tc1−t−(T−Tc)Tc,T−Tc≤t≤T\eta_t=\eta_{\max}\times\begin{cases}t/T_w, & t<T_w\\[4pt]1, & T_w\le t<T-T_c\\[4pt]1-\sqrt{\dfrac{t-(T-T_c)}{T_c}}, & T-T_c\le t\le T\end{cases}
Warmup–stable–decay with a cooldown of length TcT_c in the 1−⋅1-\sqrt{\cdot} form of Hägele et al. (2024); the linear form replaces the square root by 1−t−(T−Tc)Tc1-\frac{t-(T-T_c)}{T_c}. Only the cooldown depends on TT, so the stable branch can keep running while a cooldown is forked from any checkpoint whenever a finished model is needed.
Predict before you look

You want models trained on DD, 2D2D, 4D4D and 8D8D tokens. Separate cosine runs cost 1+2+4+8=15D1+2+4+8=15D tokens of training. With one WSD run and a cooldown over the last 20% of each budget, forked from the stable branch, how many DD does the whole study cost?

Show the answer

9.4

The stable branch must reach the last fork at 0.8×8D=6.4D0.8\times8D=6.4D, and the four cooldowns add 0.2×(1+2+4+8)D=3D0.2\times(1+2+4+8)D=3D: 9.4D9.4D in all, about 37% less than 15D15D, and each further budget costs only its own cooldown. For the Chinchilla study, with four token counts per model size and 10% cooldowns, Hägele et al. (2024) estimated about 2.4×10232.4\times10^{23} FLOPs instead of 5.6×10235.6\times10^{23}.

Why a short cooldown is enough

Three accounts of the sudden drop have been proposed, and they are compatible. The first needs nothing but the noise floor, and it says exactly how much noise a cooldown removes.

DerivationThe noise left by a linear cooldown
  1. −dvdτ=−2ηh τK v+η2τ2K2 σ2B-\frac{dv}{d\tau}=-\frac{2\eta h\,\tau}{K}\,v+\frac{\eta^2\tau^2}{K^2}\,\frac{\sigma^2}{B}

    Continue the one-direction model of Learning-Rate Schedules & Warmup, with curvature hh and gradient noise of variance σ2/B\sigma^2/B, in continuous time. A linear cooldown of KK steps from the rate η\eta has rate ητ/K\eta\tau/K when τ\tau steps remain. Counting time backward in τ\tau, the variance obeys a linear equation:

  2. vend≈η2σ2BK2∫0∞τ2e−ηhτ2/K dτ=π4 σ2B η1/2h3/2K1/2v_{\text{end}}\approx\frac{\eta^2\sigma^2}{BK^2}\int_0^{\infty}\tau^2e^{-\eta h\tau^2/K}\,d\tau=\frac{\sqrt\pi}{4}\,\frac{\sigma^2}{B}\,\frac{\eta^{1/2}}{h^{3/2}K^{1/2}}

    Multiply by the integrating factor e−ηhτ2/Ke^{-\eta h\tau^2/K} and integrate from the start of the cooldown, τ=K\tau=K, to its end, τ=0\tau=0. The starting variance survives only with weight e−ηhKe^{-\eta hK}, negligible once the cooldown is longer than the relaxation time 1/(ηh)1/(\eta h), and the Gaussian integral ∫0∞τ2e−cτ2dτ=π4c−3/2\int_0^\infty\tau^2e^{-c\tau^2}d\tau=\frac{\sqrt\pi}{4}c^{-3/2} finishes the job:

  3. E[L]−L⋆  ≈  ησ24B⏟floor at the peak⋅π/2ηhK(ηhK≫1)\E[\loss]-\loss^\star\;\approx\;\underbrace{\frac{\eta\sigma^2}{4B}}_{\text{floor at the peak}}\cdot\frac{\sqrt\pi/2}{\sqrt{\eta hK}}\qquad(\eta hK\gg1)

    The excess loss h2vend\frac h2v_{\text{end}}, compared with the floor ησ24B\frac{\eta\sigma^2}{4B} of the constant rate, is smaller by a factor of order ηhK\sqrt{\eta hK}, the square root of the cooldown length measured in relaxation times:

The discrete recursion agrees: for ηh=0.1\eta h=0.1 and K=3,200K=3{,}200 the formula and exact iteration both give an excess loss of 0.0124 ησ2/B0.0124\,\eta\sigma^2/B (computed for this lesson), about 5% of the floor, and each doubling of KK multiplies the leftover by 0.7050.705 to 0.7070.707, against the predicted 1/2≈0.7071/\sqrt2\approx0.707. Three consequences match the experiments. Stiff directions relax within a few steps, so even a short cooldown cleans them, and when the gradient noise is aligned with the curvature, as in the widget's model, they carry most of the noise floor: the loss falls as soon as the decay starts. Beyond that, returns diminish like 1/K1/\sqrt K, consistent with the plateau Hägele et al. found near 20% of the run. And directions whose relaxation time exceeds the cooldown keep their noise, but also the progress they made at the high rate, because a cooldown spends little area.

A landscape picture. Wen, Li, Wang, Hall, Liang & Ma (2025) conjecture that language-model losses have a river valley shape: steep "mountain" directions across a valley whose floor, the river, descends slowly. At a high rate the iterate oscillates up the valley walls, so the loss looks high, while it travels quickly along the river; the decay damps the oscillation and reveals the progress already made. In their analysis the stable phase drives progress along the river and the decay handles the mountain directions, so both are needed, and such a landscape already emerges when pretraining on a simple bigram dataset. It is the same division of labor as in the noise-floor account, with stiff directions as the walls and flat ones as the river. They also proposed WSD-S, which resumes the main branch from each decayed checkpoint rather than from before the decay, and found it better than WSD and cyclic cosine at producing models for several compute budgets in one run, at 0.1 to 1.2 billion parameters.

What convex theory predicts

The third account is the most surprising. Schaipp, Hägele, Taylor, Şimşekli & Bach (2025) showed that a bound from non-smooth convex optimization, with no noise floor and no valley in sight, reproduces the loss curves of language-model training under cosine and WSD, sudden drop included. The bound must concern the last iterate: bounds on the best or the average iterate show no drop.

ScheduleBound at T=1000T=1000Tuned base rate γ\gamma
constant0.0920.0920.0110.011
WSD, 10% linear cooldown0.0730.0730.0150.015
WSD, 20% linear cooldown0.0690.069, from 0.1060.106 just before the cooldown0.0160.016
WSD, 20% 1−⋅1-\sqrt{\cdot} cooldown0.0680.0680.0170.017
cosine to zero0.0650.0650.0310.031
linear decay0.0630.0630.0320.032
Computed for this lesson from the bound above, with D=G=1D=G=1 and the base rate tuned for each schedule. Like real runs, the bound drops sharply during the WSD cooldown, ranks the 1−⋅1-\sqrt{\cdot} cooldown above the linear one, puts linear decay first, and wants about twice the base rate for cosine as for WSD (Schaipp et al. fitted the tuned rate across horizons as γ⋆≈0.92 T−0.49\gamma^\star\approx0.92\,T^{-0.49} for cosine and 0.47 T−0.490.47\,T^{-0.49} for WSD). In their analysis the drop is sharpest when the gradient norms do not shrink to zero, and it also appears in worst-case lower bounds and when plain gradient descent minimizes a small non-smooth convex function, so it needs neither nonconvexity nor noise.
Predict before you look

For a constant rate the bound carries the factor 1+HT−1\sqrt{1+H_{T-1}}. About how large is that factor for a run of T=106T=10^6 steps? (Use Hn≈ln⁡n+0.577H_n\approx\ln n+0.577.)

Show the answer

3.92

H999999≈ln⁡106+0.577≈14.39H_{999999}\approx\ln10^6+0.577\approx14.39, so the factor is 15.39≈3.92\sqrt{15.39}\approx3.92. The tuned WSD bound with a 20% cooldown stays near 2.16 DG/T2.16\,DG/\sqrt T at every horizon from 10310^3 to 10610^6 (computed for this lesson), so its advantage grows from a factor 1.341.34 to 1.821.82: only logarithmic, but growing with the length of the run, and earned during the cooldown.

Schaipp et al. then used the bound in reverse for 124-million- and 210-million-parameter Llama-style models: it told them how to extend a finished WSD run with the right learning rate, and how to transfer a tuned rate from one schedule to another, and both choices improved the loss. The limits are plain. The theory is for SGD on convex functions, while the runs used AdamW on nonconvex networks, and why the agreement holds is not understood.

Averaging instead of decaying

DerivationAn average is an implicit linear decay
  1. zˉt=1t∑i=1tzi=z1−γt∑i=1t∑k<igk=z1−γ∑k=1t−1(1−kt) gk\bar{\mathbf z}_t=\frac1t\sum_{i=1}^{t}\mathbf z_i=\mathbf z_1-\frac{\gamma}{t}\sum_{i=1}^{t}\sum_{k<i}\mathbf g_k=\mathbf z_1-\gamma\sum_{k=1}^{t-1}\Big(1-\frac kt\Big)\,\mathbf g_k

    Run SGD with a constant step, zi+1=zi−γgi\mathbf z_{i+1}=\mathbf z_i-\gamma\mathbf g_i, so that zi=z1−γ∑k<igk\mathbf z_i=\mathbf z_1-\gamma\sum_{k<i}\mathbf g_k, and average the first tt iterates:

  2. γkimplicit=γ (1−kt),k=1,…,t−1\gamma_k^{\text{implicit}}=\gamma\,\Big(1-\frac kt\Big),\qquad k=1,\dots,t-1

    The gradient of step kk enters t−kt-k of the tt averaged points. The average is therefore where SGD with a linear decay ending at the current step would land, if it received the same gradients, and this holds for every tt at once: an anytime linear decay. Defazio et al. (2023) read the identity the other way round, as the reason linear decay is worst-case optimal: it emulates averaging.

  3. The catch is "the same gradients": they were computed at the fast-moving iterates zk\mathbf z_k, not along the decayed path. Plain Polyak–Ruppert averaging is optimal in convex theory, yet in deep learning it gives much worse results than the last iterate of a well-scheduled run (Defazio et al., 2024). Schedule-free methods change where the gradients are evaluated.

text
SCHEDULE-FREE ADAMW(x₁, γ, λ, T_w, β₁ = 0.9, β₂, ε)    // Defazio et al. (2024)
  z ← x₁;  x ← x₁;  v ← 0;  S ← 0
  for t = 1, 2, …
      y ← (1 − β₁)·z + β₁·x                // gradients are taken here
      g ← ∇ℒ_B(y)
      v ← β₂·v + (1 − β₂)·g ⊙ g
      γ_t ← γ·√(1 − β₂ᵗ)·min(1, t/T_w)      // warmup and bias correction
      z ← z − γ_t·g/(√v + ε) − γ_t·λ·y      // AdamW-like base step
      S ← S + γ_t²
      x ← (1 − γ_t²/S)·x + (γ_t²/S)·z       // weighted running average
  return x                                   // evaluate the average

There is no first-moment buffer: momentum comes from evaluating gradients at y\mathbf y, between the base sequence z\mathbf z and its average x\mathbf x, so memory matches AdamW's. Weighting the average by γt2\gamma_t^2 discounts the warmup steps; afterwards it is a uniform average. The model is evaluated at x\mathbf x, so batch-norm statistics, collected at y\mathbf y, must be recomputed on a few batches first. The authors' implementation stores z\mathbf z and one of x\mathbf x or y\mathbf y, switching between them for training and evaluation.

In practice. A β\beta near 0.90.9 works best: in a sweep for ResNet-50 on ImageNet, β=0.9\beta=0.9 reached 77.78% top-1, against 76.60% at 0.750.75 and 75.37% at 0.980.98. In the authors' evaluation on 28 problems, from logistic regression to large networks, schedule-free methods matched or beat tuned cosine schedules, and Schedule-Free AdamW won the self-tuning ruleset of the 2024 AlgoPerf competition, where no per-workload tuning is allowed (Kasimbeg et al., 2025; Benchmarking Deep Learning Fairly). The authors list the caveats: warmup is still needed, and the best learning rate and weight decay differ from those of a scheduled run, so both must be swept again. In an independent test on a 210-million-parameter language model, Hägele et al. (2024) found the method sensitive to its momentum parameters, poor with (β1,β2)=(0.9,0.95)(\beta_1,\beta_2)=(0.9,0.95) but remarkably good with (0.95,0.99)(0.95,0.99), and matched or beaten by a WSD cooldown, with neither method tuned further.

Key takeaways

  • Without a known horizon the last iterate of SGD cannot be good at every step, so anytime training changes what it returns: a cooldown branched from a constant-rate run, or an average of the iterates.
  • Warmup–stable–decay matches cosine when the cooldown covers about 10–20% of the steps, less in long runs; a 1−⋅1-\sqrt{\cdot} cooldown beats a linear one, the best constant rate is about half the best cosine peak, and scaling studies need far less compute (about 2.4×10232.4\times10^{23} instead of 5.6×10235.6\times10^{23} FLOPs for the Chinchilla suite, by Hägele et al.'s estimate).
  • A cooldown works because noise relaxes fastest in stiff directions while the progress made at the high rate is kept; the noise it leaves falls only like 1/K1/\sqrt K in its length KK. The convex last-iterate bound reproduces the sudden drop: a constant rate pays 1+HT−1≈ln⁡T\sqrt{1+H_{T-1}}\approx\sqrt{\ln T}, which a cooldown removes, and linear decay attains DG/TDG/\sqrt T.
  • The uniform average of SGD's iterates is an implicit linear decay ending at the current step. Schedule-free SGD evaluates gradients at yt=(1−β)zt+βxt\mathbf y_t=(1-\beta)\mathbf z_t+\beta\mathbf x_t and attains DG/TDG/\sqrt T for every β\beta; Schedule-Free AdamW won AlgoPerf's self-tuning ruleset but still needs warmup, its own tuning and recomputed batch-norm statistics.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In the convex last-iterate bound, what does a cooldown over a fixed fraction of the run change compared with a constant rate, both with tuned base rates?

  1. It removes the factor 1+HT−1≈ln⁡T\sqrt{1+H_{T-1}}\approx\sqrt{\ln T}, leaving the DG/TDG/\sqrt T rate up to a constant
  2. It improves the rate from 1/T1/\sqrt T to 1/T1/T
  3. Nothing: the two bounds are identical
  4. It removes the dependence on the initial distance DD
Show the answer

A. It removes the factor 1+HT−1≈ln⁡T\sqrt{1+H_{T-1}}\approx\sqrt{\ln T}, leaving the DG/TDG/\sqrt T rate up to a constant

For a constant rate the tuned bound is DGT1+HT−1\frac{DG}{\sqrt T}\sqrt{1+H_{T-1}}; for warmup–stable–decay with a cooldown proportional to TT the logarithm disappears. The rate stays 1/T1/\sqrt T, optimal for convex Lipschitz problems, and the improvement is earned during the cooldown, the sudden drop.

Question 2

Constant-step SGD produces iterates z1,…,zt\mathbf z_1,\dots,\mathbf z_t. Writing their uniform average in terms of the gradients, with what weight does the gradient of step kk enter?

  1. 11, as in the last iterate
  2. β t−k\beta^{\,t-k}, as in an exponential moving average
  3. 1−k/t1-k/t, as in a linear decay that ends at step tt
  4. 1/t1/t for every kk
Show the answer

C. 1−k/t1-k/t, as in a linear decay that ends at step tt

zi=z1−γ∑k<igk\mathbf z_i=\mathbf z_1-\gamma\sum_{k<i}\mathbf g_k, so gk\mathbf g_k appears in t−kt-k of the tt averaged points and the average is z1−γ∑k(1−k/t) gk\mathbf z_1-\gamma\sum_k(1-k/t)\,\mathbf g_k: the iterate of a linear decay to zero at the current step, whatever tt is. That is why averaging can replace a schedule, and why it is anytime.

Question 3

Schedule-free SGD evaluates gradients at yt=(1−β) zt+β xt\mathbf y_t=(1-\beta)\,\mathbf z_t+\beta\,\mathbf x_t, where zt\mathbf z_t is the SGD sequence and xt\mathbf x_t its running average. What do β=0\beta=0 and β=1\beta=1 give?

  1. β=0\beta=0: SGD with no averaging at all; β=1\beta=1: heavy-ball momentum
  2. β=0\beta=0: Polyak–Ruppert averaging, with gradients at the SGD iterates; β=1\beta=1: primal averaging, with gradients at the average
  3. β=0\beta=0: an exponential moving average; β=1\beta=1: a uniform average
  4. The same algorithm, since xt\mathbf x_t is returned in both cases
Show the answer

B. β=0\beta=0: Polyak–Ruppert averaging, with gradients at the SGD iterates; β=1\beta=1: primal averaging, with gradients at the average

With β=0\beta=0 the gradients are taken at zt\mathbf z_t, plain SGD, and the returned xt\mathbf x_t is its Polyak–Ruppert average. With β=1\beta=1 they are taken at the average itself, primal averaging, which is stable but slow. In between, a β\beta near 0.90.9 worked best in practice, and the DG/TDG/\sqrt T guarantee holds for every β∈[0,1]\beta\in[0,1].

Question 4

You switch a language-model recipe from cosine to warmup–stable–decay with a 20% cooldown. How should the peak rate change?

  1. Keep it: only the shape changed
  2. Double it, since WSD decays for a shorter time
  3. Raise it tenfold, since the cooldown is short
  4. Roughly halve it
Show the answer

D. Roughly halve it

WSD holds the peak for most of the run, so the same peak delivers much more area and much more noise. Hägele et al. (2024) found the best constant rate at about half the best cosine peak, and the convex last-iterate bound agrees: its tuned base rate for cosine is about twice that for WSD.

Further reading

  • A. Hägele, E. Bakouch, A. Kosson, L. Ben Allal, L. Von Werra & M. Jaggi, "Scaling laws and compute-optimal training beyond fixed training durations," NeurIPS (2024).
  • S. Hu, Y. Tu, X. Han et al., "MiniCPM: Unveiling the potential of small language models with scalable training strategies," arXiv:2404.06395 (2024).
  • A. Defazio, X. A. Yang, H. Mehta, K. Mishchenko, A. Khaled & A. Cutkosky, "The road less scheduled," NeurIPS (2024).
  • A. Defazio, A. Cutkosky, H. Mehta & K. Mishchenko, "Optimal linear decay learning rate schedules and further refinements," arXiv:2310.07831 (2023).
  • F. Schaipp, A. Hägele, A. Taylor, U. Şimşekli & F. Bach, "The surprising agreement between convex optimization theory and learning-rate scheduling for large model training," ICML (2025).