Backpropagation, the F=ma of AI

3 min read

In the early 1970s a Harvard graduate student named Paul Werbos found a way to train neural networks with more than one layer. He would later compare his method, backpropagation, to Newton's laws: a simple, fundamental rule that scales up to rich behavior. When he took it to Marvin Minsky, Minsky rejected it outright, saying it could never learn anything difficult. Minsky was wrong. Backpropagation went on to train models that drove cars in the 1980s, read handwritten digits in the 1990s, and classified images in the early 2010s. Today virtually every modern AI model is trained with it.

To see how it works, the video shrinks the problem down. Instead of Llama predicting the next token, imagine a tiny model that guesses which city you are in from your GPS longitude. Three neurons, one per city: Paris, Madrid, Berlin. Each neuron multiplies the input by a weight, adds a bias, and outputs the result, just y equals mx plus b from school. The three outputs then go through a softmax, which turns them into probabilities that add up to one. Softmax is the most complicated math in the video, and it has a nice property: it amplifies differences. Outputs of 1, 2, 1 give Paris a 58 percent probability. Outputs of 1, 10, 1 give Paris 99.98 percent.

Paris probability under softmax
outputs 1, 2, 158%outputs 1, 10, 1100.0%
Data from the sources listed below.

Start with weights 1, 0, and negative 1, and all biases at zero. Feed in the longitude of central Paris, 2.3514, and the model confidently gets it wrong: Madrid at 0.91, Paris at just 0.086. The cross entropy loss, the negative log of the right answer's probability, is 2.45. Now nudge one weight, m2, from 0 to 0.1. The Paris probability rises to 0.107 and the loss falls to 2.24. Two measurements give an estimate of the slope: increase m2 and the loss goes down. Do that for all six weights and biases and you have gradient descent, walking downhill. The catch is that estimating slopes by trying values is slow and inexact, and it gets worse with more parameters.

Backpropagation replaces guessing with calculus. It applies the chain rule to compute the exact slope of the loss with respect to every parameter, efficiently, in one pass. The idea was not obvious even to experts. In the late 1950s Bernard Widrow and his student Ted Hoff trained single-layer networks by estimating slopes numerically, and stumbled onto an early version of the method, but could not see how to extend it past one layer. Werbos did. That extension is the whole trick: exact slopes, for every parameter, in networks of any depth. That is why one simple algorithm can train a model with 1.2 billion parameters. The next video in the series works through the chain rule itself, but the intuition is already here: learning is just slope-following, and backpropagation is how you get all the slopes at once.

Try this

bash
python -c "import math; h=[1,2,1]; e=[math.exp(x) for x in h]; print([round(x/sum(e), 3) for x in e])"

Sources