Backpropagation
The algorithm that computes how much each weight in a neural network contributed to the error, by applying the chain rule backward from the output.
Also backprop · backward pass · reverse-mode automatic differentiation
Rumelhart, Hinton and Williams, 1986 (earlier work by Linnainmaa, 1970, and Werbos, 1974)
A team project got a bad grade. Working backward from the final report, you figure out how much each person's part contributed to the problems, so everyone knows exactly what to fix.
Where it fits
Not shown: 8 more that build on it. See the full list below.
+All relationships as a list
Is a kind of / part of
Siblings
Uses / built on
Applies to
Used by
Try it
How it works
Gradient descent needs the gradient: for every weight, “if I nudge this up a little, how much does the loss change?” A network can have billions of weights, so computing each one separately would be hopeless. Backpropagation computes them all in one sweep.
Training a network runs in two passes:
- Forward pass. Data flows from input to output, layer by layer. Every intermediate value is remembered. At the end, the loss is computed.
- Backward pass. Starting from the loss, go back through the network. At each step, the chain rule says: the effect of a value on the loss equals its effect on the next value, times that next value’s effect on the loss. Since the second part was just computed, each step is cheap.
When the backward pass reaches the input, every weight has its gradient. Gradient descent then updates them all, and the cycle repeats.
In modern frameworks you never write this by hand: the framework records the forward pass as a computational graph and runs backpropagation automatically when you call loss.backward().
The math
For a chain , the chain rule gives
Backprop evaluates this product from the left: first, then multiplies by each local derivative while walking backward, reusing every partial product.
Everyday use cases
- Case 01
Training every modern neural network
Image classifiers, speech models and large language models all learn via backpropagation plus gradient descent.
Strengths, weaknesses and when to use it
Strengths
- Computes all gradients in roughly the cost of one extra forward pass.
- Fully automatic in frameworks like PyTorch and JAX.
Weaknesses
- Gradients can shrink to nothing or blow up through many layers (vanishing and exploding gradients).
- Requires storing intermediate activations, which costs memory.
When to use itWhenever you train a differentiable model with many parameters, which in practice means always for neural networks.
Check yourself
- Q01
Which rule from calculus is at the heart of backpropagation?
Show answer
B: The chain rule
- Q02
What does backpropagation compute?
Show answer
B: The gradient of the loss with respect to every weight
- Q03
How does backpropagation relate to gradient descent?
Show answer
B: Backprop computes the gradients; gradient descent uses them to update the weights