Raw capture โ raw/gustafson-llm-stack-series.md
url: https://thegustafson.com/series title: Holding the LLM Stack in Your Head author: Nick Gustafson date_fetched: 2026-07-21 date_published: unknown
A dependency-ordered walk through the modern LLM stack, "from the linear algebra under a single attention head" through training, inference, and agent protocols expected in 2026. Spans ten arcs and "eighty-odd posts." The stated goal: "it's intuition that survives contact with real systems."
The author notes this was written "as a learning exercise, in collaboration with AI (Claude Opus 4.8)." He describes it as "me thinking out loud with a model to understand the stack end to end" โ not an authoritative reference โ and advises readers to "take it with a grain of salt" and double-check anything they rely on.
Path 1: Understanding Attention โ The minimum path to really seeing how a transformer layer works: Vectors/Matrices โ Self-Attention: Q, K, V from First Principles โ Multi-Head Attention and Representation Subspaces.
Path 2: Why Inference Is Slow โ From the one-new-row insight through KV cache and the systems built around it: Prefill vs. Decode โ Why One New Token Means One New Row โ The KV Cache from First Principles โ PagedAttention: Virtual Memory for the KV Cache.
Path 3: Building with RAG โ Just enough retrieval theory to make engineering decisions make sense: Embeddings from Scratch (Word2Vec to E5) โ Chunking Strategies โ Rerankers and Cross-Encoders โ RAG Architectures End to End.
Path 4: Building Agents โ The loop, the protocol, the transcript formats, and what the model actually sees: A Short History of Agents (ReAct to 2026) โ Function Calling as Structured Generation โ The Agent Loop: Model, Runtime, Tool, Resume โ MCP: A Cross-System Standard for Tool Integration.
"The series is a full first draft" โ the author will be "grinding through polish, corrections, and the odd rewrite."
Quote: Asimov โ "The most exciting phrase in science is not 'Eureka!' but 'That's funny...'"