Backpropagation is the algorithm that computes the gradient of a neural network's loss with respect to every parameter by applying the chain rule backward through the computation graph. Paired with a gradient-based optimizer it is the training procedure of essentially every modern network, from the perceptron revival of the 1980s to the Transformers of today, because it produces every parameter's gradient in a single backward pass rather than one pass per parameter. Popularized by Rumelhart, Hinton, and Williams in 1986,1 the method had been developed by Paul Werbos in the early 1970s,2 with further antecedents in the adjoint methods of 1960s optimal control theory.3
Role in the network
A neural network is a directed acyclic graph of simple operations whose values can be computed forward node by node. Backpropagation runs the same graph backward: starting from the loss, it multiplies local derivatives along every path so that each parameter receives the total derivative of the loss with respect to it. The efficiency comes from sparsity, each node influencing only a few downstream nodes, and the whole pass costs a small constant multiple of the forward pass regardless of parameter count.3 The computed gradient feeds an optimizer such as Adam against a loss such as cross-entropy, scaling from a single layer to the billions of parameters trained in modern pretraining runs.
The mathematics
In a feed-forward network of \(L\) layers, layer \(l\) applies a linear map and an elementwise nonlinearity:
$$z_l = W_l\,a_{l-1} + b_l, \qquad a_l = \sigma(z_l)$$| Symbol | Shape | Meaning |
|---|---|---|
| \(a_{l-1}\) | \(n_{l-1}\) | activation vector entering layer \(l\); \(a_0 = x\) is the network input |
| \(W_l\) | \(n_l \times n_{l-1}\) | weight matrix of layer \(l\) |
| \(z_l\) | \(n_l\) | pre-activation of layer \(l\), \(z_l = W_l a_{l-1} + b_l\) with bias \(b_l\) |
| \(\sigma\) | applied elementwise | nonlinearity (sigmoid in 1986; ReLU and its successors later) |
| \(\delta_l\) | \(n_l\) | error signal \(\partial \mathcal{L} / \partial z_l\) for loss \(\mathcal{L}\) |
Starting from the output error \(\delta_L = \nabla_{a_L} \mathcal{L} \odot \sigma^{\prime}(z_L)\), one backward sweep computes every gradient in the network:
$$\delta_l = \left(W_{l+1}^{\top} \delta_{l+1}\right) \odot \sigma^{\prime}(z_l), \qquad \frac{\partial \mathcal{L}}{\partial W_l} = \delta_l\, a_{l-1}^{\top}, \qquad \frac{\partial \mathcal{L}}{\partial b_l} = \delta_l$$The recursion is the chain rule through the composition \(a_{l-1} \mapsto z_l \mapsto a_l \mapsto \cdots \mapsto \mathcal{L}\): errors flow back through the transposed weights, gated by the local derivative, and each weight's gradient is the outer product of the error it causes with the input it received. For a general computational graph with a scalar loss, the same idea gives each node's adjoint, its total derivative, by summing over the nodes it feeds,
$$\bar{v} = \sum_{c \,\in\, \mathrm{children}(v)} \bar{c}\,\frac{\partial c}{\partial v}$$and a reverse-topological sweep yields every gradient: reverse-mode automatic differentiation.
The forward pass through \(W_l\) costs one multiply-add pair per weight; the backward pass performs two same-sized operations per layer, the error propagation and the outer product above, so it costs roughly twice the forward pass. The total is independent of parameter count, where finite differences would need an extra forward pass per parameter; this makes the reverse sweep the only affordable option at scale.
Worked example: two-layer scalar network
Take \(f(x) = w_2\,\sigma(w_1 x)\) with \(\sigma = \mathrm{ReLU}\), input \(x = 2\), weights \(w_1 = 3\) and \(w_2 = 4\), target \(y = 10\), and squared loss \(\mathcal{L} = (f - y)^2\).
Forward pass: \(z_1 = w_1 x = 3 \times 2 = 6\); \(a_1 = \mathrm{ReLU}(6) = 6\); \(f = w_2 a_1 = 4 \times 6 = 24\); \(\mathcal{L} = (24 - 10)^2 = 196\).
Backward pass: \(\partial \mathcal{L} / \partial f = 2(f - y) = 2 \times 14 = 28\); \(\partial \mathcal{L} / \partial w_2 = 28 \times a_1 = 28 \times 6 = 168\); through \(w_2\) and the ReLU (derivative 1 at \(z_1 = 6 > 0\)), \(\delta_1 = 28 \times 4 \times 1 = 112\); and \(\partial \mathcal{L} / \partial w_1 = \delta_1 x = 112 \times 2 = 224\).
Finite differences confirm both: \(w_1 + 0.001\) gives \(f = 24.008\), \(\mathcal{L} = 14.008^2 = 196.224064\), slope \((196.224064 - 196)\,/\,0.001 = 224.064\), matching \(224\) up to the quadratic remainder \(0.008^2 / 0.001 = 0.064\); \(w_2 + 0.001\) gives \(f = 24.006\), slope \(168.036\) against the exact \(168\).
Intuition
Backpropagation answers the credit-assignment question: of all a network's weights, which caused this error, and which way should each move? The signal \(\delta_l\) measures how strongly the loss responds to a nudge of \(z_l\); the weight gradient multiplies that blame by the input that produced it, so a weight moves in proportion to the product of what it saw and the error it caused. Backward accumulation is the right order because the loss is one scalar with millions of causes: a reverse sweep collects every parameter's derivative, a forward sweep one directional derivative at a time.
A useful older framing assigns every node a logical time and reads the forward computation as a dynamical system: the gradient of the final cost with respect to the state obeys its own equation running backward in logical time, the costate equation of optimal control, so the backward pass that trains a network and the adjoint pass that optimizes a trajectory are the same computation; Pontryagin's maximum principle, which shaped Cold War-era control engineering, rests on exactly this structure.12
Variants and extensions
Backpropagation through time, the same algorithm on a recurrent network unrolled into a deep feed-forward graph, trained the LSTM networks that dominated sequence modeling for two decades.20 Automatic differentiation frameworks have generalized the reverse mode Werbos and Linnainmaa described, making the backward pass a compiler feature rather than a hand derivation; Karpathy's tiny scalar-valued engine micrograd and his essay "Yes You Should Understand Backprop" present the derivation as essential pedagogy.2122 Higher derivatives can be computed in the same backward pass but are rarely used in training.
Adoption
Backpropagation at cluster scale underlies the pretraining of every frontier language model, its gradient flowing through every feed-forward and attention layer. Before the Transformer era, the seq2seq translation systems of 2014 learned end to end by the same method.
Limitations and critiques
The standing objections of the 1980s, slow convergence and local-minimum entrapment, returned in the case against neural networks in the second winter, and the algorithm's biological implausibility has been debated just as long. What settled the practical argument was scale: with enough data and compute, gradient descent on very large networks was found to avoid the worst of the local-optimum problem, an empirical reversal the scaling-law literature later quantified. The other standing cost is memory: the recursion consumes the stored \(a_{l-1}\) and \(z_l\) of every layer, so activation memory grows with depth and batch size, and large runs routinely recompute activations during the backward pass rather than storing them.
History
The chain rule itself is as old as calculus, and backward accumulation was standard equipment in 1950s and 1960s optimal control theory, where the adjoint, or costate, equations of a dynamical system are integrated backward in time to obtain gradients of a trajectory's cost, the mathematics behind Pontryagin's maximum principle.3 Seppo Linnainmaa described the reverse mode of accumulating derivatives in his 1970 Finnish master's thesis and a 1976 English paper on rounding-error analysis, now recognized as the first publication of the general algorithm, though it had no influence on neural network research.45
The first neural network community spent two decades unable to train networks with more than one adaptive layer. The field's founding model, the 1943 McCulloch-Pitts neuron, was a binary threshold device,6 and Rosenblatt's perceptron of the late 1950s inherited the step function: its rule provably converged for one layer, but for two-layer machines Rosenblatt offered only heuristic rules for passing error signals to hidden units, which he called the back-propagating error-correction procedure, and even his layer-wise learning rates, the first layer trained more slowly for stability, could not rescue them, though the machines were otherwise forward-looking, with bypass connections and multimodal variants documented in the 1962 book.713 Widrow and Hoff's ADALINE (1960) trained a single unit by gradient descent on squared error, the delta rule, yet their multi-unit MADALINE fell back on heuristics rather than differentiable activations;8 the hardware was equally improvised, trained by electrochemical memistors with patterns entered by hand, and Widrow turned the single-layer machine into a successful adaptive-filtering tool, returning to neural network research when backpropagation appeared.14 The field-wide assumption that real neurons are 0-1 spike generators, reinforced by the Minsky-Papert critique's skepticism of gradient methods, kept smooth activations out of the toolbox; Widrow later recalled that backpropagation seemed "almost miraculous" when it arrived.3
Paul Werbos derived the algorithm in 1971-1972 as a byproduct of a model of intelligence he described as translating Freud's psychodynamics into derivative equations; it reached print mainly in his 1974 dissertation on statistical forecasting.2 An early Harvard committee was skeptical the method would work, a later one called the simplified version "too trivial" for a thesis, and patrons declined instructively, Stephen Grossberg assuring him the work was either already done or wrong, Marvin Minsky on the ground that neurons were known to be 0-1 spike generators.15 Karl Deutsch finally sponsored the forecasting application, and the first working backpropagation code shipped as a command in MIT's TSP econometrics package.15 Laveen Kanal's recollection of shelving the dissertation unread, 'I was not alone in neglecting his work,' stands for the decade's reception:16 promotion met indifference through the 1970s, a 1978 forecasting paper mentioned the method without its appendix,3 and wider circulation came only in the early 1980s, when conference chapters and a 1988 recurrent-network treatment reached the reviving connectionist community.9
David Rumelhart's Parallel Distributed Processing reading group rediscovered the method in 1982 by generalizing the delta rule to sigmoid activations;3 begun in 1979 as his self-described five-year plan to understand the connectionist literature, the project proceeded reluctantly, Rumelhart solving the past-tense learning problem with hand-designed features before conceding to the method.17 Geoffrey Hinton initially objected on symmetry and local-minimum grounds and spent a year on Boltzmann machines,10 before a weekend's reimplementation converted him, his 8-3-8 encoder learning the expected binary codes with zero error after his students had refused to touch the method.17 Terence Sejnowski found backpropagation an order of magnitude faster than Boltzmann learning and used it to train NETtalk, an 18,629-parameter network whose size drew predictions of hopeless overfitting from the statistics of the time, predictions its generalization failed to confirm, and which appeared on prime-time television.1118 The 1986 Nature paper made the algorithm canonical,1 and Rumelhart later waved off the priority question, listing Linnainmaa, Werbos, and himself as independent discoverers; the method has not needed rediscovery since.3
Participants' retrospectives converge on a short list of explanations for the twenty-year gap: the spiking-neuron dogma made smooth activations seem unphysical; learning was framed as the synthesis of boolean rather than smooth functions; gradient descent was distrusted as certain to jam in local minima; and the community's distance from cybernetics left the adjoint literature unread.17 Each rediscovery, Linnainmaa's, Werbos's, and the PDP group's, happened only because the previous one had been effectively forgotten, and the 1986 paper ended the cycle by being impossible to miss.19
See also
References
-
Rumelhart, D. E., Hinton, G. E., and Williams, R. J., "Learning Representations by Back-Propagating Errors," Nature 323, October 1986. ↩↩
-
Werbos, P. J., "Beyond Regression: New Tools for Prediction and Analysis in the Behavioral Sciences," PhD thesis, Harvard University, 1974. ↩↩
-
Rosenfeld, E., and Anderson, J. A., eds., "Talking Nets: An Oral History of Neural Networks," MIT Press, 2000. ↩↩↩↩↩↩↩
-
Linnainmaa, S., "Taylor Expansion of the Accumulated Rounding Error," BIT 16(2), 1976. ↩
-
Griewank, A., "Who Invented the Reverse Mode of Differentiation," Documenta Mathematica, Extra Volume ISMP, 2012. ↩
-
McCulloch, W. S., and Pitts, W., "A Logical Calculus of the Ideas Immanent in Nervous Activity," Bulletin of Mathematical Biophysics 5(4), 1943. ↩
-
Rosenblatt, F., "Principles of Neurodynamics: Perceptrons and the Theory of Brain Mechanisms," Spartan Books, 1962. ↩
-
Widrow, B., and Hoff, M. E., "Adaptive Switching Circuits," IRE WESCON Convention Record, 1960. ↩
-
Werbos, P. J., "Generalization of Backpropagation with Application to a Recurrent Gas Market Model," Neural Networks 1(4), 1988. ↩
-
Ackley, D. H., Hinton, G. E., and Sejnowski, T. J., "A Learning Algorithm for Boltzmann Machines," Cognitive Science 9(1), 1985. ↩
-
Sejnowski, T. J., "The Deep Learning Revolution," MIT Press, 2018. ↩
-
Bryson, A. E., and Ho, Y.-C., "Applied Optimal Control: Optimization, Estimation and Control," Ginn and Company, 1969. ↩
-
Rosenblatt, F., "Principles of Neurodynamics," Spartan Books, 1962, chapter 13. ↩
-
Widrow, B., "Ancient History," in Cybernetics 2.0: A General Theory of Adaptivity and Homeostasis, Springer, 2023. ↩
-
Rosenfeld, E., and Anderson, J. A., eds., "Talking Nets: An Oral History of Neural Networks," MIT Press, 2000. ↩↩
-
Kanal, L. N., "On Pattern, Categories, and Alternate Realities," Pattern Recognition Letters 14(3), 1993. ↩
-
Rosenfeld, E., and Anderson, J. A., eds., "Talking Nets: An Oral History of Neural Networks," MIT Press, 2000. ↩↩↩
-
Sejnowski, T. J., "The Deep Learning Revolution," MIT Press, 2018. ↩
-
Griewank, A., "Who Invented the Reverse Mode of Differentiation," Documenta Mathematica, Extra Volume ISMP, 2012. ↩
-
Hochreiter, S., and Schmidhuber, J., "Long Short-Term Memory," Neural Computation 9(8), 1997. ↩
-
Karpathy, A., "Yes You Should Understand Backprop", Medium, December 2016. ↩
-
Karpathy, A., "micrograd: a tiny scalar-valued autograd engine", April 2020. ↩