Neural networks and backpropagation: passing the blame backward
When your phone recognises your face, translates a sign, or a chatbot answers you
What problem does it solve?
How does a network of millions of tiny adjustable units learn which knob caused each mistake?
The big idea
Each artificial neuron does something simple: multiply its inputs by weights, add them up, and squash the result. Stack layers of these and the network can bend space into almost any shape it needs, like turning pixels into 'cat'. Learning means gradient descent, but you need the slope for every one of millions of weights. Backpropagation gets them all in one backward sweep using the chain rule: the blame for the error flows backward through the network, and each weight gets blame in proportion to how much it contributed. The whole backward sweep costs only about twice as much as running the network forward once.
How it works, step by step
- 1. Forward pass: feed in an example; each layer computes a = σ(W·x + b) and passes it on.
- 2. Compare the output with the right answer to get the loss.
- 3. Backward pass: starting at the output, compute how the loss changes with each layer's outputs, reusing the layer above's result (the chain rule).
- 4. From those, get the slope for every weight.
- 5. Nudge every weight downhill (gradient descent) and repeat over millions of examples.
The key formula
- the neuron's weighted sum of its inputs plus a bias b
- the 'squash' (activation), e.g. ReLU: max(0, z). Without it, stacked layers collapse into one
- how much the loss changes if you wiggle weight w: its share of the blame
- the chain rule: multiply the rates of change along the path from w to the loss
How fast is it?
One backward pass costs only about twice as much as a forward pass, no matter how many weights there are; that's why training billion-weight models is possible at all. Training still takes huge amounts of computing: big language models are trained on thousands of specialised chips for weeks or months.
Try it yourself
- Try the circle-inside-a-ring dataset with 1 hidden neuron, then 3. Why can't one neuron do it? (One neuron can only draw a straight line.)
- Chain rule by hand: if y = 3u and u = x², how fast does y change with x at x = 2? (dy/dx = 3·2x = 12.)
Fun fact
Backpropagation was made famous by Rumelhart, Hinton and Williams in 1986, building on earlier work, including Seppo Linnainmaa's 1970 method for automatically computing derivatives backward. Geoffrey Hinton shared the 2024 Nobel Prize in Physics with John Hopfield for foundational work on neural networks.