A fully-disclosed cartoon · every token ID is real

How an AI answers “Why are pickles wiggly?”

Eight panels, one brine-soaked question, zero hand-waving: the tokenizer is named, the IDs are genuine, and the parts we invented are labeled.

Decoder ring (every term below, one line each)

token
a chunk of text — a word, a word-piece, or punctuation. The unit the model actually reads and writes
tokenizer
the program that cuts text into tokens and swaps each for a number
BPE
Byte-Pair Encoding — the rule for choosing the cuts: repeatedly merge the most common pair of pieces
token ID
the integer standing for one token — a row number, nothing more
vocabulary
the fixed list of every token the model knows (GPT-2: 50,257)
embedding
the long list of numbers (a vector) stored for each token ID — its meaning, as the model holds it
parameter /
weight
one learned number inside the model; billions of them make it up
layer / block
one repeated stage of the model; dozens stack to make the whole
attention
the step where each token looks at earlier tokens and pulls in what’s relevant
MLP
= FFN
Multi-Layer Perceptron — also called the FFN (Feed-Forward Network); same thing. The half of a layer applied to each token by itself: two matrix multiplies with a squashing function between. Where most stored knowledge lives (~⅔ of all parameters)
logits
the model’s raw score for every token in the vocabulary — one guess per possible next token
softmax
turns those raw scores into probabilities that add up to 1
sampling
picking one token from those probabilities — the model’s only real “choice”
decode loop
score → pick → append → run again. One lap per token generated
KV cache
saved attention values from earlier tokens, so each lap only computes the newest one
EOT
end-of-text — the special token that means “stop” (GPT-2: ID 50256)
harness
the ordinary (non-AI) program wrapped around the model: it runs the loop and executes tools
tool call
text the model emits in an agreed format, requesting an action. The harness does it
context
everything re-fed to the model this lap — the only “memory” it has
fine-tuning
SFT · DPO · distill
ways of changing the weights afterward: copy good answers (SFT), prefer one answer over another (DPO), or shrink a big model into a small one (distillation)

Everything below is these nineteen words in motion. If a panel loses you, the term is up here.

1 The Question

Why are pickles wiggly?

A human types 23 characters of English. The model cannot read English — or characters. First stop: the slicer.

2 The Slicer (the tokenizer)

Why are pickles wiggly? BPE SLICER · gpt2 Why ·are ·pick les ·w igg ly ? the model never sees the words “pickles” or “wiggly” — only slices!

Full disclosure — the tokenizer: OpenAI’s GPT-2 byte-level BPE (the open, inspectable gpt2 encoding in tiktoken), vocabulary 50,257 entries. We ran it for real. The 23 characters become exactly 8 tokens (a leading · marks “starts with a space”):

Why5195 ·are389 ·pick2298 les829 ·w266 igg6950 ly306 ?30

state of the query: [5195, 389, 2298, 829, 266, 6950, 306, 30] — text is gone; this integer list is all that continues down the pipe. (Modern OSS models use the same kind of tokenizer with bigger vocabs — e.g. cl100k slices this same sentence into 8 different IDs: 10445, 527, 3820, 645, 289, 20831, 398, 30.)

3 Jars of Numbers (embeddings)

2298 +0.031 −1.204 +0.887 ⋮ ×4096 one jar per token, 8 jars total … ×8

Each ID is a row number in the model’s embedding table: ID 2298 fetches row 2298 — a learned vector of ~4,096 numbers (in a modern open-source model; 768 in original GPT-2). Position info is mixed in so “pickles wiggle” ≠ “wiggle pickles”. The 8 IDs are now an 8 × 4096 grid of numbers. Nothing else enters the model. (Vector values shown are illustrative; the lookup mechanism is exact.)

4 The Brine Tank (the model itself)

block 1: attention + MLP block 2: attention + MLP block N: attention + MLP ×32–90 blocks, billions of weights attention: every jar peeks at every earlier jar MLP: each jar gets squeezed & refilled, solo

Full disclosure — the model: a decoder-only transformer (the architecture of GPT-2 and of today’s open-source flagships — Llama-class dense models and DeepSeek-class MoE). It does exactly one job: predict a score for the next token. Each block does two moves — attention (each token’s vector looks at all previous tokens’ vectors and blends in what’s relevant: “igg” discovers it belongs to w-igg-ly, which leans on pick-les) and an MLP (a per-token transform where stored knowledge — cucumbers, brine, turgor — gets stirred in). After the last block, the final position’s vector is multiplied against the vocabulary table one last time, producing 50,257 scores (logits): one per possible next token.

5 The Taste-Test Loop (iterative decoding — one token per lap)

Generation is a loop: score all 50,257 candidates → softmax into probabilities → sample one → append its ID to the state → run the tank again. The token state grows by one each lap; a KV cache keeps the old jars so each lap only computes the newest token. (The candidate words & probabilities below are illustrative; every (token, ID) pair is a genuine gpt2 vocab entry we verified.)

laptoken state going in (IDs)top candidates (illustrative p)sampled
1[5195 … 30] (the 8 prompt IDs) ·Pick 12346 .41 · ·Because 4362 .22 · ·They 1119 .11·Pick (12346)
2[5195 … 30, 12346] les 829 .93 · le 293 .03les (829)
3[5195 … 30, 12346, 829] ·w 266 .55 · ·are 389 .18 · ·stay .09·w (266)
…·iggle (24082), ·because (780), ·they (484), ·are (389), ·mostly (4632), ·water (1660), . (13)…

Loop ends when the model samples an end-of-text token (gpt2 ID 50256) or hits a length cap. Final answer state:

answer as tokens: [12346, 829, 266, 24082, 780, 484, 389, 4632, 1660, 13] — still just integers. No English yet!

6 Un-slicing (back to English)

12346 829 SAME SLICER in reverse ↩ “Pickles wiggle because they are mostly water.”

Is it the same tokenizer? Yes — necessarily. The IDs only mean anything relative to one vocabulary table, so decode uses the same gpt2 vocabulary, run in the easy direction: ID → stored bytes → UTF-8 text, then concatenate. Encoding needs the clever merge rules; decoding is a pure table lookup. 12346→“·Pick”, 829→“les”, … glued into “Pickles wiggle because they are mostly water.” Same jar, lid on, lid off.

8 The Same Question, Agent-Style (and why it wasn’t worth it)

0 s ~4.3 s wall-clock GPU lap 1 “check a real source” CPU + network: web search 2.4 s — GPU idle GPU lap 2 “compute it” CPU: run python 0.8 s — GPU idle GPU lap 3 compose grounded answer context re-fed each lap, and it GROWS: …which is why prefix caching (panel 5’s ~100× TTFT saving) is an agent’s best friend plain model (panels 1–6): ~1 s, one GPU visit agent: ~4.3 s, 3 visits

Where the agent actually lives. Not on a new chip — it is a control loop that runs on the CPU and rents the GPU by the lap:

part of the agentlives onshare of wall-clock
assemble context, parse the tool call, permissions, the loopCPUsmall, continuous
forward passes (panels 3–5)GPU — often someone else’s, over the networkmodest
running the tool (search, python, tests)CPU + I/Ousually dominant
waitingnothing at allthe biggest block
its “memory”context — text, not silicon

And the honest verdict for this question: the agent bought nothing. The model already knew pickles are mostly water — the loop cost ~3× the tokens and ~4× the wall-clock to reach the same sentence. Agents earn their keep only when the answer requires doing something — checking a live source, running code, editing a file, verifying against a test. Same discipline as the router in panel 5: don’t escalate when one forward pass suffices.

the shape, not the stopwatch: lap timings here are illustrative of typical tool waits; the mechanism (3 GPU visits, growing re-fed context, CPU-resident loop) is exact. Measured agent traffic on our own harness shows the same signature — a GPU that is barely stressed while the agent works flat out.

🥒 Can those token choices help retune the model?

Yes — the choices retune the model’s weights (they’re some of the best signals we have):

① Confidence mining. Every sampled token carries its probability. Long low-confidence stretches (lap 3’s 0.55) flag exactly where the model is unsure — harvest those prompts as fine-tuning data.

② Preference pairs. The sampled path vs the runner-up path (“·Pick…” vs “·Because…”) is precisely the chosen/rejected pair that DPO / RLHF trains on: humans rank the two answers, and the gradient pushes probability toward the preferred token choices.

③ Distillation. The full 50,257-way distribution at each lap (not just the winner) is a teacher signal — a student model trained to match it inherits the behavior cheaply.

But not the tokenizer itself — with a caveat. Seeing pick+les and w+igg+ly repeatedly is evidence a bigger vocab could slice cheaper (fewer tokens = fewer laps = lower cost). That, however, changes every row-number in the embedding table, so you can’t “patch it in”: tokenizer changes mean retraining the embedding layer (or the model). In practice: tune weights freely from token signals; treat the tokenizer as frozen until the next big (re)train.

7 The Agent Loop (when the answer machine gets hands)

1 · ASSEMBLE CONTEXT rules + tools + history 2 · SLICER same gpt2 BPE 3 · BRINE TANK emits tokens only {"tool":"Bash", "cmd":"poke_pickle"} 4 · a “tool call” is just formatted tokens 5 · HARNESS EXECUTES real code, real world 6 · result appended… 7 · go to 1. exit: final answer or budget cap

An agent is not a new kind of model — it is the same brine tank inside a plain while-loop. Each lap: the harness pastes together rules + tool catalog + history (all text), the same slicer tokenizes it, the tank emits tokens that merely describe a tool call, and the harness — ordinary non-AI code — actually runs it and pastes the result back in. The model proposes; the harness disposes.

Can: anything its tools reach — run code, read the failure, fix, rerun (self-correction against ground truth). Cannot: execute anything itself, remember beyond the re-fed context, learn mid-session (weights frozen), or verify itself without an external check — its confidence is a token probability, not a proof.