A transformer writes text one token at a time. Each token becomes a vector and passes through a stack of layers, where attention scores it against every earlier token, and the last layer picks the next token, which goes back in. The memory it must keep grows with the length of the context.
An analogy
A loom house: each new thread is woven against all the cloth made so far, floor after floor, and then one more thread is chosen and fed in at the bottom. The tally shelf for old threads gets longer with the cloth, and a long cloth fills the shelf first.
In this corpus a transformer is the loop behind every token a model writes: text is cut into tokens, embedded, and put through a stack of layers whose attention scores each token against all earlier ones, then one new token is chosen and goes back in. The sources are about its costs (quadratic attention, the key-value shelf that grows per token) and its fixes (fused norms, grouped heads, sparse blocks, cache compression), and one bug a speed-up exposed.
The token cutter and the embedding vat
Text enters the model as tokens and leaves this room as vectors. In the sources the pipeline is plain: cut the text into tokens (about a word each), turn each token into an embedding, send the embeddings into the stack of layers. A vision transformer does the same with image patches plus a learned position.
The token cutter splits the input text into tokens, about one per word.
The embedding vat turns each token into a vector the layers can work on.
16 by 16
Patch size of the original vision transformer: the image is cut into patches this size before they become tokens (reported by a Roboflow talk) Isaac Robinson
The inference pipeline starts by converting the input text into tokens; for simplicity the speakers treat one word as one token. Harshul Jain
The tokens are then converted into embeddings, and the embeddings are sent into the transformer layers. Harshul Jain
A vision transformer feeds its stack the same way: the image is split into patches (16 by 16 in the original) and a learned positional encoding is added before the transformer. Isaac Robinson
One layer, run 32 times
Each layer holds a normalization step, an attention step and a feed-forward step, and the token goes round the stack once per layer. Attention is the costly step: each token is scored against every earlier token, so cost grows with the square of the context and the keys and values of earlier tokens must be kept. Sources show fixes for each cost (fused norms, tiling, grouped heads, sparse blocks) and one bug that a speed-up exposed.
The key-value shelf keeps each token's keys and values beside those of all earlier tokens.
The attention loom scores each token against all earlier tokens and weaves what it reads.
The feed-forward press passes each token through the layer's feed-forward block, then the next layer starts.
32 layers
Transformer layers in the 7B model used in the inference workshop (varies by model) Harshul Jain
95% of compute
Share of inference compute taken by the transformer layers, as stated in the workshop Harshul Jain
131 KB per token
Key-value memory per token for the 7B model in the workshop (two vectors of 128 dimensions, times 32 layers, times the key-value heads) Harshul Jain
half a GB at 4K tokens
Key-value memory of one request at 4K context in the workshop; about 2.1 GB at 16K Harshul Jain
4x
Key-value compression when 8 key-value heads replace 32 (grouped-query attention), as computed in the workshop Harshul Jain
33 starts
Times the RMSNorm can be started in one decode step in the talk (model dependent) Filip Makraduli
5 million tokens
Context length trained on one eight-H100 node with the UPipe technique Max Ryabinin
half the query heads
Query heads active per token in Grouped Query Experts while matching the all-active baseline (250M scale, 30B tokens) Hugging Face
O(N log N)
Attention cost of PISA block selection, against quadratic for scoring all query-block pairs Hugging Face
0.401 to 0.000
ROUGE-L of Qwen3-8B on a non-literal retrieval benchmark after ablating the top 50 heads found by LOCOS Hugging Face
Inside each transformer layer sit a normalization layer, an attention layer and a feed-forward layer. Harshul Jain
Attention is the most compute-intensive of the layers, so the speakers examine it first. Harshul Jain
Attention finds the score of every token against all previous tokens, which needs every token projected into a query, a key and a value. Harshul Jain
When it breaksThe word that came out one step late. To save time, the norm and the matrix multiply were run on two GPU streams. The join of the two streams was left implicit, so the final scale sometimes read an old buffer. Unit tests and perplexity looked fine; in long generations the model repeated a word one step late. Filip Makraduli
Open questionShould locality be built into attention, or learned by pretraining?
Build a locality bias into attention with shifted windows, as a convolution has. Isaac Robinson
Strip the biases out of the model and let pretraining learn them back. Isaac Robinson
The chooser and the shelf of keys and values
The last layer's output becomes one new token, and that token goes back in as input, so the model runs once per token. The first pass over the prompt (prefill) is compute-bound; each later step (decode) is memory-bound and leans on the cache of earlier keys and values, which is the thing that grows and has to be shrunk or trimmed.
The next-token chooser turns the last layer's output into one new token, which goes back in as input.
4x near-lossless
Value-cache compression from predicting values from keys in LowRAM Hugging Face
26.9x at 94.5%
LowRAM compression combined with quantization and eviction, and the share of baseline performance kept on long contexts Hugging Face
32-43% more
Throughput of random eviction over the strongest score-based evictor in vLLM Hugging Face
14x
Cache saving of multi-head latent attention over multi-head attention, corrected in the workshop from an earlier 56x Harshul Jain
A new token is generated, goes back into the input, and the next one is generated, again and again. Harshul Jain
Prefill builds the key and value vectors for every input token and computes their attention scores; it is compute-bound, and its duration is the time to first token. Harshul Jain
In decode only the new token needs attention math, so decode is memory-bound; the time of each step is the inter-token latency. Harshul Jain
Open questionDoes the key-value cache need a score to decide what to evict?
Yes: score each cached token for how much it will matter later and keep the top ones. Hugging Face
No: the selection signal contributes almost nothing; keep the prompt and evict at random. Hugging Face
Mixture of ExpertsModels where a router sends each token to a few specialist sub-networks.
Efficient AttentionAttention variants that scale better with length (sparse, linear, latent).
State Space ModelsRecurrent-style architectures (Mamba, RWKV) with constant memory per token.
Diffusion Language ModelsText models that refine a whole draft in parallel steps instead of writing left to right.
Small Language ModelsCompact models that are cheap to run and good enough for many tasks.
Looped TransformersTransformers that run a block of weight-shared layers several times per token, adding depth (more reasoning per token) without adding parameters; shipped in Inkling 2 Mini and GLM-5.4 in Nov 2026.
Decision Models (System One)Small 'System One' models that only decide, classify, route or score with typed outputs instead of writing text; cheap, fast building blocks inside agent systems (Jev, OpenAI Decisions API).