Aadi Palnitkar Blog

Inside the Transformer - A Better Illustrated Transformer

This is a plain decoder-only transformer, the kind behind GPT-style language models, drawn with GPT-2 small's sizes. Scroll and a short sentence moves through it one stage at a time. Tap any part of the diagram, or a card further down, to go inside it: the tokenizer, the residual stream, every attention head with its QK and OV circuits, the MLP and the sampler.

Go inside any part

Notes