Contents
Eight sections. Thirty-two notes. One idea at a time.
Notes in grey have not been written yet. Sections one to three are the foundation and are best read in order; after that, go where your curiosity takes you. Every note has a practical you can do yourself.
do a practical to back the theory.
-
Opening
- 00Why this notebook exists
-
Section 1
What is actually happening when you type a question
- 01A model doesn't know things. It predicts what comes next.
- 02Tokens: why the model reads "strawberry" differently from you
- 03Why the same question gives different answers: temperature and sampling
- 04The model is a snapshot: training cutoffs
-
Section 2
Why it can be confidently wrong
- 05Hallucination is the same mechanism that makes the model useful
- 06Why a system that writes poetry struggles to multiply
- 07The confidence is in the prose, not in the knowledge
- 08Sycophancy: models tend to agree with you
-
Section 3
Context: the most important word nobody defines
- 09A context window is a whiteboard, not a memory
- 10Lost in the middle: where in a long document the model reads worst
- 11The system prompt: the instructions you never see
- 12The model is not the product
-
Section 4
Giving the model knowledge
- 13Retrieval: a closed-book exam versus an open-book one
- 14Embeddings: how a machine decides two sentences mean the same thing
- 15Fine-tuning changes how a model behaves far more than what it knows
- 16Retrieval, fine-tuning, or a longer prompt: what each is good at
-
Section 5
Agents: what changes when the model can act
- 17An agent is a loop: think, act, observe, repeat
- 18Why errors compound: 95% per step across ten steps is a coin flip
- 19Prompt injection: the security problem everyone outside security is ignoring
- 20Human-in-the-loop is a design decision, not a slogan
-
Section 6
How do you know it's working?
- 21"It looks good" is not evidence: what an eval actually is
- 22Building a twenty-question eval set
- 23Benchmarks: what they measure, why leaderboards leak
- 24The model under your product changed and nobody told you
-
Section 7
The economics of a token
- 25What inference actually costs, and why an answer is priced differently from a question
- 26Why reasoning models are slow
- 27Small models versus large: why bigger isn't always the answer
- 28What "open" actually means: weights, data, source
-
Section 8
How the model got its manners
- 29Pretraining versus post-training: where knowledge comes from, where behaviour comes from
- 30RLHF in plain language: why models sound the way they do
- 31Reasoning models: what happens in the "thinking", and what doesn't
- 32Why the model is better in English, and what that means for Indian languages
As a book
When sections are complete, their notes are gathered into parts of a book you can download from this notebook. Part One will cover sections one to three.