Learning Rate Schedules: Warmup, Decay & Cycling

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

published · difficulty 3/5 · 14 min read

Reading map and next steps

Intuition

Build the mental picture first so the rest of the page has something to attach to.

PredictName the object in plain language, then predict what should change.Leave with one reusable mental picture before notation appears.

The learning rate is a scalar multiplier in an optimizer update. In plain gradient descent it directly scales the gradient step; adaptive optimizers also transform the gradient before applying that multiplier. Changing the multiplier over a finite run changes how large the optimizer's applied updates can be at different times.

Two page-local teaching patterns, treated here as extensions beyond the listed Smith/SGDR sources:

  • Warmup: start small, then ramp up. This page uses warmup as a teaching pattern for smaller early update scale, but the listed Smith/SGDR sources do not by themselves source large-model warmup practice or Adam warmup rationale.
  • Decay: reduce the learning-rate multiplier later so the scalar update scale is smaller late in training.

This page includes warmup followed by decay as a teaching shape, but this source-checked claim focuses only on learning-rate range tests, cyclical policies, and cosine annealing/restarts.

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

InspectTrack the same object through the notation and check each symbol.Leave with the invariant the equations preserve.

Indexing note. This page defines exactly TT learning rates applied to optimizer updates t=0,…,T−1t=0,\ldots,T-1. Assume integers T≥2T\ge 2 and 0≤Tw<T0\le T_w<T, with 0≤ηmin⁡≤ηmax⁡0\le \eta_{\min}\le \eta_{\max}. This finite, endpoint-inclusive definition is a page-local teaching convention, not a universal scheduler API convention; libraries differ over whether a boundary value is an applied update or a scheduler state before or after one. The warmup omits the conceptual zero endpoint, so its first applied rate is positive when ηmax⁡>0\eta_{\max}>0; ηmax⁡=0\eta_{\max}=0 admits the degenerate all-zero schedule.

For a decay coordinate u∈[0,1]u\in[0,1], define

Dlinear(u)=(1−u)ηmax⁡+uηmin⁡,Dcosine(u)=ηmin⁡+12(ηmax⁡−ηmin⁡)(1+cos⁡(πu)).D_{\mathrm{linear}}(u)=(1-u)\eta_{\max}+u\eta_{\min}, \qquad D_{\mathrm{cosine}}(u)=\eta_{\min}+\tfrac12(\eta_{\max}-\eta_{\min})\left(1+\cos(\pi u)\right).

Choose D=DlinearD=D_{\mathrm{linear}} or D=DcosineD=D_{\mathrm{cosine}}. When Tw=0T_w=0, there is no warmup phase, and DD spans all TT applied updates:

ηt=D ⁣(tT−1),0≤t<T.\eta_t=D\!\left(\frac{t}{T-1}\right),\qquad 0\le t<T.

When Tw>0T_w>0, the first TwT_w applied updates form a linear warmup that omits the conceptual zero endpoint, followed by decay:

ηt={ηmax⁡t+1Tw,0≤t<Tw,D ⁣(t−Tw+1T−Tw),Tw≤t<T.\eta_t= \begin{cases} \displaystyle \eta_{\max}\frac{t+1}{T_w}, & 0\le t<T_w,\\[6pt] \displaystyle D\!\left(\frac{t-T_w+1}{T-T_w}\right), & T_w\le t<T. \end{cases}

Update Tw−1T_w-1 reaches ηmax⁡\eta_{\max} and is the shared u=0u=0 endpoint of warmup and decay. When ηmin⁡<ηmax⁡\eta_{\min}<\eta_{\max}, update TwT_w uses u=1/(T−Tw)u=1/(T-T_w) and is already below the peak, so the peak is not repeated. When ηmin⁡=ηmax⁡\eta_{\min}=\eta_{\max}, the post-warmup segment instead remains constant at ηmax⁡\eta_{\max}. The final applied update, t=T−1t=T-1, uses u=1u=1 and reaches ηmin⁡\eta_{\min}. Here ηmin⁡\eta_{\min} is the decay endpoint, not necessarily the minimum over the warmup-and-decay sequence: an early positive warmup rate can be smaller.

A separate page-local teaching alternative is inverse-square-root decay, where η0\eta_0 is the rate at update t=0t=0:

ηt=η0t+1.\eta_t = \frac{\eta_0}{\sqrt{t+1}}.

For every displayed family, the demo's reported mean is the discrete mean over all applied updates,

ηˉ=1T∑t=0T−1ηt,\bar\eta=\frac{1}{T}\sum_{t=0}^{T-1}\eta_t,

not the mean of the smaller set of points used to draw the chart. SGDR supplies the within-cycle half-cosine shape and its maximum/minimum endpoints; it does not supply this page's linear warmup or finite-update indexing.

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

Code

Keep the implementation aligned with the notation so the algorithm is legible.

TraceMatch variables to symbols before reading the implementation.Leave with a runnable witness for the math.
import math

def warmup_cosine(T, Tw, eta_max, eta_min):
    if not isinstance(T, int) or isinstance(T, bool) or T < 2:
        raise ValueError("T must be an integer with T >= 2")
    if not isinstance(Tw, int) or isinstance(Tw, bool) or not 0 <= Tw < T:
        raise ValueError("Tw must be an integer with 0 <= Tw < T")
    if not all(math.isfinite(v) for v in (eta_max, eta_min)):
        raise ValueError("learning-rate bounds must be finite")
    if not 0 <= eta_min <= eta_max:
        raise ValueError("require 0 <= eta_min <= eta_max")

    lr = [0.0] * T
    for t in range(T):
        if Tw > 0 and t < Tw:
            lr[t] = eta_max * (t + 1) / Tw
        else:
            u = t / (T - 1) if Tw == 0 else (t - Tw + 1) / (T - Tw)
            lr[t] = eta_min + 0.5 * (eta_max - eta_min) * (1 + math.cos(math.pi * u))
    return lr

T, Tw = 10_000, 500
lr = warmup_cosine(T=T, Tw=Tw, eta_max=3e-4, eta_min=3e-5)
print("lr[0], lr[Tw-1], lr[Tw], lr[-1]:", lr[0], lr[Tw - 1], lr[Tw], lr[-1])
print("avg lr over all applied updates:", sum(lr) / len(lr))
Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

Interactive Demo

Use direct manipulation to connect the explanation to a moving system.

ManipulateChange one control and predict the visible response before reveal.Leave with the observed invariant or a repaired model.

Live Concept Demo

Explore Learning Rate Schedules: Warmup, Decay & Cycling

The stage is code-native and interactive. Use it to test the explanation against the mechanism.

difficulty 3/5undergraduatecode-aligned
Demo inquiry checkpoint

Manipulate one control and predict the visible change.

01Choose lensTrace a quantity
02ObserveDemo state pending
03GroundName the equation, invariant, or control that explains it.
04CarryNext: Scaling Laws & Emergent Abilities

Choose what to inspect in Learning Rate Schedules: Warmup, Decay & Cycling. This shared fallback is an observation guide, not evidence of learning.

Loading interactive demo...

Predict the schedule's behavior, then reveal the finite applied-update sequence. Tune warmup length and decay style while watching the exact first rate, mean over all TT updates, final rate, and the boundary between the last warmup update and the first decay update. The chart uses a smaller anchored sample only for drawing.

Section prompt

Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.

4/4 sections ready

Concept: Learning Rate Schedules: Warmup, Decay & Cycling

What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math?

BeforeAdam OptimizerNow4/4 sections readyTryManipulate one control and predict the visible change.NextScaling Laws & Emergent Abilities
Object contextOptimization
ConceptLearner lens

Learning Rate Schedules: Warmup, Decay & Cycling

What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math?

Mode questionCan I say the mechanism back in one sentence before I reveal anything?

Start with the prediction checkpoint, then compare the reveal to the mental model.

Take this move

Study modes

Keep the object fixed; change the lens.

Route back through the notebook

Carry the same object through intuition, math, code, and demo.

4/4 sections ready
Carry inAdam Optimizer

Bring the mental model from Adam Optimizer; this page will reuse it instead of restarting from zero.

Work hereLearning Rate Schedules: Warmup, Decay & Cycling

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

Carry outScaling Laws & Emergent Abilities

The next edge should feel earned: use the demo prediction here before following Scaling Laws & Emergent Abilities.

After The First Pass

Turn the concept into an inspected object.

The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.
ConceptLearning Rate Schedules: Warmup, Decay & CyclingOptimization

Mechanism Storyboard

See the idea move before the page explains it

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

Demo notes open01 / Intuition
Editorial optimization illustration of warmup, decay, and cycling learning-rate curves over training steps.
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

Before reading further, choose the kind of change Learning Rate Schedules: Warmup, Decay & Cycling should make visible.

Visual Inquiry

Make the image answer a mathematical question

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

4/4 stages readyDemo notes connected
Prediction

Which visible object should carry the first intuition?

Commit first

Pick the cue that should make Learning Rate Schedules: Warmup, Decay & Cycling easier to reason about before the page gives the answer.

Source Grounding

Canonical references for the mechanism on this page.

Object - ConceptLearning Rate Schedules: Warmup, Decay & CyclingQuestion

What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math?

concept:optimization/learning-rate-schedules
Boundary

sources: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr

Check

Open the closest source note before trusting the local explanation.

Evidence

2 selected-object sources shown first; 2 references total.

Next move

Audit the claim boundary, then ask from the same selected object.

selected object source · paper · 2015Cyclical Learning Rates for Training Neural NetworksSmith
Located CF editorial boundary

Grounds LR range tests and cyclical policies that vary the global learning rate between lower and upper bounds.

Used here as

Smith supports LR range tests and CLR between boundary values. SGDR supports cosine annealing between maximum and minimum endpoints within a restart cycle. The finite-update indexing, sha...

Caveat

Does not check warmup practice or rationale, inverse-sqrt schedules, a universal scheduler-library indexing convention, convergence guarantees, or schedule superiority. Source support cov...

Open source
selected object source · paper · 2016SGDR: Stochastic Gradient Descent with Warm RestartsLoshchilov and Hutter
Located CF editorial boundary

Grounds the endpoint-inclusive half-cosine shape within SGD warm-restart cycles. It does not define this page's linear warmup or its enumeration of exactly T applied updates.

Used here as

Smith supports LR range tests and CLR between boundary values. SGDR supports cosine annealing between maximum and minimum endpoints within a restart cycle. The finite-update indexing, sha...

Caveat

Does not check warmup practice or rationale, inverse-sqrt schedules, a universal scheduler-library indexing convention, convergence guarantees, or schedule superiority. Source support cov...

Open source

Claim Review

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

Object - ConceptLearning Rate Schedules: Warmup, Decay & CyclingQuestion

What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math?

concept:optimization/learning-rate-schedules
Boundary

sources: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr

Check

Treat every claim as provisional until source support and a local witness agree.

Evidence

1 structured claim check on this concept.

Next move

Run the prediction or practice transfer before asking for a grounded review.

1 CF editorial source-scope review recorded

Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 2 references and 3 local witnesses are available for inspection.

Learning-rate schedules change the scalar learning rate over training. Smith supports LR range tests and cyclical policies that vary LR between bounds; SGDR supports cosine annealing with warm restarts. Warmup, inverse-sqrt decay, and LLM-oriented framing here are teaching extensions, not sourced by these papers.
Used here as

Smith supports LR range tests and CLR between boundary values. SGDR supports cosine annealing between maximum and minimum endpoints within a restart cycle. The finite-update indexing, shared boundary, and ex...

Local witness
Equation 1
Dlinear(u)=(1−u)ηmax⁡+uηmin⁡,Dcosine(u)=ηmin⁡+12(ηmax⁡−ηmin⁡)(1+cos⁡(πu)).D_{\mathrm{linear}}(u)=(1-u)\eta_{\max}+u\eta_{\min}, \qquad D_{\mathrm{cosine}}(u)=\eta_{\min}+\tfrac12(\eta_{\max}-\eta_{\min})\left(1+\cos(\pi u)\right).
Equation 2
ηt=D ⁣(tT−1),0≤t<T.\eta_t=D\!\left(\frac{t}{T-1}\right),\qquad 0\le t<T.
Caveat

Does not check warmup practice or rationale, inverse-sqrt schedules, a universal scheduler-library indexing convention, convergence guarantees, or schedule superiority. Source support covers only LR range te...

Review stateCF editorial source-scope reviewClaim metadata: source checkedPublisher-side editorial review only; not independent replication. Check caveats and exact source scope.

Smith supports scalar LR as a key hyperparameter, CLR between bounds, and an LR range test for selecting bounds. Loshchilov and Hutter support warm restarts and half-cosine annealing from eta_max to eta_min within a cycle. Neither paper defines this page's linear warmup, inverse-sqrt family, finite applied-update indexing, convergence behavior, or schedule superiority; those claims are excluded or labeled as page-local teaching definitions.

Reviewer: codex+gpt-pro; reviewed 2026-08-21

Practice · Learning Rate Schedules: Warmup, Decay & Cycling

Try the idea in your own words

Schedule shapes that change the scalar learning-rate scale over training, with sourced CLR/range-test and SGDR cosine-restart examples plus caveated warmup/decay teaching patterns.

Concept · Current object

Learning Rate Schedules: Warmup, Decay & Cycling

Source boundary: sources: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr

Object context and links

Optimization

concept:optimization/learning-rate-schedules
Choose a task

Explain the mechanism

For Learning Rate Schedules: Warmup, Decay & Cycling: What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math? Explain your answer, including what changes, why, and which assumption matters.

No answer yet

A rough first thought is enough. Your draft stays when you change tasks.

Local to this page session. Not saved after leaving or reloading.

A little help · Explain

Open one hint at a time. These are suggestions, not your answer or a grade.

0 of 3 hints shown for this question.

    Clearing your answer does not erase help history. Outside help cannot be verified here.

    Where am I stuck? (optional)
    Your own description, not an automatic diagnosis

    Choose one, or leave this unspecified. Select it again to clear it.

    Take your draft to a feedback conversation

    No AI feedback runs here. You can copy a prompt to use elsewhere; nothing is sent automatically. Review the text before sharing, and leave out private information.

    Write an attempt before copying a feedback prompt.

    This draft and any AI response do not establish mastery. Try a different case later without help; this page has not measured that learning.

    Grounded object roomClose
    Selected object routeAsk from this object; carry one invariant back.sources: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr
    1. ObjectConceptLearning Rate Schedules: Warmup, Decay & Cycling
    2. PredictBefore revealLearning Rate Schedules: Warmup, Decay & Cycling prediction
    3. WitnessCompare codeLearning Rate Schedules: Warmup, Decay & Cycling code witness 1
    4. RoomAsk groundedChecking local snapshot
    ConceptLearning Rate Schedules: Warmup, Decay & CyclingOptimization

    Research Room

    Attach the question to an exact object

    Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.
    Next local actionNo local draft saved yet

    Open the draft below to save one note and next action in this browser.

    conceptOptimization

    Learning Rate Schedules: Warmup, Decay & Cycling

    Anchored question

    What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math?

    Source boundaryInspect source ids: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdrStable content-object key attached
    Role lenses for this object

    These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.

    Learner evidence requestAsk what would make "Learning Rate Schedules: Warmup, Decay & Cycling" feel predictable rather than familiar.
    Assumption

    Source ids smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr must support the exact object, not just the surrounding topic.

    Source-checking summary

    Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.

    Proposed experiment

    Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.

    Next action

    The learner can state the mechanism in their own words

    Evidence4 checks
    PredictionChecking carried observation
    ActionReady for one action
    AILearner handoff ready
    Open source object
    01PredictionChecking browser-local route memory
    02EvidenceChecking for a carried observation
    03BoundaryInspect source ids: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr
    04Next moveSave one next action
    Local action draftNo local draft saved yetExpand only when ready to capture one local next action
    Local action draft

    This draft stays locally in this browser for concept:optimization/learning-rate-schedules.

    No local draft saved.
    Evidence to inspect
    • Source ids to inspect: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr
    • Definition, prerequisite, and contrast concept links
    • The equation or code witness that makes the concept operational
    • One demo state that shows the invariant instead of a slogan
    What would resolve this
    • The learner can state the mechanism in their own words
    • The learner can name the prerequisite that would repair confusion
    • The learner can predict how the mechanism changes under one perturbation
    Object-attached AI handoff

    I am working in Continuous Function's research reading room. Object: concept - Learning Rate Schedules: Warmup, Decay & Cycling Object key: concept:optimization/learning-rate-schedules Context: Optimization Anchor id: concept/concept-notebook/optimization/learning-rate-schedules Open question: What is the smallest example that makes Learning Rate Schedules: Warmup, Decay & Cycling click without losing the math? Evidence to inspect: - Source ids to inspect: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Learning Rate Schedules: Warmup, Decay & Cycling" feel predictable rather than familiar." | assumption: Source ids smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Learning Rate Schedules: Warmup, Decay & Cycling" feel predictable rather than familiar. - Assumption to keep visible: Source ids smith-2015-cyclical-learning-rates, loshchilov-2016-sgdr must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words

    concept/concept-notebook/optimization/learning-rate-schedules concept:optimization/learning-rate-schedules