Visual walkthrough — Recurrent Neural Networks (RNN) architecture
This page builds the RNN update equation from nothing. No prior notation is assumed. If you have never seen a vector, a matrix, or the word "state", start here at line one and we will earn every symbol as we go. The parent note is Recurrent Neural Networks (RNN) architecture — this page is its slow-motion, picture-by-picture replay.
Step 1 — What is a "sequence", and why memory is the whole problem
WHAT. A sequence is just a line of boxes, read left to right, one box at a time. Each box holds one thing: a word, a character, a number. We write the box at position as .
- — the input at step . The little "" up top is not a power. It is a label meaning "the one at time ". So is the first thing, the second, and so on up to , where is how many boxes there are.
WHY. A plain neural network sees one box and forgets it instantly before the next box arrives. That is fine for a photo, useless for a sentence — you cannot understand "the mat" if you have already forgotten "the cat sat on". So we must carry something forward.
PICTURE. Below: three input boxes in a row. The dashed amber arrow is the thing we still need to invent — a wire that carries a memory from one box to the next.

Step 2 — Invent the memory vector
WHAT. We invent a second box that lives between the input boxes and carries information forward. Call it the hidden state, written .
- — the symbol just means "a list of real numbers". If , then is 128 numbers stacked in a column. is a knob we choose (bigger = more room to remember).
WHY a vector and not a single number? One number can only remember one thing (say, "was the last word positive?"). A list of 128 numbers can remember 128 different features at once — tense, subject, sentiment, open brackets… We want richness, so we use a vector.
PICTURE. The memory box drawn as a stack of little cells; the amber wire from Step 1 now plugs into it and flows rightward.

Step 3 — The memory must depend on two things
WHAT. The new memory must be built from exactly two ingredients:
- the old memory (what we knew a moment ago), and
- the new input (the word we just read).
So we want a rule of the shape
WHY these two and nothing else? If we left out , there is no memory — we are back to the forgetful network. If we left out , the machine ignores the actual sentence. Both must go in.
PICTURE. Two arrows feeding a single "blender" node: one arrow labelled coming from the left, one labelled coming from below.

Step 4 — How do we "blend" two vectors? Weighted sums (matrices)
WHAT. The simplest fair way to blend two lists of numbers is: scale each one and add them. Scaling a whole vector is done by a matrix.
We introduce two mixing desks and a nudge:
Term by term, right where each lives:
- — takes the old memory and re-mixes it. is the recurrent weight matrix (), size .
- — takes the new input and re-mixes it into memory-shaped numbers. has size (input has numbers, memory has ).
- — the bias, a fixed vector added every time. It lets the machine have a default lean even when everything else is zero.
- — the raw blended result, before we tame it in Step 5.
WHY a plain weighted sum? Because it is the most general linear mix, and (crucially) it is easy to differentiate later for training. Any fancier behaviour we need will come from the non-linearity in the next step, not from a complicated blend here.
PICTURE. The blender opened up: two mixing desks and , their outputs summed with into .

Step 5 — Tame the blend with
WHAT. The raw sum can be any size — a thousand, a million. We squash it through the function , applied to every number separately:
WHY and not just leave it linear, or use another squash?
- Why squash at all? Without a squash, stacking many time steps is just one giant matrix multiply — a purely linear machine that cannot learn curvy patterns. The squash is what gives the network its power.
- Why specifically? Its output is centred at zero (ranges to ), so memories can be positive or negative — useful for "yes/no" style features. A sigmoid (range to ) can never say "strongly negative". also keeps values bounded, so memory cannot blow up to infinity as we loop.
PICTURE. The S-curve of with the flat ceilings at marked, and an example input arrow being squashed down into range.

That boxed line is the RNN. Everything the parent note states follows from these five moves.
Step 6 — Reading an answer out: the output
WHAT. The memory is internal. To get a usable answer we project it once more:
- — the hidden-to-output desk, size . It reshapes the -long memory into the numbers the task needs.
- — output bias.
- — the raw output (later passed through softmax for probabilities, or sigmoid for yes/no).
WHY a separate desk instead of using directly? The memory dimension (say 128) rarely equals the answer dimension (say 26 letters, or 1 sentiment score). is the translator between "how much I remember" and "what I must report". Separating them lets the memory stay rich while the report stays the right shape.
PICTURE. The memory box feeding a small desk that emits a short output vector .

Step 7 — Unfold: the same machine reused every step
WHAT. There is only one set of desks . We do not build a new machine per word — we reuse the same machine, feeding its own output-memory back into itself. Drawing that reuse spread out across time is called unfolding.
WHY reuse (weight sharing)?
- Fixed size, any length. One machine handles a 3-word tweet or a 3000-word essay.
- A rule that does not change with position. "How words affect memory" should be the same at word 2 as at word 200.
- It mirrors how Backpropagation Through Time (BPTT) later sends gradients back along the shared wires.
PICTURE. Three copies of the identical cell in a row, the amber memory wire threading , every copy stamped "same weights".

Step 8 — The degenerate cases (never leave a gap)
Every edge the reader could hit, shown explicitly.
The one-picture summary
One figure compressing all eight steps: inputs flow up, the two desks blend old memory with new input, squashes, memory flows right (reused weights), outputs drop down — with the start marked.

Recall Feynman retelling — say it back in plain words
We wanted a tiny machine that reads a line of boxes and remembers. So we gave it a scratch-pad of numbers, the memory . At each box it does the same three things forever: (1) mix the old memory (desk ) with the new box (desk ) and add a fixed nudge ; (2) squash the mix with so it stays between and — that squash is what makes it smart, and the zero-centred range lets it hold "positive" and "negative" facts; (3) if we need an answer, translate the memory with a third desk . The memory then slides to the next box and the same desks run again. It starts blank (), and after a sentence we wipe it clean. The one flaw: reusing across a long chain makes signals fade or explode — which is the doorway to LSTMs, GRUs and attention.
Recall Quick self-check
Why is the in not a power? ::: It is a label meaning "at time step ", not exponentiation. What is set to and why? ::: The zero vector — the scratch-pad is blank before any input arrives. Which two ingredients build ? ::: The previous memory and the current input . Why rather than sigmoid? ::: is zero-centred (range to ), so memory can hold negative facts, and it stays bounded. Why the same weights every step? ::: Fixed parameters handle any length, and the sequence's rules shouldn't change with position.
See also: Backpropagation Through Time (BPTT) · Vanishing and Exploding Gradients · Long Short-Term Memory (LSTM) · Gated Recurrent Unit (GRU) · Word Embeddings · Sequence-to-Sequence Models