Tuesday, July 07, 2026

infographics: AI LLM token pipeline

 Post | Feed | LinkedIn

Most people think that's magic. It's a pipeline. Here's every stage:

→ 𝗧𝗼𝗸𝗲𝗻𝗶𝘇𝗲𝗿 — your words become integer IDs. "gravity" → ["grav", "ity"]. LLMs never see letters. That's why they can't count them.

→ 𝗘𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀 — each token ID becomes a 4096-dim vector. Language becomes geometry.

→ 𝗧𝗿𝗮𝗻𝘀𝗳𝗼𝗿𝗺𝗲𝗿 𝗕𝗹𝗼𝗰𝗸𝘀 — Self-Attention + Feed-Forward, repeated 96+ times. Every pass, the representation deepens.

→ 𝗞𝗩 𝗖𝗮𝗰𝗵𝗲 — prior token Keys and Values are cached so the model doesn't recompute them every step. Without this, inference is impossibly slow. The catch: it scales linearly with context length.

→ 𝗦𝗮𝗺𝗽𝗹𝗶𝗻𝗴 — the model outputs a probability distribution over 128K+ tokens. Greedy, Top-K, Top-P, Temperature — how you sample changes everything.

→ 𝗦𝗽𝗲𝗰𝘂𝗹𝗮𝘁𝗶𝘃𝗲 𝗗𝗲𝗰𝗼𝗱𝗶𝗻𝗴 — a small draft model guesses 4-5 tokens ahead. The large model verifies in one pass. 5 tokens for the cost of 1.

→ 𝗦𝘁𝗿𝗲𝗮𝗺𝗶𝗻𝗴 — token IDs map back to text and stream to your screen. That typing effect isn't UI animation. That's the architecture.