Foundations — Gradient descent intuition and update rule
Before you can read the parent note Gradient Descent, you need to own every piece of notation it throws at you. This page builds each one from nothing, in an order where each idea leans on the one before it. Nothing here is assumed.
1. The parameter — the "settings knob"
Picture a radio with dials. Each dial is one number you can turn. Turning the dials changes the sound. In machine learning, is all the dials at once.
- If there is one dial, is a single number, e.g. .
- If there are many dials, is a list, e.g. for a line .
Why the topic needs it: gradient descent's whole job is deciding how to turn these dials. Without a name for "the thing we adjust," there is nothing to adjust.

Read the figure: the horizontal axis is the single dial ; the blue curve is a valley. Look at the yellow dot at and the red dot at — those are two different dial settings, each sitting at a different height. The green star at the very bottom is (theta-star). The little star always means "the best one" — the dial setting that makes us least wrong.
2. The loss — the "wrongness meter"
The notation reads "L of theta" — it means "feed the dial settings into the wrongness meter , and out comes a number." This is function notation: the letter outside the brackets is a machine, the thing inside the brackets is what you feed it.
Read the figure below: every horizontal position is a choice of dials . The height of the blue ground at that spot is the loss . Turning the dials = walking left or right; the height = how wrong you are.
- The red dot on the left sits high up → large → very wrong.
- The green star sits in the dip → small → nearly right.
- The lowest valley point → → the best settings.
Why the topic needs it: "learning" is the act of finding the valley of . See Loss Functions for how these meters are actually built.

3. Slope — how steep the ground is
Imagine standing on a ramp. Walk 1 metre forward (run), and you rise 2 metres (rise). The slope is . Walk forward and drop 2 metres → slope . Perfectly flat → slope .
Read the figure: it shows a run-of-1 triangle drawn on three spots of the same hill. On the left (yellow) the ground climbs — the triangle rises, slope . In the middle (green) the ground is flat — no rise, slope . On the right (red) the ground falls — the triangle drops, slope . Same picture, three signs.

The sign of the slope is the crucial part:
- slope : ground goes up as you move right → to go down, move left.
- slope : ground goes down as you move right → to go down, move right.
- slope : you're on flat ground — possibly a valley bottom.
Why the topic needs it: the entire strategy is "walk in the downhill direction." Slope is what tells you which way is downhill without seeing the whole mountain.
4. The derivative — slope, made exact
Why a new tool and not just slope? A ramp has one slope everywhere. But the loss landscape is curved — its steepness changes at every point. Ordinary "rise over run" needs two points. The derivative is the trick that gives you the slope using an infinitely small run, so it works at a single point on a curve.
Why does ? Let's build it, not assert it. Take two points a tiny gap apart, and , and compute rise-over-run between them: Now shrink the gap: as gets infinitely small (), the leftover vanishes and we are left with exactly . That shrinking is the whole idea of a derivative — the slope you'd feel with a step so small it's a single point. The figure shows the two points closing up onto one tangent line.

Read the figure: the red dot sits at ; the yellow line is the tangent whose slope is — steep and climbing, so to go down you step left. The green star at shows a flat tangent: slope , the valley bottom.
5. Partial derivative — slope in one direction
Picture standing on a real 2-D hillside. Face east and ask "how steep is it if I walk east only?" — that's one partial. Face north and ask again — that's another partial. Each partial isolates one direction.
Why the topic needs it: real models have thousands of dials. You cannot describe the downhill direction with a single slope; you need one slope per dial. That is precisely what the parent note computes in Example 2 with and .
6. The directional derivative — steepness in any chosen direction
On a 2-D hill you can face infinitely many compass directions, not just east and north. Each direction has its own steepness. A beautiful fact ties them all together: the directional derivative in direction equals the dot product (defined next section) of the gradient with : where is the angle between and the gradient. Because is largest () when , the steepness is maximised when you walk exactly along . That is the reason — not a magic assertion — that the gradient points straight uphill. We'll unpack the dot product properly in section 8; keep this promise in mind.
7. The gradient — the full downhill compass
This arrow is not just a bookkeeping list — from the directional-derivative fact above, it points somewhere:
Read the figure: the blue rings are contour lines (like a map's height lines) of a bowl-shaped loss. From the white "you are here" dot, the red arrow points outward, away from the centre — that's uphill. The green arrow points inward toward the yellow star at the bottom — that's the direction gradient descent actually steps.

"Walk in the direction" is gradient descent in one sentence. Backpropagation is simply a fast recipe for computing inside neural networks.
8. The dot product — measuring "same direction?"
The notation (a superscript means "transpose" — for our purposes just a way of writing a dot product) asks: does my step point the same way as uphill?
Read the figure: all three green step arrows have the same length; only the angle to the red gradient changes. The value written under each is the dot product with a gradient of length and step of length .

A concrete number: take and a step of length .
- If step points uphill (, ): dot . Loss rises most. Bad.
- If step points sideways (, ): dot . Loss unchanged.
- If step points downhill (, ): dot . Loss drops most. Best!
Why the topic needs it: this is the proof that "opposite to the gradient" is optimal. The most-negative dot product happens exactly when your step is antiparallel to — which is why the update rule has a minus sign.
9. The step , learning rate , and iteration
Putting all the symbols together gives the parent note's headline formula, and now every piece is earned:
Prerequisite map
Equipment checklist
Test yourself — cover the right side and answer aloud.