Visual walkthrough — Gradient descent intuition and update rule
This page rebuilds the single most important line in the parent note from nothing. No slopes, no dot products, no gradients assumed. Every symbol earns its place before it appears, and every step comes with a picture that carries the idea.
Because we are building from zero, we first fix three tiny pieces of shorthand that will appear throughout, so nothing is ever a surprise:
The sign function is worth seeing, since we lean on it in Step 3. Its picture is a flat staircase with a single jump: stuck at for all negative inputs, a lone dot at when the input is exactly zero, and stuck at for all positive inputs. Notice it is completely blind to size — an input of and an input of both come out .

With those in hand, here is the line we are going to earn, piece by piece:
Every symbol here — , the slope , the learning rate — is defined in the steps below before we lean on it. When has many knobs at once, that single slope becomes an object called the gradient, written ; we introduce it properly at the end of Step 5. Until then we stay with one knob and never write .
See the parent topic for the big-picture analogy; here we do the pictures.
Step 1 — What is a "loss", and what does its picture look like?
WHAT. Picture one single knob you can slide left or right. For every position of the knob, there is one "wrongness" number. Plot knob-position along the flat bottom, wrongness going up. You get a curve — a landscape.
WHY a curve and not a formula-blob? Because a picture lets us see the goal: the lowest point of the curve is the knob-setting that makes us least wrong. That lowest point has a name.
PICTURE. The bowl-shaped curve below. The horizontal axis is (the knob). The vertical axis is (wrongness). The pink dot at the bottom is , the answer we are hunting.

The catch: in real problems we cannot see the whole curve. We only ever stand at one spot and get to feel the ground right under our feet. So the rest of this page is: how do you find the bottom of a valley you cannot see, feeling only your immediate surroundings?
Step 2 — "Feeling the ground": the slope
WHAT. At a point , draw the straight line that just grazes the curve there — the line that matches the curve's tilt exactly at that spot. That grazing line is the tangent line. Its steepness is the slope at .
WHY a tangent line and not the curve itself? Because a curve is complicated, but a straight line is simple: a straight line has exactly one steepness number. Right where we stand, the curve and its tangent line agree, so the line's steepness is a faithful local report of the ground.
The tool that gives us this number is the derivative.
PICTURE. Two spots on the same bowl. On the right wall the tangent line climbs → positive slope. On the left wall the tangent line falls → negative slope. At the bottom the tangent is flat → zero slope.

Read the signs off the picture and a plan appears: walk in the direction that makes wrongness go down. Which direction is that? That is exactly Step 3.
Step 3 — The sign of the slope tells you which way to step
WHAT. We want to move the knob so decreases. Recall from the opening: it reports only which way a number leans (, , or ). Apply it to the slope and reason out both walls of the bowl.
Case A — we are on the right wall (slope positive, ). Positive slope means "right = uphill", so downhill is to the left. To decrease , move left (make it smaller).
Case B — we are on the left wall (slope negative, ). Negative slope means "right = downhill", so downhill is to the right. To decrease , move right (make it larger).
WHY the magic that follows works. Notice the beautiful pattern:
- slope positive → step in the negative direction (left),
- slope negative → step in the positive direction (right).
In both cases, the step direction is the opposite sign of the slope. That single sentence is the seed of the whole update rule.
PICTURE. The same bowl with a blue arrow on each wall. On the right wall (slope ) the arrow points left. On the left wall (slope ) the arrow points right. Both arrows point toward the bottom.

Step 4 — Fold direction AND distance into one number:
WHAT. We now know which way to step. But we also want steeper ground to give a bigger step (we're far from the bottom, hurry up) and gentle ground to give a small step (we're close, tiptoe). The slope's size already measures steepness! So use the slope itself for both jobs — its sign gives direction (Step 3), its size gives step length.
Multiply the slope by (to flip toward downhill) and by a small positive number (to keep the step sensible in size):
Term by term, right where each symbol sits:
- — the change in the knob ("", delta, means "change in"). How far and which way we slide.
- — the "go opposite the slope" flip from Step 3. Downhill, always.
- — the learning rate (Greek "eta"), a small positive number like . A dial for how bold each step is.
- — the slope: carries direction (its sign) and steepness (its size) for free.
WHY multiply, rather than just take a fixed step left/right? Because a fixed step wastes information. The slope is a rich signal — steep places scream "big step" and flat places whisper "we're nearly there". Using directly makes the algorithm slow down automatically as it nears the bottom.
PICTURE. Two points on the bowl. A steep point produces a long blue step arrow; a gently-sloped point near the bottom produces a short arrow. Same formula, self-scaling steps.

Step 5 — Assemble the update rule and take repeated steps
WHAT. "New knob position = old position + the change we computed." Using the step counter from the opening (so is now, is next), substitute :
Term by term:
- — where we stand now (the knob at step ; start at ).
- — where we stand after this step.
- — the downhill nudge from Step 4, with the slope measured at our current spot (that's what the means: "evaluated here").
WHY repeat? One step only uses the local tangent, which is honest only nearby. After moving, we're somewhere new with a new slope, so we re-feel the ground and step again. Repeat until the slope is (near) zero — flat ground, the valley floor.
PICTURE. A staircase of dots walking down the right wall of the bowl: , each step shorter than the last as the ground flattens, converging on .

Let's trace it with numbers. Take the parent's Example 1: . To get its slope we need one small differentiation rule, stated plainly so we don't smuggle it in:
So the slope is . Start , :
Each new position is times the old one: , sliding smoothly toward . The steps shrink on their own — exactly what Step 4 promised.
Step 6 — The edge case: what if is too big?
WHAT. The formula is honest only inside the little zone where the tangent line still resembles the curve. If makes the step jump out of that zone, we can leap clean over the valley and land higher on the far wall.
We first need one new tool — the "slope of the slope". The derivative of tells us the curve's steepness. If we ask "how fast is that steepness itself changing as we move?", we take the derivative again. That is the second derivative.
WHY it breaks — worked out for the bowl. Take , whose slope is . The update becomes
So each step multiplies the knob by the fixed number . Read term by term: the "" that appears is exactly the second derivative we just computed — the fixed rate at which the slope steepens.
The knob shrinks toward only if that multiplier is closer to zero than in size, i.e. . Solving: . So the safe-step rule for this bowl is — the "" on top is the fixed multiplier factor, the "" on the bottom is the second derivative.
Now watch it fail with , starting :
The knob bounces , each bounce bigger — it diverges. The direction was right (downhill) but the distance overshot.
With the multiplier is (size ) → converge, matching Step 5. With it is (size ) → blow up.
PICTURE. Same bowl, two walkers: a chalk-blue one with small spiralling gently into the base, a chalk-pink one with big zig-zagging outward up the walls.

Step 7 — The degenerate case: flat ground ()
WHAT. When the slope is exactly , the update does nothing:
We stop. Good — if we're at the valley floor, staying put is correct. A point where the slope is zero is called a critical point.
WHY watch out. A zero slope means "flat", but flat happens at three kinds of critical point: the bottom of a valley (a minimum, great), the top of a hill (a maximum — we don't want to stop there), and a plateau / saddle where the ground is flat but the true minimum is elsewhere. Gradient descent freezes at any of them because it only feels the local slope; it cannot tell which kind it is from the slope alone.
How to tell them apart — the second-derivative test. We already met the second derivative in Step 6: it measures curvature. At a critical point (where ) it gives us a test:
How to detect a stall in practice. You cannot see the whole curve, so you watch the numbers: if the loss stops decreasing while its slope is (near) zero, you have parked at a critical point. Then check the curvature sign as above — positive means you succeeded (a minimum); non-positive means you may be stuck at a maximum, plateau, or saddle point and should escape. The standard escapes are: add a nudge of momentum so you coast through flat spots (Momentum and Adam), inject randomness so you don't sit exactly on the flat (Stochastic Gradient Descent), or use curvature information directly (Second-Order Methods). In a simple convex bowl none of this is needed — the only critical point is the true minimum.
PICTURE. Three flat-tangent critical points on a wavy curve, each labelled with its curvature sign: a real minimum (pink, , good stop), a saddle/plateau (yellow, , false stop), and a maximum (blue, ). All share slope ; only the pink one is where we want to land.

The one-picture summary
Everything at once: the bowl ; at the current spot the tangent line gives the slope (Step 2); the slope's sign picks the downhill direction (Step 3); the slope's size times sets the step length (Step 4); repeating draws the shrinking staircase to (Step 5); too-big would fling you outward (Step 6); flat ground halts you, and the curvature sign tells minimum from maximum from plateau (Step 7).

Recall Feynman retelling — the whole walkthrough in plain words
You're standing somewhere on a curved bowl and you want the bottom, but you can only feel the ground right under your feet. So you feel the tilt — that's the slope. If it tilts up to your right, downhill is left; if it tilts up to your left, downhill is right. Either way, you step against the tilt — that's the minus sign. You make your step big when the ground is steep (you're far away, so hurry) and small when it's gentle (you're close, so tiptoe) — and the slope's own size gives you that for free. You multiply by a little caution dial called the learning rate so you don't leap too far. Then you feel the ground again from your new spot and repeat, taking smaller and smaller steps, until the ground goes flat and you stop. To be sure the flat spot is really the valley floor and not a hilltop or a plateau, you check the curve of the curve — the second derivative: cup-shaped (positive) means a true minimum, cap-shaped (negative) means a hilltop, and dead-flat (zero) means "look harder, could be a plateau or saddle". The only ways it goes wrong: crank the caution dial too high and you catapult past the valley and bounce out, or the ground goes flat somewhere that isn't the true bottom and you freeze there by mistake.
Recall
Why do we step in the direction opposite to the slope? ::: Positive slope means "right is uphill", so downhill is left; negative slope means the reverse. In both cases downhill is the opposite sign of the slope — the minus sign in the rule. What single quantity gives us both the step's direction and its size? ::: The slope (derivative) : its sign is direction, its magnitude is steepness/size. What does the learning rate control, and why must it be positive? ::: How bold each step is. It must be positive; a negative would cancel the minus sign and send us uphill. What happens to the update when the slope is exactly zero? ::: — no move; we've hit a critical point (flat ground) and halt. At a critical point, how do you tell a minimum from a maximum? ::: The second-derivative test: → minimum (cup up); → maximum (cap down); → inconclusive (plateau/saddle). For with , what is ? ::: .