Backpropagation
Backpropagation is the algorithm that computes the gradient of the loss function in a neural network via the chain rule. We clear up a common confusion—computing the gradient is not updating the weights, which is the optimizer's job—explain the forward and backward passes, and review its history.
Backpropagation is the algorithm that efficiently computes the gradient of the loss function with respect to all of a neural network's parameters, propagating the error from the output backward via the calculus chain rule. It is efficient because it reuses intermediate computations instead of repeating them layer by layer.
Computing the gradient is not updating the weights
A common confusion is worth undoing. Backpropagation only computes the gradient; it does not update the weights. What updates the weights is the optimizer, which uses that gradient: gradient descent and its variants, such as SGD, momentum or Adam. Put another way, backpropagation is how the gradient is obtained and the optimizer is what is done with it. Confusing the two is a common mistake.
How it works, step by step
Training alternates two passes. In the forward pass, the example is fed in and propagated through the network to the output, and the loss function measures the error; along the way the intermediate values are stored. In the backward pass, the error is propagated from the output by applying the chain rule layer by layer, obtaining the gradient of each weight. Backpropagation ends there; next, the optimizer adjusts the weights.
History
Its mathematical foundations include reverse-mode differentiation, which Seppo Linnainmaa developed in a 1970 thesis and published in 1976, and the general backpropagation formulation in Paul Werbos’s 1974 thesis. But it was the paper by Rumelhart, Hinton and Williams in Nature (1986) that popularized the algorithm and showed that it lets hidden layers learn useful representations. Today it is the basis of deep-learning training, and frameworks such as PyTorch or TensorFlow implement it through automatic differentiation.
Pieces using this term
- Physics Nobel honors Hopfield and Hinton for neural networks (2024-10-08)
- Andrej Karpathy leaves OpenAI to focus on personal projects (2024-02-13)
- How a Deep Network Learns: From Forward Pass to Gradient (2023-05-09)
- Neural Networks and AGI: What Each Advance Does and Does Not Show (2023-05-09)
- Recurrent networks for language sequence modeling (2023-05-09)
- An introduction to language models in artificial intelligence (2023-05-09)
- Neural networks and deep learning (2023-04-07)
This article was produced with artificial intelligence under human editorial oversight.