01

TOKENS → VECTORS

Words don't go into a neural network. Numbers do.

LIVE SIMULATIONSIM/01 · TOKENS → VECTORS
TOKENS 6 · SHOWING 8 OF 512 DIMS

Type a sentence, press run. Each column is one token's vector: height is magnitude, blue is positive, red is negative — 8 illustrative dimensions standing in for the real 512.

02

A SENSE OF ORDER

Attention has no idea what order words came in. This is how it finds out.

LIVE SIMULATIONSIM/02 · POSITIONAL ENCODING
POSITION 0 OF 16 · DIM 16
SEQUENCE LENGTH16
SHORTLONG
DIMENSIONS SHOWN16
FEWMANY

Exact values, not illustrative. Top: every position × dimension cell, coloured by value. Bottom: two dimensions unrolled as waves — low dimensions oscillate fast, high dimensions slow. The amber line scrubs through positions automatically.

03

QUERY, KEY, VALUE

Every token asks a question, offers an answer, and carries a payload.

LIVE SIMULATIONSIM/03 · CLICK A TOKEN TO QUERY IT
QUERYING cat

Click any token. Line thickness and the bars below are its softmax attention weight over every token, including itself. Turn scaling off to see why the paper insists on it.

04

MANY HEADS, ONE SENTENCE

Eight parallel conversations about the same six words.

LIVE SIMULATIONSIM/04 · MULTI-HEAD ATTENTION
HEAD 1 OF 4 SPOTLIGHTED
NUMBER OF HEADS h4
FEWERMORE (8 = PAPER'S BASE MODEL)

Each grid is one head's attention matrix over the same six-token sentence — row attends to column. Patterns here are hand-shaped archetypes (local, sink, diagonal…), not a trained checkpoint. Click a head to spotlight it.

05

STACK IT UP

Six of these layers, twice over — once reading, once writing.

LIVE SIMULATIONSIM/05 · ENCODER–DECODER STACK
N = 6 LAYERS PER STACK · WATCH THE PULSE CLIMB
LAYERS N6
SHALLOWPAPER'S N=6

Bottom to top is input to output. The amber pulse is data climbing the stack; the amber diagonal is cross-attention pulling from the encoder into every decoder layer; the green curves are residual skips.

06

ONE TOKEN AT A TIME

The whole stack runs again for every single word it writes.

LIVE SIMULATIONSIM/06 · AUTOREGRESSIVE GENERATION
GENERATED: the
TEMPERATURE0.70
SHARPFLAT

Watch it write, one token per step. The bars are the toy model's next-token distribution; the amber bar is what gets appended. A tiny hand-written lookup table stands in for real logits — the loop itself is exactly how generation works.

07

READ THE EQUATION

Six pieces, one line, most of modern AI.

TERM EXPLORERSELECT A TERM TO READ IT IN WORDS
· / )

Select a term above.

QQuery — a learned projection of the current token: "what am I looking for?"
KKey — a learned projection of every token: "what do I offer, if compared against?"
VValue — a learned projection of every token: "what do I actually contribute, if picked?"
dkDimension of the key/query vectors — 64 in the paper's base model, per head.
hNumber of parallel attention heads — 8 in the base model, 16 in the big model.
dmodelWidth of every token vector flowing through the network — 512 in the base model.

This single line, run 8 times in parallel per layer and stacked 6 layers deep, is most of what a Transformer does. Everything else — embeddings, positions, feed-forward layers, residuals — moves information into and out of this equation.

◈ BEHIND THE VISUALS

SIM/01 and SIM/03 use a deterministic pseudo-embedding — a sine function seeded by each word's characters — standing in for a real, learned 512-dimensional embedding table and learned Q/K/V projection matrices. The shapes are illustrative; no weights were trained.

SIM/02 plots the paper's exact sinusoidal positional-encoding formula, PE(pos,2i)=sin(pos/10000^(2i/d)), PE(pos,2i+1)=cos(pos/10000^(2i/d)) — that one is exact, not illustrative.

SIM/04's eight attention-pattern grids are hand-shaped archetypes (local, sink, diagonal, and similar patterns reported in interpretability studies of real trained models), not sampled from an actual checkpoint. SIM/05 draws the paper's stated layer count, sublayer order, and residual/cross-attention wiring exactly; the travelling pulse is a pacing device, not a measured signal. SIM/06 generates text from a tiny hand-written nine-word vocabulary and lookup table, not a trained language model — the mechanism (softmax over logits, temperature, greedy vs. sampling) is real, the "opinions" behind the numbers are invented.