One idea, one picture at a time. There are exactly two formulas in here, both at the end, and you do not need them to follow the story.
A normal network sees a snapshot. Language is a film.
A classifier that we have built so far does one thing extremely well: it looks at a fixed-size thing and gives one answer. A 32×32 image goes in, “cat” comes out. A row of six measurements goes in, “diabetic” comes out. The size is fixed before the network is even built.
Now hand it “the dog bit the man”. Then hand it “the man bit the dog”. Same six words, same letters, completely different meaning. If your network only sees a bag of words, these two sentences are identical inputs. It cannot possibly answer differently.
And there is a second problem, less philosophical and more annoying: sentences have no fixed length. “Yes.” is a sentence. So is a 60-word paragraph. A network built around a fixed input size has to be rebuilt for every length, which is obviously not how anything real works.
Why you cannot just “make the input bigger”.
Here is the naive fix: decide that every input is exactly 10 words. Pad short sentences with blanks, chop long ones. It works for a demo and fails immediately in reality — the 11th word of a long sentence is gone, and a sentence of 3 words is 70% padding.
Worse, the network that eats this lunchbox has no idea that position 1 and position 2 are related. Feed it “not good” and “good not” padded to the same 10 slots and it sees two different bags of the same tokens. Every word is processed alone, in parallel, with no notion that one came before another.
The one idea this whole lecture is about.
Forget networks for a second. Imagine a person reading a sentence out loud, one word at a time, with a small notepad and a pencil. They cannot look back at the words already spoken — the page is hidden. All they have is the notepad.
So after each word they do the obvious thing: read the word, look at what is already on the notepad, and write something new. By the end of the sentence, the notepad holds their understanding of it.
That is a recurrent neural network. Not an analogy for one — that is the mechanism, with the person replaced by a matrix multiplication and the notepad replaced by a vector of numbers.
Type a sentence and step through it. Watch what the notepad can and cannot keep. This is a toy: a real RNN learns what to write, this one just lets old lines fade.
Notice what happens in the widget when the sentence gets long. The notepad does not grow. It has four lines whether the sentence has five words or fifteen — so something always has to be overwritten. That is not a flaw in the toy. It is the defining limitation of the whole architecture, and it is exactly what the next lecture (LSTM, GRU) is built to fix.
One box, used again and again.
In a diagram, an RNN is usually drawn as a single box with an arrow looping out of it and back in. That loop is confusing at first. The trick is to unroll it: draw the same box once per word, side by side, and let the arrow go from one copy to the next.
The detail that makes RNNs practical — and the one most people miss.
When you unroll the network, you get T copies of the cell. The tempting assumption is that each copy has its own weights: one set for word 1, another for word 2, and so on. That would be a disaster. A 100-word sentence would need 100 sets of weights, and a sentence of 101 words would be impossible.
Instead, all the copies share exactly the same numbers. It is one pen used on every page. That is why an RNN can accept a sentence of any length with the same parameter count — and why training works at all: when the network learns something at word 3, it has simultaneously learned it for every position.
The only difference between the two bars is whether the weights are shared across time.
Read, remember, report.
The cell does three separate things, and it is easier to keep them apart as three jobs than as three matrices. Each job is a bundle of numbers the network learns — nothing more mysterious than that.
Why “mix” and not just “replace”? Because a useful notepad has to hold both: the subject you read six words ago and the negation you read one word ago. The cell does not decide which is which by hand — it learns, from data, how much of the old notepad to keep relative to the new word. That single learned balance is what people mean when they say an RNN “has memory”.
Why the notepad never explodes.
If every word adds a little to the notepad, a 300-word text would add 300 times. The numbers would grow without limit and the whole thing would blow up. So after every update, the notepad is passed through a squashing function called tanh, which squeezes any number into the range −1 to +1.
This has a side effect that becomes the villain of section 9: when the input is large, tanh is almost flat. Flat means “barely changes when you nudge it” — and a function that barely changes cannot pass a correction backwards very well. Keep that in your pocket.
Why the same cell can caption an image or label a video.
Nothing says you must put something in at every step, or take something out at every step. Once you see that, the same brick covers four standard tasks:
Read everything, then grade everything — backwards.
Training happens in two passes. First the sentence is read left to right, word by word, and at each step the network guesses the next word. Then something compares every one of those guesses with the truth and produces a grade. That is the forward pass — cheap, and identical to what happens at test time.
The interesting part is the correction. To know how to improve, the network must work out how much each step contributed to the final grade, and it does that by walking backwards through the sentence, from the last word to the first. This is called backpropagation through time, and the name is honest: it is ordinary backpropagation, applied along the arrow of time.
Each step backwards multiplies the signal by a factor a little below 1. Slide the distance and watch the light.
By the time the correction reaches the first words, there is almost nothing left of it. So the network learns the end of the sentence very well and the beginning hardly at all — even when the beginning is what matters. Two practical consequences appear immediately:
Two different kinds of forgetting — keep them apart.
There are two distinct failures, and they are easy to blur together:
LSTM and GRU — next lecture — are the same notepad idea with one addition: instead of overwriting blindly, the network learns three small decisions at every word. Should I erase this line? Should I write this word here? Should I read this line out now? Those decisions are called gates, and they are learned from data exactly like everything else. A gated network can carry one line untouched for a thousand words — which is precisely what the plain notepad cannot do.
| The wrong picture | What is actually happening |
|---|---|
| “It stores the sentence.” | It stores a fixed-size summary, rewritten at every word. |
| “Each word has its own weights.” | One set of weights, reused at every position. |
| “It is just a deep network.” | It is a shallow network applied in a loop, sharing weights. |
| “Forgetting is a bug.” | It is arithmetic: a bounded notepad and a fading correction. |
| “More words = better understanding.” | Past a point, more words just overwrite what was there. |
If you do want the notation, this is all of it. Everything above is these two lines, described in words.
Read it as: new notepad = squash( remember-part × old notepad + read-part × today's word ), and answer = report-part × notepad. The three $W$ are the three jobs from section 6. That is the whole model.