The Learning Rate
Back in gradient
descent we hiked downhill in the fog, feeling the slope underfoot and taking a step
that way. The learning rate \alpha is your stride length
on that hike. It sounds like a small detail, but it decides whether the whole walk succeeds:
- Too small — you're taking tiny, cautious shuffles. You'll get there
eventually, in principle, but "eventually" might be thousands of steps away — training crawls.
- Too large — you're taking huge strides that carry you clean over the valley
floor and up the far wall. You can overshoot so badly that each step lands you further
from the minimum than the last, and the whole walk diverges, flying off to ever-worse
cost.
- Just right — brisk, confident strides that settle smoothly into the bottom of
the valley in only a handful of steps.
Picking a good learning rate is one of the most important practical skills in training any model —
get it wrong and even a perfectly correct gradient descent implementation will fail to learn
anything useful. Notice that the update rule itself never changes — it's always
w \leftarrow w - \alpha\,\frac{\partial J}{\partial w} — only the single
number \alpha decides whether that rule behaves like a careful hiker or
a reckless one.
Worked example: the same bowl, three different strides
Let's trace all three cases by hand on one simple bowl, J(w) = 0.5(w-1)^2 + 0.3,
whose slope is \frac{dJ}{dw} = w - 1 and whose minimum sits at
w = 1. Every trace below starts at the very same point,
w = -2.4 — only \alpha changes.
A well-chosen rate, \alpha = 0.5:
| Round | w (before) | slope w-1 | w (after) |
| 1 | −2.4 | −3.4 | −2.4 − 0.5(−3.4) = −0.7 |
| 2 | −0.7 | −1.7 | −0.7 − 0.5(−1.7) = 0.15 |
| 3 | 0.15 | −0.85 | 0.15 − 0.5(−0.85) = 0.575 |
| 4 | 0.575 | −0.425 | 0.575 − 0.5(−0.425) = 0.7875 |
| 5 | 0.7875 | −0.2125 | 0.7875 − 0.5(−0.2125) ≈ 0.894 |
In five brisk steps we're already at 0.894, closing in fast on the
minimum at 1. Each step covers exactly half the remaining distance —
smooth, confident, done.
Too small, \alpha = 0.05, same starting point:
| Round | w (before) | slope | w (after) |
| 1 | −2.4 | −3.4 | −2.23 |
| 2 | −2.23 | −3.23 | −2.0685 |
| 3 | −2.0685 | −3.0685 | −1.9151 |
| 4 | −1.9151 | −2.9151 | −1.7693 |
| 5 | −1.7693 | −2.7693 | −1.6309 |
Five whole rounds of arithmetic, and we've barely limped from -2.4 to
-1.63 — still miles from 1. It's heading the
correct way, it just needs dozens more rounds to arrive. Painfully slow, but not broken.
If you kept this trace going for, say, another thirty rounds, it would eventually creep all the way
to w \approx 1 — the same destination as the well-chosen run, just
arrived at far, far later.
Too large, \alpha = 2.5, same starting point:
| Round | w (before) | slope | w (after) |
| 1 | −2.4 | −3.4 | −2.4 − 2.5(−3.4) = 6.1 |
| 2 | 6.1 | 5.1 | 6.1 − 2.5(5.1) = −6.65 |
| 3 | −6.65 | −7.65 | −6.65 − 2.5(−7.65) = 12.475 |
| 4 | 12.475 | 11.475 | 12.475 − 2.5(11.475) = −16.2125 |
This is a completely different animal. The value doesn't creep towards 1
at all — it ricochets from side to side of the valley, and each bounce is bigger than the
last: -2.4, 6.1, -6.65, 12.475, -16.2. This is genuine
divergence: left running, the numbers would grow without bound. That's a far more
alarming failure than merely-slow progress — the small-rate run was always inching towards the
right answer, but this run is racing away from it.
Line all three traces up side by side and the lesson is unmistakable: the update rule
w \leftarrow w - \alpha\,\frac{\partial J}{\partial w} was
identical in every single case — same starting point, same cost function, the same
formula applied round after round. The only thing that changed between "smoothly solved in five
steps," "barely dented after five steps," and "flying off towards infinity after four steps" was
the one number \alpha. That is the entire reason the learning rate
deserves a concept page all to itself.
See it happen
Switch between three learning rates and watch the path down the bowl. The tiny rate barely
moves; the huge rate ricochets off the sides and climbs away from the answer; the
middle one glides to the bottom. Same algorithm, same data — only the step size differs.
Finding a good one
There's no universal best value for \alpha — the right stride length
depends on the shape of the particular cost surface you're descending, which depends on your model
and your data. So in practice, learning rate hunting is refreshingly unmathematical: you just try a
handful of candidate values — often spaced by powers of ten, like
0.001, 0.01, 0.1, 1 — run a short stretch of training with each, and
watch what the cost does.
- Cost falls steadily and reasonably fast — a good candidate.
- Cost falls painfully slowly, barely moving after many rounds — turn
\alpha up and try again.
- Cost bounces around or explodes upward — turn \alpha
down and try again.
This is exactly what watching the cost, not just w, would have
shown for our three traces above (all starting from the same J = 6.08):
| Round | Cost, \alpha=0.05 | Cost, \alpha=0.5 | Cost, \alpha=2.5 |
| 0 | 6.08 | 6.08 | 6.08 |
| 1 | 5.516 | 1.745 | 13.305 |
| 2 | 5.008 | 0.661 | 29.561 |
| 3 | 4.549 | 0.390 | 66.138 |
Read across the bottom row and the whole story is right there: the middle column is heading briskly
towards zero (the lowest possible cost, sitting right at the minimum); the left column is falling,
just at a crawl; and the right column isn't falling at all — it's rocketing upward, more than
doubling every round. This is the very first, cheapest thing to check when you sit down to train a
real model: run a handful of rounds at each candidate rate and just watch which column of numbers
you get.
It's an empirical, "try it and see" process, repeated until the cost curve looks like the smooth,
confident descent from the well-chosen trace above. Clever optimizers can even adjust
\alpha automatically as training goes — but the intuition you just built
by hand never changes.
A quick sanity check you can run in your head: after just one round on our example bowl,
\alpha = 0.05 moved the parameter by only 0.17,
\alpha = 0.5 moved it by 1.7, and
\alpha = 2.5 moved it by a wild 8.5 — clean
past the minimum and out the other side. The size of that very first jump, compared with how far
you actually are from the minimum, is often all it takes to tell a workable learning rate from a
doomed one, long before you've run the whole training loop.
-
Too large doesn't just mean "slower to arrive." As the trace above showed, a
badly oversized learning rate can make the cost increase with every single step,
diverging to worse and worse values forever. That's a fundamentally different (and much more
alarming) failure than a too-small rate, which is merely slow but still correct.
-
There's no one "right" number. A learning rate that works beautifully on one
model or dataset can be hopeless on another — too timid for a steep, narrow cost bowl, or wildly
too aggressive for a gentle, wide one. Look back at our worked traces: \alpha = 0.5
was the hero of that particular bowl, but plug that same 0.5 into a
much steeper cost surface and it could easily become the "too large" trace instead. It isn't a
universal constant you memorise once; it's re-tuned for every new problem. Modern training often
goes further and changes \alpha automatically during a single
run — see
learning
rate schedules.
Why settle for one fixed stride length for an entire training run, when you could have the best of
both worlds? Many real deep-learning training runs use a schedule that shrinks the
learning rate over time: big, confident steps early on, while you're still far from any minimum and
speed matters most, and tiny, careful steps near the end, when you're close to the bottom and a
clumsy stride could send you overshooting. It's the same trick a hiker uses without thinking —
striding quickly across the open hillside, then picking careful, tiny footsteps right at the
cliff edge. You'll meet the details in
learning
rate schedules.
Choosing a learning rate is such a common practical headache that people have automated the
headache itself: "learning rate finder" tools exist purely to run a few quick,
cheap trial steps across a sweep of candidate rates — 0.0001, 0.001, 0.01, 0.1, and so on — plot
how the cost responds to each, and hand you a sensible starting value before real training even
begins. It's the same "try a handful of values and watch the cost" trick from the card above, just
automated so a human doesn't have to babysit dozens of trial runs by eye.