-
Introduction
I Didn’t Discover AI Through ChatGPT
A robotics engineer, I spent twelve years alongside artificial intelligence in places where it cannot be separated from…
-
01
February 2012: A Car That Learned Nothing
In February 2012, a car drove itself down a Californian highway without having learned anything: every rule had…
-
02
From One Neuron to a Network: What Is Learned and What Flows
A neuron on its own decides very little. This chapter stacks neurons into layers, shows that only numbers…
-
03
Rows of Numbers: What We Gain and What We Lose
How a network stores and multiplies its numbers, why that makes it a pattern-spotting machine, what it gains…
-
04
Rosenblatt, and the Book That Buried His Perceptron
In 1957, in an aeronautical laboratory in New York State, a machine learns instead of being programmed. This…
-
05
Backpropagation, or the Art of Sharing the Blame
A deep network gets it wrong: how do you know which setting to correct, and by how much?…
-
06
LeCun, ZIP Codes, and the Idea of Looking in Pieces
Connecting every point of an image to every neuron gives a count that the machines of the time…
-
07
Why It Wasn’t Enough: The Cost of a Single Experiment
The idea worked, and it convinced nobody. Three reasons explain why: three days of computation per experiment, no…
In 1957, in an aeronautical laboratory in New York State, a machine learns instead of being programmed. This chapter tells the story of the perceptron, the enthusiasm it raised, then the 1969 book that buried it, and why its gravediggers had good…
Read this episode again
Since 1969, a question had been waiting for its answer: when a network with several layers gets something wrong, which of its thousands of weights is to blame? Minsky and Papert’s book had asked it without solving it, and seventeen years went by before anyone heard the answer. It is called backpropagation, short for the backward propagation of the gradient, and its story is a textbook case of how much recognition owes to timing.
🧮 A word before we start. To understand how a machine learns, this episode lifts the bonnet: in two places, it follows the calculation step by step, with numbers and diagrams. These two passages lay the foundations for everything the series will go on to say about learning, but they are only passages. If mathematics does not appeal to you, each one opens with a link that lets you skip it: the story picks up right afterwards.
A method found four times
The mathematical mechanism was published as early as 1970 by a Finnish student, Seppo Linnainmaa, in a master’s thesis written in Finnish at the University of Helsinki. Neural networks are not mentioned once: Linnainmaa wanted to track rounding errors, the tiny gaps a computer introduces every time it truncates a number to store it in memory, and which pile up in long chains of calculation.
His question: an error made in the middle of the chain, how much does it distort the final result? Take a short chain. Start from 2 and multiply by 3: that gives 6. Add 1: that makes 7. Multiply by 2: we get 14. If a small error slips in at the 7, the last multiplication doubles it: it weighs twice its size on the result. If it slips in at the 6, the addition lets it through unchanged, then the multiplication doubles it: it weighs 2 as well. If it slips in at the starting 2, it is tripled, then doubled: it weighs 3 × 2 = 6.

Linnainmaa’s discovery lies in this way of counting: you start from the result and go back up the chain, multiplying the factors you meet along the way. In a single pass back, each step receives its weight, without redoing the calculation for each one. It works like a rumour passed from mouth to mouth: each relay can double or triple it, and to know how much a distortion slipped in at the start weighs at the end, you only need to walk back along the line, multiplying the amplifications.

The idea came to him, he says, on a sunny afternoon in a park in Copenhagen, where the Nordic universities then sent their heavy computations. Four years later, he would receive the first doctorate in computer science ever awarded by the University of Helsinki. He held the method that every learning program uses today.
In 1974, the American Paul Werbos made the connection in his doctoral thesis at Harvard: this machinery could train a network with several layers. This is the depth of the winter of artificial intelligence, the years when funding withdrew after broken promises, and he hit the wall you would expect. He would not manage to publish an application to neural networks until 1982. Nobody wanted to hear about perceptrons, those machines with a single trainable layer whose limits a book had just shown.

It took until October 1986, and a four-page paper signed by David Rumelhart, Geoffrey Hinton and Ronald Williams, published in Nature, received on 1 May and accepted on 31 July of the same year, for the profession to turn around. Not because those three had invented something their predecessors did not know, but because they showed, and above all said, what the method changed: through repeated adjustments, the intermediate layers end up representing by themselves the features that matter in the problem. The famous hidden layers, which nobody had known how to train since 1969, stopped being a wall. The title said it all: learning representations by back-propagating errors.
These adjustments run in a loop, and this learning loop is the engine of the whole method. Think of an archer in training: she shoots, looks at where the arrow landed, corrects her aim a little, then shoots again. The network answers; we measure its error; we correct its weights a little to reduce it; then we start again, with the corrected weights. One round changes almost nothing. It is the hundreds, sometimes thousands of rounds that make it learn: the symmetry network, further down, needed 1,425 of them. Backpropagation is only one step of this loop, the one that tells each weight which way to correct itself.


Their first example fits on the corner of a table. Imagine a row of six cells, each lit or unlit: there are sixty-four ways to light them. The network has to answer a single question: is the pattern symmetric? In other words, if you fold the row in the middle, does each cell on the left land on a cell on the right in the same state? The pattern 101101, that is, lit, unlit, lit, lit, unlit, lit, is symmetric: it reads the same both ways, like the word “radar”. The pattern 100100, lit, unlit, unlit, lit, unlit, unlit, is not.

This problem is a test bench, like a crash test for a car: tiny, and chosen to probe a single ability, that of comparing cells with one another. Here, the answer depends on no cell taken alone: a lit cell on the left says nothing until you look at the one opposite. Yet a network with no hidden layer, the one the 1969 book had buried, cannot do it: each cell weighs on the answer on its own, without ever being related to another. To compare, you need intermediate neurons, and to know how to train them. If the network succeeds, it proves that backpropagation really trains its hidden neurons. And this ability reaches far beyond six cells: recognising a letter or a face also means judging parts relative to one another.

The network is tiny: the six cells as input, two hidden neurons in the middle, and an output neuron that must light up to say “symmetric” and stay off otherwise. Each cell is connected to each of the two hidden neurons, and each of them to the output, by a wire that carries a weight: a volume knob that says how much whatever passes along that wire should count. At the start, its weights are drawn at random, between −0.3 and 0.3: it knows nothing.
🧮 The first calculation passage starts here: one round of training followed step by step. To stay with the story, pick up where the authors open the network.
The learning loop, seen up close, has five steps. One: the forward pass, where the network gives its answer. Two: the gap, where that answer is compared with the right one. Three: the climb back, where the gap travels from the output back down to the hidden neurons. Four: the sharing out, one floor lower, where each weight receives its share. Five: the correction of the weights. The first two are “the network answers” and “we measure its error”; the next three spell out “we correct its weights”. The first four are repeated for each of the sixty-four patterns; the fifth happens only once all the patterns have been seen. Let us follow one round, on the pattern 100100, which is not symmetric.

Step one, the forward pass. Cells 1 and 4 are lit: they are worth 1. The other four are unlit: they are worth 0. Each hidden neuron multiplies each cell by the weight that connects it, adds everything up, then turns this sum into a signal between 0 and 1. The output neuron does the same with the signals of the two hidden neurons.

Take the top hidden neuron. It receives the six cells, each through its own weight. Cell 1 brings 1 × 0.2 = 0.2; cell 4, 1 × (−0.1) = −0.1; each unlit cell brings 0 times its weight, that is, nothing. The sum is therefore 0.1. This number then goes through a formula that brings it back between 0 and 1, the sigmoid: 1 / (1 + e−sum), where e is about 2.718. It is this network’s activation function, a gentle version of the threshold of episode 3: where the threshold was a switch, all or nothing, the sigmoid is a dimmer. A sum of zero gives exactly 0.5, a very positive sum gives almost 1, a very negative sum almost 0. Here, 1 / (1 + e−0.1) is 0.52. The bottom hidden neuron does the same calculation with its own weights: 1 × (−0.3) + 1 × 0.1 = −0.2, which the sigmoid brings back to 0.45.

Why this curve rather than the perceptron’s hard threshold, which returns 0 or 1? Because backpropagation needs to know how much the output moves when a weight moves a little. With a hard threshold, the answer is always “not at all” or “all at once”: the curve is flat everywhere except at the jump, like a staircase with a single step, a landing where nothing moves and an edge where everything tips over. There is no way to read a weight’s share from it. The sigmoid keeps the idea of the threshold, an output between 0 and 1 that tips over around 0, but replaces the step with a ramp: its slope exists at every point, and it is this slope that the climb back will multiply. The 1986 authors say so: any function will do, as long as its slope exists everywhere and stays bounded.

The output neuron does the same with what the two hidden neurons send it. It multiplies 0.52 by its weight, 0.3, which gives 0.156, and 0.45 by 0.1, which gives 0.045: the sum is 0.20. The sigmoid brings it to 0.55. Why so close to 0.5? Because the weights are still random and very small, between −0.3 and 0.3: they can only produce sums close to 0, and the sigmoid returns 0.5 for a sum of zero. On the sigmoid’s ramp, every neuron stays halfway up. The network leans neither one way nor the other.

Step two, the gap. The right answer is 0, “not symmetric”. The network answered 0.55: it is off by 0.55, upwards. It is this gap that now has to be shared out among the weights.

Step three, the climb back: the backward pass starts at the top. The gap leaves the output and travels back down to the two hidden neurons. Each receives a share proportional to the weight that connects it to the output. That weight is the number by which the output multiplies the hidden neuron’s signal: with a weight of 0.3, the signal counts three times more than with a weight of 0.1. The neuron connected by 0.3 therefore weighed three times more on the wrong answer, and it receives a share of the gap three times larger: the top hidden neuron receives 0.55 × 0.3, that is 0.165, the bottom one 0.55 × 0.1, that is 0.055. It is a restaurant bill split according to what each person ordered. A negative weight, such as −0.3, weighs as much as a weight of 0.3, but in the opposite direction: its share is the same size, with the opposite sign. This is Linnainmaa’s climb back, which multiplies the factors met along the way. In passing, each of the two weights leading to the output receives its own share: the gap, multiplied by what that weight carried, that is 0.55 × 0.52, about 0.286, for the weight coming from the top neuron, and 0.55 × 0.45, about 0.248, for the one coming from the bottom neuron.

Step four, the sharing out, one floor lower. Each hidden neuron in turn shares its portion among the six weights that reach it from the cells. A simple rule applies: a weight is responsible only for what it carried. The weights of cells 1 and 4, which are lit, carried a signal: they receive a share of the gap. The weights of the four unlit cells carried nothing, like pipes that stayed dry: their share is zero, for this pattern. The weight connecting cell 1 to the top hidden neuron therefore receives that neuron’s share, multiplied by what the cell sent, which is 1: 0.165; the one connecting it to the bottom neuron, 0.055; the same goes for cell 4.

Step five, the correction. It waits for the end of the pass: until then, the shares are only noted down, and the network moves on to the next pattern. This complete round of the sixty-four patterns is called a pass. At the end of each pass, and only then, all the weights are corrected at once: each takes a small step in the direction that would have reduced the sum of its shares. This step, the amount by which the weight actually moves, is that sum multiplied by a small number fixed in advance, here 0.1, which we will meet again later under the name of learning rate, and which the diagram boxes in yellow. It goes in the opposite direction to the share: a positive share makes the weight go down. For the example, let us apply it to the shares of the pattern 100100 alone: the weight connecting cell 1 to the top hidden neuron goes from 0.2 to 0.2 − 0.1 × 0.165, about 0.184. The weights of the unlit cells, which received no share, do not move.

Then everything starts again at step one, like a pupil who returns to the same exercise the next day, with what they corrected the day before: a new pass opens on the first pattern, which the network now computes with its corrected weights. Let us take the pattern 100100 again at the start of the second pass. The first step runs exactly as in the first pass: each hidden neuron adds up the weights connecting it to the lit cells, then applies the sigmoid. Only the weights have changed. The top neuron receives the corrected weight of cell 1, 0.184, and that of cell 4, −0.117, that is 0.067 in all, and outputs 0.517; the bottom one receives −0.306 and 0.094, that is −0.212, and outputs 0.447. The output adds up 0.517 × 0.271 and 0.447 × 0.075, that is 0.174, and answers 0.543, against 0.55 in the first pass. The gap has shrunk by a little under a hundredth: a tiny step, but in the right direction. Then come the gap, the climb back and the sharing out, as in the first pass, with these new numbers, and likewise for each of the sixty-four patterns.

Nowhere in the program did the authors write what symmetry is: the network receives nothing but patterns and the right answer. It remains to decide when to stop, because the loop itself has no natural end. The experimenter sets a stopping condition in advance, almost always an error threshold: at the end of each pass, the errors of the sixty-four patterns are added up, and as long as this total has not fallen low enough, another round begins. The error of a pattern is its gap multiplied by itself. This product is always positive: without it, the gap of −0.45 of a symmetric pattern, where the network answers 0.55 instead of 1, would cancel out the gap of 0.55 of another pattern. And a big gap weighs far more than a small one: 0.5 gives 0.25, whereas 0.1 gives only 0.01. At the end of the first pass, the network answers around 0.55 to every one of the sixty-four patterns, symmetric or not: the total error is 18.44, that is 0.29 per pattern.

In the same team’s work, an output above 0.8 counts as a clear “yes”, and learning is judged successful when the error drops below one hundredth per pattern, which amounts to a gap of about 0.1 on each pattern. The number of passes is never chosen in advance: it is the outcome of the experiment. Here, it takes one thousand four hundred and twenty-five for the network to get none of the sixty-four patterns wrong. Later in this episode, the same round is done again with numbers, on a network that tells a dog from a cat.

After the one thousand four hundred and twenty-five passes, training stops: the network answers all sixty-four patterns correctly, and its weights no longer move. The authors then open the network and read the final value of each of its weights, to understand how it goes about it. Nobody gave it a method: what they find is a strategy the network put in place itself, correction after correction. Each of the two hidden neurons handles the cells in twin pairs, those facing each other on either side of the middle. The two cells of a pair receive a weight of the same size but opposite signs: +4 for one, −4 for the other, for example. And the three pairs do not have the same strength: their weights are in the ratio 1, 2 and 4.

Here is the setting the network ended up finding. The first hidden neuron looks at the six cells through weights arranged as a mirror around the middle of the row: plus 1, minus 2, plus 4 on the left half, then minus 4, plus 2, minus 1 on the right half, reduced here to their ratio. Each cell thus has, on the other side of the fold, a twin of the same strength and opposite sign, like the two pans of a pair of scales. This setting is enough to recognise symmetry. If the pattern is symmetric, the two cells of each pair are in the same state. Both lit, they bring +4 and −4, which cancel out; both unlit, they bring nothing. The sum received by the hidden neuron is exactly zero, the scales stay level, and it stays off, because it only lights up above a threshold. If the pattern is not symmetric, at least one pair is mismatched and leaves a remainder: 1, 2 or 4, plus or minus. Thanks to the ratio 1, 2, 4, these remainders can never cancel one another out, because 4 is more than 1 and 2 together: the sum does not fall back to zero. The second hidden neuron carries the same weights with the signs reversed. Whatever the sign of the remainder, one of the two therefore receives a positive sum and lights up. It then switches the output off, and the output answers “not symmetric”. When neither lights up, the output stays on: “symmetric”. On 101101, each of the two receives 1 + 4 − 4 − 1, that is 0: the output says “symmetric”. On 100100, the first receives 1 − 4, that is −3, and stays off; the second receives +3, lights up and switches the output off: “not symmetric”.

None of these values was written by the authors. The mirrors, the opposite signs, the ratio 1, 2, 4: the network found them on its own, through corrections. That is what the title of Rumelhart, Hinton and Williams’s paper in Nature promised, “learning representations by back-propagating errors”: hidden neurons that invent for themselves the way of encoding the pattern that the problem needs, here pairs of cells compared in a mirror.
Textbooks credit the method to Rumelhart, Hinton and Williams, although Linnainmaa and Werbos had described it before them. Their paper cites neither of them, but it does cite Yann LeCun, to whom episode 6 is devoted, who had presented it in Paris in 1985. An idea does not prevail on the day it is right, but on the day someone knows how to tell it to those who need it.


The symmetry network found its method on its own: nobody programmed the mirrors or the ratio 1, 2, 4, only a correction rule, applied in a loop. This way of obtaining behaviour, by setting rules rather than writing the behaviour itself, was at work in research long before 1986, from John Conway’s Game of Life, in 1970, to programs that imitate evolution. It has its own special episode, Rules, Not Orders. For neural networks, where each weight’s share can be calculated, calculation wins: here is how.
🧮 The next two sections form the second calculation passage: the method redone with numbers, on a network that tells a dog from a cat, then an app to run it yourself. To stay with the story, go straight to the 1988 robot arm.
Learning means correcting each weight by a small step
The principle comes down to four moves, repeated in a loop: it is the learning loop we already met with the symmetry network. Follow them on the small network of episode 2, which has four layers: four inputs, two layers of six hidden neurons, and two outputs, one for “dog”, the other for “cat”. Above all, follow the line with the weight 0.80 that we chose there: it connects a neuron in the third layer to the “dog” output.
First, the network is shown an example, a picture of a cat, and left to produce its answer: this is the forward pass, the numbers travel through the layers to the output. Let us say the “dog” output lights up at 0.70, when it should have stayed at 0.
Next, this answer is compared with the truth, “cat”, and the gap is summed up in a single number, the loss: the measured size of the error, which training tries to bring down, and which we will define more precisely a little further on. Then comes the clever move, the one that gives the method its name, the backward pass: this gap is sent back from the output towards the input, layer after layer, to give each weight its share of responsibility for the error. Finally, each weight is corrected by a small step, all the larger as its share is heavy.

It remains to decide the size of the corrections. You have already seen it at work in the symmetry network: at step five, the weight connecting cell 1 to the top hidden neuron went from 0.2 to 0.2 − 0.1 × 0.165, about 0.184.

In this calculation, 0.165 is the weight’s share: it says which way to correct it and how much it counted in the error. The step is the amount by which the weight actually moves: 0.1 × 0.165, about 0.017. The 0.1 that turns the share into a step is called the learning rate: a number chosen in advance, the same for every weight.

Let us change this one setting, on the same weight and with the same share, 0.165. With a rate of 0.1, the step is 0.1 × 0.165, about 0.017, and the weight goes from 0.2 to 0.184. With a rate ten times smaller, 0.01, the step also becomes ten times smaller, about 0.002, and the weight only comes down to 0.198. With a rate ten times larger, 1, the step is the whole share, 0.165, and the weight drops all at once to 0.035.

Let us put three precise names on what we have just described. The loss function is the rule that turns the gap between the network’s output and the right answer into a single number. The error says that the network is wrong; the loss says by how much, in a single number, and it is the loss that training tries to bring down. The simplest one squares the gap and takes half of it; it is the one in the 1986 paper. On our cat picture, the “dog” output answers 0.70 instead of 0: the gap is 0.70, its square 0.49, and the loss half of that, 0.245. If an output answered 0.30 instead of 1, the gap would be −0.70, and the loss would be the same, 0.245: squaring makes the loss positive whichever way the error goes. It also weighs more heavily on big errors: a gap of 0.10 costs only 0.005, forty-nine times less than a gap of 0.70, although it is only seven times smaller. The symmetry network’s “total error”, 18.44, was already a loss: it counted the square without taking half of it; with the half, it would be 9.22, and the errors would keep the same order.

The gradient is the slope of this loss with respect to each weight, that is, how much it moves, and in which direction, when that setting is nudged by a hair.
Measure a slope by trial and error. Keep every weight still, except ours. At 0.80, the “dog” output is 0.70 and the loss half of 0.70 squared, that is 0.245. Set the weight to 0.60 and run the network again: the loss falls to 0.168. Set it to 1.00: it rises to 0.336. Between the two outer trials, the weight has gained 0.40 and the loss 0.168. The slope is therefore 0.168 divided by 0.40, that is 0.42. It is positive: to bring the loss down, the weight has to decrease.

Gradient descent means changing each weight by a small step in the direction that brings the loss down, then starting again. It is walking down a mountain in fog by feeling the slope under your feet.
Go down one step. Imagine the loss forms a basin, a bowl whose bottom sits at weight 0: loss equals weight multiplied by itself, a parabola. You are at weight 3, so the loss is 9. The slope at this point is twice the weight, that is 6. It is positive: the loss climbs to the right, so you have to go left.
Take the step, at a learning rate of 0.1: it is 0.1 times 6, that is 0.6, and the weight goes from 3 to 2.4. New loss: 2.4 times 2.4, that is 5.76, against 9 before. Start again: at weight 2.4, the slope is 4.8, the step 0.48, and you reach 1.92, where the loss is only 3.69. That is all of gradient descent, and it is literally how a model learns, one tiny step after another.

The rate sets the pace of this descent. On the same parabola, with a rate of 1, the step is the whole slope: weight 3 jumps to −3, then back to 3, endlessly. Too large, the rate makes the network bounce from one side to the other without ever settling, like a marble thrown too hard into a bowl, which always climbs back up the opposite wall. With 0.01, each step removes only 2% of the weight: in twelve steps, it only goes from 3 to 2.35. Too small, the rate makes the network crawl along at a snail’s pace. With 0.1, each step removes a fifth of the weight, and the weight goes down towards the bottom. A real network starts again like this millions of times, with millions of examples.

There remains the question these three words leave open, and it is the heart of the method: how do you get the slope of each weight? A naive way comes to mind at once, the very one we have just used to measure the slope by trial and error: nudge the weight by a hair, run the network again, see whether the loss goes up or down. It is a perfect definition of the gradient. As a method of calculation, it is a dead end: it would take one full trial per weight, seventy-two for our small network, billions for a large model, and that for a single example. The matter would be closed before it had begun. All the ingenuity of backpropagation lies in this: it gets the same numbers without running a single trial, in one pass back.

A weight is only to blame for what it carried
The feat rests on a disarmingly simple remark. A weight never acts directly on the final error; it acts on the neuron it feeds, and that neuron acts on what follows. Its share is therefore a product of two things: the share of the neuron it feeds, that is, how much that neuron counted in the error, and what it carried into it. A weight that pours a lot into a neuron with a large share is very guilty; the same weight, if it carried almost nothing, is hardly guilty at all, even if the neuron downstream got things badly wrong. This is exactly how blame is shared out along a chain of subcontractors: you ask each one how much they delivered, and to whom.

Share out the blame yourself. Let us go back to the weight we are following, the one worth 0.80. The “dog” output was off by 0.70: that is our starting gap. This weight carried the value 0.60, produced by the hidden neuron that feeds it. Its share is therefore 0.70 multiplied by 0.60, that is 0.42. Recognise this number: it is the slope that the three trials measured by trial and error, moving the weight one way and then the other. We have just obtained it with a multiplication, without a single trial.
Take the step. With a learning rate of 0.1, it is 0.1 multiplied by 0.42, that is 0.042. The weight goes from 0.80 to 0.758, which we will round to 0.76. You have just done by hand, on one weight, what a machine does on billions.

It remains to go down one floor, and that is where the method becomes a climb back. We now know the output’s share; we want the hidden neuron’s, so that we can deal with the weights below it. Same reasoning, the other way round: this neuron is responsible in proportion to the share of the neuron it feeds, multiplied by the weight that connects them. The weight is taken as it was at the moment of the error, 0.80, not its corrected value: 0.70 multiplied by 0.80, that is 0.56. It has now become, in its turn, a neuron whose share we know.
A weight beneath it, which carried 0.50, therefore gets 0.56 multiplied by 0.50, that is 0.28. And so on down to the first layer.

This calculation simplifies two things. First, a hidden neuron usually feeds several neurons in the next layer, not just one: its share is then the sum of the shares of the neurons it feeds, each multiplied by the corresponding weight. Ours also feeds the “cat” output, which got it wrong the other way: it answered 0.30 instead of 1, a gap of minus 0.70. If the weight connecting them is 0.20, the hidden neuron’s share becomes the sum of two products: 0.70 multiplied by 0.80, that is 0.56, and minus 0.70 multiplied by 0.20, that is minus 0.14. Total: 0.42.
Next, the activation function has to be taken into account, the neuron’s second stage, which episode 3 called the threshold: it lets a positive number through unchanged and brings a negative number back to zero. A neuron whose sum was positive sends back the whole share it receives. A neuron brought back to zero sends back nothing, since moving its inputs a little changed nothing in what it emitted. Other, gentler activation functions dampen this share instead of cutting it. Neither addition changes the principle: they add terms to the sum and a factor to the multiplication.

You now hold the reason why it is called backpropagation, and why the method is thrifty: each floor reuses the result of the floor above instead of recalculating it. The error goes down once, from top to bottom, and each weight it meets on the way learns its share in passing. A single pass back for the whole network, however many layers it has. It is this saving, and nothing else, that made hidden layers trainable. The 1969 lock gives way.
Your turn to run the machine. The first tab, “Step by step”, unrolls the calculation one step at a time: on this episode’s example, whose numbers you will recognise, then on the exclusive or of the previous episode. The second, “On a real network”, shows the same calculation at work: draw a digit, and a network tuned by backpropagation on sixty thousand handwritten digits recognises it.
Backpropagation, step by step
Two tabs, one and the same calculation. The first unfolds it one step at a time on a small network; the second shows it at work on a network trained the same way: draw a digit, and it recognises it.
➡️ the numbers move forward, from input to output
🔍 The calculation in detail
Choose an example, then run the forward pass.
Run a forward pass, then a backward pass, and touch a line: its calculation appears here.
average loss per epoch
✏️ Your turn: draw a digit from 0 to 9 in the frame, then lift the pen. Steps 2 to 4 show how the network analyses it.
✏️ your drawing → ✂️ 28 × 28 points → 🧠 32 neurons → 📊 10 outputs
1. ✏️ Your drawing 280 × 280 points, black or white: this is what you see, not yet what the network sees.
The image stays in your browser: it is not sent anywhere.
2. ✂️ Framed as in MNIST The box around the ink is cut out, brought down to 20 points high and centred in a 28 × 28 square. These 784 numbers, from 0 to 1, are all the network sees.
No ink found: draw or import a digit.
3. 🧠 32 hidden neurons Each multiplies the 784 numbers by its weights, adds up and passes its threshold. In yellow, the ones your drawing lights up: they react to certain bits of strokes.
4. 📊 10 outputs, one per digit Each output combines the 32 hidden neurons and gives a score from 0 to 1. The strongest, in green, is the answer.
🤔 Did the network recognise the right digit?
Which digit did you draw?
Model, source and limits
Model: the loss is half the square of the gap; a neuron’s blame is the sum of the blames it feeds, each multiplied by the weight; a weight’s slope is the blame where it arrives multiplied by what it carried; the correction is the learning rate multiplied by the slope. Source: the paper by Rumelhart, Hinton and Williams (Nature, 1986), and the numbers in this episode. Limits: a small dense network; real networks have millions of weights, and the On a real network tab only recognises single digits, drawn as in MNIST.
784 inputs, 32 hidden neurons, 10 outputs: 25,450 parameters set by the same backpropagation, on 60,000 handwritten digits. Data: the MNIST database (Yann LeCun, Corinna Cortes, Christopher Burges).
The same calculation shares out the blame in an arm that misses its move
Two years after the Nature paper, the method left the screen for an arm. In 1988, in the journal Neural Networks, Hiroyuki Miyamoto, Mitsuo Kawato, Tohru Setoyama and Ryoji Suzuki published feedback-error learning for the trajectory control of a robotic manipulator. The problem is exactly ours, set in a world with weight and inertia: the error only shows at the end, where the robot’s hand does not arrive where it should, and it has to be shared out upstream, among joints that have each pulled slightly askew. It is the darts player’s situation, who sees only where the dart landed and has to work out whether the shoulder, the elbow or the wrist went astray. The legacy of this work is clear: neurorobotics, which studies the nervous system by putting it in charge of robots, dates from those years, and Kawato’s team would build a whole series of real machines to test how the cerebellum corrects movement. By 1990, Mitsuo Kawato and his colleagues were testing it on an industrial PUMA arm, to which they added one more joint. Here, as elsewhere, the network was never given the right answer. It was given the gap, and it learned whom to blame.

The same year, it also took the wheel. Dean Pomerleau, at Carnegie Mellon University, trained a three-layer network by backpropagation to follow a road: this is ALVINN, whose weights episode 2 counted, and he put it on the laboratory’s test vehicle. Consider what this shifts. Until then, making a machine follow a road meant writing by hand what the edge of a carriageway is, then rewriting it for every kind of lighting and every road surface. Pomerleau’s network receives nothing but pictures of roads, generated by computer, and for each one the turn that would bring the vehicle back to the centre of the carriageway seven metres further on; what a road edge is, it works out for itself, in its intermediate layers. It learns like a learner driver who is shown 1,200 computer-drawn views of a road, each with the instructor’s turn of the wheel. It is the same move as on Kawato’s arm, and already, in 1988, it is the lineage of the cars that open the first chapter of this series.

The backward pass never whispers the right answer to the network. It only tells each weight how far it was off, and which way to correct itself. It is by piling up these micro-corrections, over countless examples, that the machine ends up “knowing”. You might think, at this point, that the case is closed. It is not: this idea would take another twenty years to reveal its full power, and the road would first go through a quiet triumph, on envelopes.
For those who want to get their hands dirty: “Formation Deep Learning complète”, by Guillaume Saint-Cirgue, on his channel Machine Learnia, published in 2021. He builds a neural network from scratch, with the mathematics in full. The video is in French.
Sources
A method found four times
- Learning representations by back-propagating errors · Rumelhart, Hinton and Williams, Nature, volume 323, pages 533 to 536, 1986 · received 1 May 1986, accepted 31 July, published 9 October; formally a Letter rather than an Article · peer-reviewed journal · the symmetry example, six inputs, two hidden units, 1,425 passes over the 64 patterns and mirrored weights in the ratio 1, 2, 4; a bibliography of four references, Rosenblatt 1961, Minsky and Papert 1969, Le Cun 1985 and the 1986 PDP chapter, with neither Linnainmaa nor Werbos
- Who Invented Backpropagation? · Jürgen Schmidhuber · the lineage from Linnainmaa 1970 to Rumelhart 1986 · the author’s personal page, a party to the dispute over credit (the same page carries his criticism of the 2018 Turing Award and the 2019 Honda Prize): a documented plea, not an arbitration
- Who Invented the Reverse Mode of Differentiation? · Andreas Griewank, Documenta Mathematica, Extra Volume ISMP, 2012, pages 389 to 400 · peer-reviewed, open-access volume, independent of the dispute over credit · has from Linnainmaa himself the sunny afternoon in a Copenhagen park in 1970, the intended use, estimating the effect of arithmetic rounding, and the first doctorate in computer science awarded by the University of Helsinki four years later
- Backwards Differentiation in AD and Neural Nets: Past Links and New Opportunities · Paul Werbos, paper for the AD2004 conference · the author writes that backpropagation was first made explicit and implemented in his Harvard doctoral thesis, Beyond Regression (1974), and that the IEEE Neural Network Society cited this thesis when giving him its pioneer award; his bibliography dates the text carrying the application to networks to 1982 · published on the author’s website, he too being a party to the dispute over credit
Learning means correcting each weight by a small step
- Learning representations by back-propagating errors · Rumelhart, Hinton and Williams, Nature, volume 323, pages 533 to 536, 1986 · the loss as half the sum of the squared gaps between the output obtained and the output wanted
The same calculation shares out the blame in an arm that misses its move
- Feedback-error-learning neural network for trajectory control of a robotic manipulator · Miyamoto, Kawato, Setoyama and Suzuki, Neural Networks, volume 1, issue 3, 1988, pages 251 to 265 · peer-reviewed journal
- Optimization and Learning in Neural Networks for Formation and Control of Coordinated Movement · Mitsuo Kawato, ATR technical report TR-A-0086, 1990 · laboratory report · Kano, Kawato, Uno and Suzuki (1990) learn the trajectory control of an industrial PUMA arm given an extra degree of freedom
- Neurorobotics · Jeff Krichmar, Scholarpedia 3(3):1365, 2008 · reviewed article · neurorobotics emerged in the late 1980s; Kawato’s team built a series of real robots to test how the cerebellum adapts movement, referring to the 1988 paper
- ALVINN: An Autonomous Land Vehicle in a Neural Network · Dean A. Pomerleau, Advances in Neural Information Processing Systems 1, proceedings of the 1988 conference · peer-reviewed proceedings · a three-layer network trained by backpropagation to follow a road: 1,217 inputs, 29 hidden neurons, 46 outputs; 1,200 synthetic road images; as target, the turn that brings the vehicle back to the centre of the road seven metres further on; the test on the Carnegie Mellon vehicle
- Formation Deep Learning complète · Machine Learnia, Guillaume Saint-Cirgue, 2021 · further learning in French, a network built from scratch, mathematics in full; not a piece of evidence














