Quant Memo
Core

Learning Rate Schedules

A learning rate schedule changes the step size over the course of training on purpose — usually large steps early to cover ground fast, shrinking steps later to settle precisely into a minimum, the way a driver slows down as they approach a parking spot.

Prerequisites: Gradient Descent

A single, fixed learning rate faces a genuine dilemma: large enough to make fast progress early in training, but small enough not to bounce wildly around the minimum once training gets close to it, are usually two different numbers. A learning rate that's perfect for the first hundred steps is often too large for the last hundred, and one that's safe for the last hundred would have crawled agonisingly slowly through the first. A schedule resolves the dilemma by not picking one number at all — it changes the rate as training proceeds.

The analogy: driving toward a parking spot

Driving across a large empty parking lot toward a spot far away, you'd naturally go fast — there's plenty of room and no need for caution. As you get close to the actual spot, you slow down, because now precision matters more than speed and a fast approach risks overshooting or clipping something. Nobody drives the entire trip, start to finish, at one single fixed speed chosen as some compromise between "fast enough to get there" and "slow enough to park precisely." A learning rate schedule is this same instinct applied to training: cover distance fast early, then ease off as you approach something you don't want to overshoot.

The maths: a few common shapes

Step decay multiplies the rate by a fixed factor every so many steps:

ηt=η0γt/s\eta_t = \eta_0 \cdot \gamma^{\lfloor t / s \rfloor}

Here η0\eta_0 is the starting rate, γ<1\gamma<1 the decay factor, ss the number of steps between drops, and \lfloor \cdot \rfloor rounds down. In words: every ss steps, multiply the current rate by γ\gamma — the rate drops in discrete jumps, like halving every 10 epochs.

Cosine annealing decays smoothly, following one quarter of a cosine wave down from η0\eta_0 to near zero over TT total steps:

ηt=η012(1+cos(πtT))\eta_t = \eta_0 \cdot \frac{1}{2}\left(1 + \cos\left(\frac{\pi t}{T}\right)\right)

In words: the rate starts at η0\eta_0, barely changes at first, then falls steeply through the middle of training, then flattens out again as it approaches zero near the end — a smooth version of the same "fast then careful" idea, without step decay's abrupt jumps.

Warmup does the opposite at the very start: ramp the rate up linearly from zero over the first few hundred steps, before any decay schedule takes over, because a large rate applied to randomly initialised weights before the network has found any sensible direction can cause an early, destabilising blowup.

Worked example 1: step decay, three drops

η0=0.1\eta_0 = 0.1, γ=0.5\gamma = 0.5, drop every s=1000s=1000 steps. At step 500500: 500/1000=0\lfloor 500/1000\rfloor = 0, so η=0.1×0.50=0.1\eta = 0.1 \times 0.5^0 = 0.1. At step 15001500: 1500/1000=1\lfloor 1500/1000 \rfloor = 1, so η=0.1×0.5=0.05\eta = 0.1 \times 0.5 = 0.05. At step 32003200: 3200/1000=3\lfloor 3200/1000\rfloor=3, so η=0.1×0.53=0.0125\eta = 0.1 \times 0.5^3 = 0.0125. Each threshold crossed halves the rate again — by step 3200 the effective rate is an eighth of where it started, even though nothing about the loss triggered the drop, only the step count.

Worked example 2: cosine annealing at three points

η0=0.01\eta_0 = 0.01, T=1000T = 1000 total steps. At t=0t=0: η=0.01×0.5(1+cos0)=0.01×1=0.01\eta = 0.01 \times 0.5(1+\cos 0) = 0.01 \times 1 = 0.01 — full rate. At t=500t=500 (halfway): η=0.01×0.5(1+cos(π/2))=0.01×0.5(1+0)=0.005\eta = 0.01 \times 0.5(1+\cos(\pi/2)) = 0.01\times0.5(1+0)=0.005 — exactly half. At t=1000t=1000 (the end): η=0.01×0.5(1+cosπ)=0.01×0.5(11)=0\eta = 0.01\times0.5(1+\cos\pi) = 0.01\times0.5(1-1)=0 — the rate has smoothly reached zero right as training ends, so the very last steps are essentially fine-tuning with an infinitesimal nudge, which is exactly the "precise parking" behaviour the schedule was designed for.

Function explorer
-2222.0
x = 1.00f(x) = 2.000

Picture the cosine schedule's shape — high and flat at the start, a steep fall through the middle, flat near zero at the end — a curve of that general falling character to the one you can explore here, just built from cosine instead of a power law.

Convergence explorer
true meansamples →
after n = 200estimate -0.025error 0.025std error 0.071

The explorer above shows an estimate needing large early corrections and only small late ones to settle — that's the same logic a decaying schedule imposes deliberately: big steps while far from the answer, tiny ones while refining it.

A learning rate schedule trades a single compromise rate for two different regimes on purpose: large steps to make fast early progress, shrinking steps to settle precisely — and the shape of the decay (step, cosine, or otherwise) controls how gradual that trade-off is.

What this means in practice

Cosine annealing and warmup are close to standard in modern deep learning training recipes, especially for large models where a bad early learning-rate spike can waste enormous compute before it's caught. Adaptive optimisers like Adam already adjust per-parameter rates, but they don't remove the value of also scheduling the global rate over time — the two operate on different axes and are commonly combined.

The classic mistake is assuming an adaptive optimiser makes a schedule unnecessary. It doesn't: Adam's adaptivity handles the mismatch in scale between parameters at a given moment, but a schedule handles the separate need to shrink the overall step size as training approaches a minimum — the two problems don't cancel each other out, and most well-tuned modern training runs use both together.

Related concepts

Practice in interviews

Further reading

  • Goodfellow, Bengio & Courville, Deep Learning, ch. 8.5
  • Smith, Cyclical Learning Rates for Training Neural Networks (2015)
ShareTwitterLinkedIn