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