← All AI/ML articles

Learning rate & optimisers, visualised.

The learning rate is the single most important setting in training. Change it, schedule it over time, and swap the optimiser, then watch what happens on a real loss surface.

1. Pick a step size2. Shape it over time3. Choose how steps are built
Bright = low loss. Cyan path = the chosen optimiser, white dots = minima, ring = start. Click the map to move the start.
Behind the scenes · 1

The learning rate over time

A schedule changes η during training: big steps early to make progress, small steps late to settle. Warmup starts tiny and ramps up, which keeps the first few (often wild) steps under control.


η(t) for the chosen schedule and η₀.
Loss (log scale) for all four optimisers at the same η₀ and schedule. Thick line = chosen one. A line that stops early diverged.
Behind the scenes · 2

Find the sweet spot

Too small and nothing happens in the step budget; too large and the loss blows up. Between them is a window that works. The window is different for every optimiser, which is why one shared number is never a fair comparison. Click the chart to set η₀.


Final loss after the chosen number of steps for each η₀ (chosen optimiser and schedule). Top = diverged or clipped. White line = your η₀.
The mathematics

How each optimiser builds its step

A. Schedules

cosine: η(t) = η₀ · ½(1 + cos πt/T)  ,  exponential: η₀ e−3t/T  ,  step: η₀ · 0.5⌊4t/T⌋  ,  warmup: linear ramp over the first 5% of steps

B. Update rules

GD: θ ← θ − ηg Momentum: v ← βv − ηg θ ← θ + v (β = 0.9) RMSProp: s ← ρs + (1−ρ)g² θ ← θ − η g / (√s + ε) (ρ = 0.9) Adam: m ← β₁m + (1−β₁)g s ← β₂s + (1−β₂)g² θ ← θ − η m̂ / (√ŝ + ε), with m̂ = m/(1−β₁t), ŝ = s/(1−β₂t)
Why the same η means different things
  • Plain GD steps are proportional to the gradient size, so steep directions get huge steps.
  • RMSProp and Adam divide by a running gradient size, so each step is roughly η per coordinate, whatever the gradient scale.
  • Momentum adds up past steps: its effective step can be up to 1/(1−β) = 10 times larger.
Experiment

Break it on purpose

Too large a step

Gradient descent on the bowl just above its stability limit 2/λmax = 0.1.

Too small a step

Same setup with η = 0.001: stable, but barely moves in the step budget.

Does a schedule help?

Adam on Rosenbrock with η₀ = 0.1: constant vs cosine vs warmup + cosine.

Check yourself

Three quick questions

Key takeaways

  • Learning rate first: it sets how big every step is; too small crawls, too large diverges.
  • Schedules: large early, small late. Warmup tames the first steps.
  • Optimisers differ in how they build the step, so the good η range differs too. Compare them at tuned rates, not one shared number.
  • Adam is a strong default, not a universal winner.
← Back to all articles