1.2.13 · D2Calculus & Optimization Basics

Visual walkthrough — Learning rate effects on convergence

2,062 words9 min readBack to topic

Step 1 — What is a "loss landscape"?

WHAT. Imagine you have one knob to tune — call it (a single number, our parameter). For every setting of that knob, your model is a bit right or a bit wrong. We measure "how wrong" with a number called the loss, written . Plot the knob on the flat ground and the loss as height, and you get a valley.

WHY. Training means finding the bottom of the valley — the knob setting where you are least wrong. Everything else on this page is about how to walk downhill without falling over.

PICTURE. The curve below is , the simplest possible valley. The lowest point sits at ; that is the target we call ("w-star", the best setting).

Figure — Learning rate effects on convergence

Step 2 — The slope tells us which way is downhill

WHAT. At any point on the curve, ask: if I nudge a tiny bit to the right, does the height go up or down, and how steeply? That steepness is the slope, and for a curve we compute it with the derivative, written (read "grad L"). For the slope is .

WHY a derivative and not something else? We need a local answer — which way is down right here, without seeing the whole valley. The derivative is exactly the tool that reports the local tilt of a curve. No other tool gives "steepness at a point."

PICTURE. On the right wall () the slope is positive — the curve rises as you go right, so the arrow of steepest increase points right. On the left wall () the slope is negative — increase points left. Downhill is always the opposite of the slope arrow.

Figure — Learning rate effects on convergence

Step 3 — Predict the loss ahead with a straight-line guess

WHAT. First, one new symbol. When we move the knob from to a nearby setting, we write the change in as (read "delta w") — the capital Greek letter just means "the amount by which something changed." So is literally how far we step, and the new knob-setting is .

Standing at , before we actually move, we guess what the loss will be after a step of size . The cheapest honest guess is the first-order Taylor approximation: pretend the curve is a straight line with the slope we just measured.

WHY this tool? We want to choose our step intelligently, which means predicting its effect before committing. Taylor's straight-line rule is the simplest predictor that uses the slope. It is only trustworthy for small , and remembering that limitation is the whole story of the learning rate.

PICTURE. The horizontal gap is marked on the axis. The dashed line is the straight-line prediction; it hugs the true curve near and drifts away as grows. That drift is the danger zone.

Figure — Learning rate effects on convergence

Step 4 — Choosing the step: enter the learning rate

WHAT. Look again at the prediction from Step 3, reading it as a function of our choice :

We want this predicted loss to drop as much as possible, so we want the term to be as negative as possible.

First, a trap to notice. Read that term greedily: if is a free number with no limit, we could just take enormous in the downhill direction and the straight-line prediction would promise a loss of . That is nonsense — the prediction is only a local straight-line guess (Step 3), trustworthy for small steps and wildly wrong far away. So the linear formula alone has no minimum; the greedy answer runs off to infinity.

The fix: cap the step length. The honest thing is to admit "I only trust this guess within a small radius," i.e. impose a size limit some allowed budget on how far we move. Now the problem is well-posed: among all steps no longer than the budget, which one drops the linear prediction most? Two numbers multiplied are most negative when they point exactly opposite, so the best direction is straight against the gradient, and we should spend the whole budget (go to the boundary). Pointing any other way wastes part of the step sideways.

That forces the update to be a fixed negative multiple of the gradient; call that positive multiplier (read "eta"), the learning rate — it is exactly the budget size we allowed ourselves:

Plug into the update and you get the rule from the parent note:

WHY split direction and distance? The minus sign is derived, not guessed: it is the only direction that makes the linear prediction go down fastest. The distance is not derivable from the linear guess at all — greedily it wants infinity — so we must impose it as the trust budget . Direction comes from calculus; distance is our cap.

PICTURE. Same valley, same starting point, three different : a timid step, a good step, and a reckless step. Watch where each lands.

Figure — Learning rate effects on convergence

Step 5 — Why "too big" isn't just slow, it's fatal

WHAT. Track what actually happens for (so ). The update becomes

Every step multiplies your position by the same number .

WHY this matters. Repeating multiplication by gives . The fate of training is decided entirely by the size of :

| | | | behaviour | |---|---|---|---| | | | | shrinks, same side — slow, steady | | | | | one jump to zero (best case) | | | | | flips side each step, still shrinks | | | | boundary | flips forever, never settles | | | | | flips and grows — explodes |

PICTURE. The three trajectories: spirals inward to , orbits forever, marches outward. This is the whole "small / good / large" story in one geometric fact.

Figure — Learning rate effects on convergence

Step 6 — The degenerate and edge cases

WHAT & PICTURE. We must cover every scenario so no reader is ambushed:

  • Flat spot, . At the exact bottom the slope is zero, so : you stay put no matter what is. Good — you have arrived. (Same thing traps you on a saddle or plateau; that is why Momentum exists.)
  • The knife-edge (here ): , one perfect leap to the minimum. This is Gradient Descent accidentally becoming Newton's method — only possible because a parabola has constant curvature.
  • The oscillation boundary (here ): , you ping-pong between and forever. Loss never decreases, never explodes — pure limbo.
  • Beyond, : , each step lands farther out. Parameters ; you see NaN.
Figure — Learning rate effects on convergence

The one-picture summary

Everything collapses to one line: the multiplier . Its distance from zero is your convergence speed; the moment touches you stop converging; past you diverge.

Figure — Learning rate effects on convergence
Recall Feynman retelling — say it like you'd explain to a friend

You're standing on the side of a valley whose height is your "wrongness." You can feel the slope under your feet — that's the derivative — and it tells you which way is downhill. But the slope doesn't tell you how far the bottom is, so you pick a step size yourself. Take a step of size times the slope, downhill.

Here's the catch. For a simple bowl, every step just multiplies your distance-from-bottom by a fixed number , where is how sharply the bowl curves. If that number is between and , each step shrinks the distance and you glide in. If is small, is near and you crawl. Right in the sweet spot, is near and you drop almost instantly. But if is too big, becomes bigger than in size — now every step grows the distance, you leap past the bottom onto the far wall, higher up, then even higher, and blow up to infinity. The whole learning-rate story is just: keep under .

Recall Quick self-check

For with , what is ? ::: . What is the shrink factor for ? ::: . Above what does diverge? ::: .

Related tools that fix the pain shown here: Learning Rate Schedules (shrink over time), Adam Optimizer (per-parameter ), Condition Number and the Hessian Matrix (where comes from in many dimensions), Lipschitz Continuity (the precise meaning of "curvature bound "), and Backpropagation (how is computed in the first place).