02 · 1986 · How a network actually learns

Backpropagation & gradient descent

Learning is just rolling downhill. Imagine a landscape where every position is a choice of weights and the height is the loss, how wrong the network is. The steepest-downhill direction is called the gradient, and each training step moves a small distance along it.

The hard part is finding that direction for millions of weights. Backpropagation does it with the chain rule: start at the error and pass “blame” backwards through the network, one operation at a time. Here the network is tiny enough to see every number.

How it works

  1. The network: one input x, one weight w₁, a tanh bend, a second weight w₂, then the output y. One training example: when x = 1.2 the answer should be 0.7.
  2. Forward pass: compute left to right: a = w₁x, h = tanh(a), y = w₂h, loss = ½(y − 0.7)².
  3. Backward pass: work out ∂loss/∂y, then pass it back: ∂loss/∂w₂, then ∂loss/∂h, ∂loss/∂a and finally ∂loss/∂w₁. Each is the previous one times a local slope.
  4. Step: w ← w − learning rate × gradient. Do it again. The ball on the map rolls to the valley floor.

Try it

runs in your browser
click the map to drop the ball

Start

Loss
—
Steps
0
∂L/∂w₁
—
∂L/∂w₂
—

Learning curve (loss at each step: watch it fall as the ball rolls down)

Things to try

Why it was a breakthrough

Backpropagation was derived in various forms from the 1960s. The 1986 paper by Rumelhart, Hinton and Williams showed it could train hidden layers to learn useful internal representations, and the field revived.

Vanishing and exploding gradients

Multiply many small slopes together and the signal fades to zero by the time it reaches early layers. Multiply large ones and it explodes. Much of deep learning’s progress (ReLU, LSTM gates, residual connections, normalisation) is about keeping the gradient healthy.

Modern training

Real networks use the same loop: forward, backward, step. They just do it on millions of examples at a time with billions of weights, using optimisers like Adam that adapt the step size per weight.