The residual stream: the backbone of a transformer

The grid of token vectors that runs through a transformer, which every block reads from and adds to, ending in the next-token prediction.

This is the text of a chapter of the animated talk A Deep Seek into LLM Architecture by Ruben Galvão. Open the page with scripts on to play the slides, one key press per idea.

The input as a grid

The final layer

The residual stream

Only the last column is used