Chapter 3 · Part 2

The chain rule

A weight deep in the network doesn't touch the loss directly. It changes some intermediate value, which changes the next, which changes the next… until, several steps later, it nudges the loss. To find its slope, you follow that chain — and the chain rule says something wonderfully simple: multiply the local slopes along the way.

Scroll to send a ripple from one weight all the way to the loss.

The weight w affects z, which affects a, which affects the loss L: a chain.

scroll

Why multiplication?

Think in units. If nudging w moves z by 2×, and moving z moves a by 0.5×, and moving a moves L by 1.3×, then nudging w moves L by 2 × 0.5 × 1.3 = 1.3×. The sensitivities compound, exactly like gears meshing — turn the first and the last spins by the product of the ratios.

From one path to a whole network

In a real network a weight can reach the loss by many paths (its neuron feeds many others). The rule extends naturally: sum the contributions over all paths. Done naively, though, that's a combinatorial explosion — the same local slopes get recomputed over and over for millions of weights.

The genius of backpropagation is the bookkeeping: compute those local slopes once and reuse them, sweeping backward through the network so every weight gets its gradient in a single efficient pass. That sweep is the backward pass — next.