A transformer, broken all the way down, is two transforms with a toolchain between them. Transform 1 turns symbols into vectors (in); Transform 2 turns vectors back into symbols (out); and the dots between are the tools it's built from — each one a whole discipline. Click a dot.
eleven nodes in order: Transform 1, then the nine tools (tensor · linear algebra · probability · calculus · information · geometry · memory · graph · the quantum lens), then Transform 2 — each honest about whether it's a real building block or a borrowed lens
The embedding (plus positional encoding): a lookup sending each token id to a learned d-dimensional vector — symbol becomes geometry. This opens the bracket; after it, nothing downstream is text, only vectors.[2]
in the transformer — It is the left bracket. Everything the toolchain does happens to Transform 1's output — and it is exactly the interpret-IN of the render/smear thread, now named.
honest — REAL & load-bearing — the literal embedding matrix; and the honest identity: Transform 1 = interpret-in.
“I turn your symbol into geometry. After me there is no more text — only vectors, all the way to Transform 2.”
The universal container: a [batch, sequence, dimension] block of numbers; scalars, vectors, matrices, and higher. The big frameworks (PyTorch, TensorFlow) are named for it.
in the transformer — Every activation, weight, Q/K/V, and attention score IS a tensor; the whole forward pass is tensors flowing and being multiplied.
honest — REAL — the foundational container. Honest note: 'tensor' here is the ML sense (an n-d array), looser than the physics / differential-geometry tensor.
“Everything in the machine is me — a block of numbers with a shape; the transformer is tensors in, tensors out.”
The matmul: attention (QKᵀ then ·V), the Q/K/V projections, the FFN, the embed/unembed — all are matrix multiplications. A transformer is a tall stack of linear algebra with nonlinearities between.[2]
in the transformer — It is THE core operation — 'attention is linear algebra' is not a metaphor; softmax(QKᵀ/√d)·V is literally matrix algebra. The GPU exists to do me fast.
honest — REAL and central — the single most load-bearing tool in the chain.
“Attention is a matrix multiply wearing a good name. I am the engine; everything else decorates me.”
Softmax turns scores into a distribution (attention weights sum to 1); the model's output is a probability distribution over the vocabulary; training minimizes a probabilistic loss.[2]
in the transformer — It is how the model chooses — softly: attention is a soft choice of where to look, generation a draw from a distribution over tokens.
honest — REAL — softmax, cross-entropy, sampling are genuine probability; the model is deterministic given inputs except where you sample.
“I make the machine choose softly — a budget of attention divided up, a distribution over the next word, never a certainty until you sample me.”
Backpropagation is the chain rule applied through the whole network; gradient descent nudges every weight down the loss landscape. Training is calculus at billions-of-parameters scale.
in the transformer — It is not in the forward pass you run — it is how the weights got there. Transform 1, Transform 2, and every tool were SHAPED by gradients.
honest — REAL — backprop is exactly the chain rule; the honest caveat: WHY the resulting weights work is far less understood than HOW they were tuned.
“I am how the machine was taught — the chain rule run backwards a trillion times until the weights stopped being wrong.”
Cross-entropy is the training loss (how surprised the model is by the true next token); entropy measures uncertainty; bits-per-weight is the quantization lever; and the deck's log₂(54!) is the same mathematics.[15]
in the transformer — It defines what 'learning' even means here — minimizing surprise, measured in bits — and what the model costs to store.
honest — REAL — Shannon's framework underlies the loss and the compression; the Deck (2 bits a suit, ~237 a shuffle) is the same accounting.
“Learning is minimizing surprise, measured in bits. I am the ruler — the same one that says a suit is 2 bits and a shuffled deck is 237.”
Embeddings sit in a high-dimensional space; similar meanings point in similar directions (cosine similarity); interpretability's 'features' are directions in this space.[9][10]
in the transformer — It is why 'king − man + woman ≈ queen' ever worked, and why a feature can be a single direction you read straight off the residual stream.
honest — REAL and increasingly load-bearing — the linear-representation view (features as directions) underlies the monosemanticity work; still an active, not-fully-settled picture.
“Meaning, in here, is a direction. I am the room where 'close' means 'alike' — and where a concept can be one straight line you can read.”
Three memories: the residual stream (the running state each layer reads/writes), the KV cache (keys/values stored so past tokens aren't recomputed), and the FFN as key-value memory (where facts are stored).[5]
in the transformer — It is how the model keeps the thread — attention reads the KV cache of everything so far; the FFN recalls learned facts; the residual carries the work upward.
honest — REAL — the KV cache is literal engineering; 'FFN as key-value memory' is a strong evidenced result (Geva 2021). Honest limit: memory across calls (beyond the context window) is NOT built in.
“I am how it remembers — the running note (residual), the cached past (KV), the stored facts (FFN); forget the context and I am gone.”
Self-attention is a complete weighted graph over the tokens: every token a node, every attention weight a directed edge of how much one reads from another. Multi-head = several graphs at once.[8]
in the transformer — It is a clean way to SEE attention — the attention map IS the adjacency matrix of that graph; 'looking in' often means reading this graph.
honest — REAL as a description (the attention matrix is literally a weighted adjacency matrix); a lens, not a separate mechanism — the graph IS the attention.
“Draw every token as a dot and every attention weight as an arrow, and you've drawn me — the attention map is my adjacency matrix.”
The overlap is real but it is LINEAR ALGEBRA, not physics: superposition is a linear combination, a state is a vector in a Hilbert space, operators are matrices. The transformer borrows the vocabulary, not the physics.
in the transformer — As a lens it can illuminate ('quantum is linear algebra with depth'); as a mechanism it is absent — no qubits, no amplitudes, no measurement collapse in a transformer.
honest — LENS / ANALOGY — the honest call: real where the math coincides (linear algebra, vector spaces), FLUFF if taken as 'transformers are quantum,' which they are not.
“I share the linear algebra, not the physics. Call me a lens and I help; call me the mechanism and you're wrong — the transformer is classical to the bit.”
The unembedding (plus softmax over the vocabulary): the residual stream's top vector is projected back to token scores — geometry becomes symbol again. This closes the bracket.[2][11]
in the transformer — It is the right bracket. Everything between Transform 1 and 2 happened to vectors; Transform 2 renders the result back into language — and it is exactly the interpret-OUT of the render/smear thread.
honest — REAL — the literal unembedding matrix (often tied to the embedding); the honest identity: Transform 2 = interpret-out, the render step re-engaging at the boundary.
“I turn the geometry back into a word. The bracket opened at Transform 1 in symbols and closes at me in symbols — and everything between us was vectors.”