Five tokens enter, each as a row of dials: its embedding plus its position fingerprint. This row is the token's *residual stream*. It is the only thing that flows through the model. Every part you are about to see reads the stream, computes something, and adds the result back into it. Nothing ever replaces a row; it is only ever nudged.
The attention head from two explainers ago reads every row, lets each token gather from the ones before it (this model reads left to right, so nothing peeks ahead), and produces a correction per row. That correction is added to the stream. Attention is the only place where information crosses between tokens.
Next, every row goes on its own through a small two-layer network with a bend, the kind you met in module two, and the result is added back. No mixing here: each token is processed alone, but with a lot of dials. This is where most of a transformer's weights live, and where it seems to store what it knows.
Two small habits make the stack trainable. Adding rather than replacing means a token's original row is never lost, and blame can flow straight back down the stream during backpropagation without passing through every sub-block. Normalising each row afterwards, so its dials have mean zero and spread one, keeps the numbers from drifting as corrections pile up.
Attention, add-and-normalise, feed-forward, add-and-normalise: that is one *block*. Stack it. Each block reads the stream the previous one left and nudges it again, so tokens keep gathering context and reworking it. Slide the depth and watch the rows drift. Real models stack dozens of blocks, each with its own weights; this toy reuses one set.
After the last block, take the last token's row and compare it with every word's embedding: a dot product per word, then softmax. That is the next-token chart from three explainers ago. The whole stack exists to shape this one row so the chart is right, and the loss that trains every dial in every block is how surprised the chart was by the real next word.
Embed and stamp positions, run N blocks of attention and feed-forward on the residual stream, read the last row out as a chart: that is a *transformer* of the kind behind today's chat models. Nothing in it is new to you. What is new is scale: hundreds of dials per row become tens of thousands, one head becomes dozens per block, one block becomes a hundred, and the training loop runs over most of the written internet.
Two sub-blocks, two jobs.
The feed-forward runs on each row separately, the same small network applied five times with no view of the neighbours. Only attention computes weights across tokens and mixes their values. That split is the design: attention moves information between positions, the feed-forward processes it within a position.