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:

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:

Roundw (before)slope w-1w (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
30.15−0.850.15 − 0.5(−0.85) = 0.575
40.575−0.4250.575 − 0.5(−0.425) = 0.7875
50.7875−0.21250.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:

Roundw (before)slopew (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:

Roundw (before)slopew (after)
1−2.4−3.4−2.4 − 2.5(−3.4) = 6.1
26.15.16.1 − 2.5(5.1) = −6.65
3−6.65−7.65−6.65 − 2.5(−7.65) = 12.475
412.47511.47512.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.

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):

RoundCost, \alpha=0.05Cost, \alpha=0.5Cost, \alpha=2.5
06.086.086.08
15.5161.74513.305
25.0080.66129.561
34.5490.39066.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.

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.