Skip to content

The Series

Holding the LLM Stack in Your Head

A dependency-ordered walk through the modern LLM stack, from the linear algebra under a single attention head, through training and inference, out to tool use and agent protocols. Ten arcs, eighty-odd posts.

The ten arcs

Don't know where to start?

If you want to understand attention

Follow matrix operations into attention scores and multiple attention heads.

  1. 1Vectors, Matrices, and the Spaces They Live In
  2. 2Self-Attention: Q, K, V from First Principles
  3. 3Multi-Head Attention and Representation Subspaces

If you care about why inference is slow

Start from the one-new-row insight, then follow the KV cache and the systems built around it.

  1. 1Prefill vs. Decode: The Two Phases of Inference
  2. 2Why One New Token Means One New Row
  3. 3The KV Cache from First Principles
  4. 4PagedAttention: Virtual Memory for the KV Cache

If you're building with RAG

Follow embeddings, document chunks, and reranking into a retrieval pipeline.

  1. 1Embeddings from Scratch: From Word2Vec to E5
  2. 2Chunking Strategies
  3. 3Rerankers and Cross-Encoders
  4. 4RAG Architectures End to End

The series is a living document. If you spot something wrong, contact info is here.