01 section
Foundations
The mechanics under every later decision — tokens, attention, transformer blocks, embeddings, and the two-phase inference loop — explained at the depth a system designer needs
What is in here
Read these in order; each page assumes the one before it. Tokenization and attention pay off most often in interviews, and the inference pipeline page is the bridge into Inference Optimization. If you build with LLMs but have never opened the box, this section is what makes the rest of the guide concrete.
01
13 min
LLM Internals
The moving parts inside a transformer LLM — attention, feed-forward blocks, position encodings, MoE routing — and the scaling laws that set what any of it costs
fundamentalstransformersattention
02
11 min
Tokenization
Why BPE and SentencePiece decide your bill, your context limit, and why the model cannot count letters — plus how to estimate token counts reliably
fundamentalstokenizationcost
03
12 min
Attention Mechanisms
Scaled dot-product attention from the math up, then the variants that make long context affordable: GQA, FlashAttention, MLA, and KV cache reuse
transformersattentioninference
04
10 min
Transformer Architecture
How embeddings, blocks, normalization and the output head assemble into a working decoder-only model, and which knobs change as you scale parameters
fundamentalstransformersattention
05
11 min
Embeddings and Vector Spaces
What a vector actually encodes, which distance metric to use, and how Matryoshka truncation and binary quantization cut index size without wrecking recall
embeddingsretrievalchunking
06
11 min
Inference Pipeline
Prefill and decode, sampling and stopping, TTFT versus tokens-per-second — the mental model you need before tuning anything in a serving stack
inferencelatencyserving