01Chapter 1: What a language model does: predicting the next tokenThis chapter assumes you can read basic Python, know what a probability distribution is (a set of non-negative numbers that sum to 1), and have a general idea of what a neural network is. No matrix math is needed yet.3 min read
02Chapter 2: Tokenization: turning text into subword tokensThis chapter assumes you can read basic Python and know that a language model predicts the next token from the tokens before it. Here you will see what a token is, why models use subwords, and how byte-pair encoding (BPE) builds a vocabulary.3 min read
03Chapter 3: Neural network basics: layers, weights, and learningThis chapter assumes you can read basic Python and NumPy, multiply matrices, and know what a probability distribution is. It covers the parts of neural networks that the rest of the tutorial reuses: layers, weights, nonlinearities, loss, and gradient descent.2 min read
04Chapter 4: Embeddings: representing tokens as vectorsThis chapter assumes you can read basic Python, multiply matrices, and recall that tokenization turns text into integer token IDs. It covers how those IDs become vectors the network can compute with.3 min read
06Chapter 6: Positional information: telling the model where tokens areThis chapter assumes you know what token embeddings are (vectors, one per token ID) and have seen the self-attention computation from the previous chapter. You should be comfortable with NumPy arrays and matrix multiplication.3 min read
07Chapter 7: The transformer block: attention, feed-forward layers, and residualsThis chapter assumes you can read basic Python and NumPy, multiply matrices, and understand that a neural network is a stack of layers with learned weights. You should also know how causal self-attention works from the previous chapter.2 min read
08Chapter 8: The full decoder-only model: from token IDs to next-token probabilitiesThis chapter assumes you know the earlier pieces: tokenization, embeddings, causal self-attention, positional information, and the transformer block (attention, feed-forward layer, residual connections). Here you will see how they fit together into one function. The function takes token IDs and retu2 min read
09Chapter 9: Pretraining: cross-entropy loss and gradient descentThis chapter assumes you can read basic Python, multiply matrices, and understand a probability distribution. It also assumes you know what a decoder-only model outputs: a vector of logits (raw scores), one per vocabulary entry, at every position.3 min read
10Chapter 10: Generating text: greedy decoding, temperature, and top-k samplingThis chapter assumes you know that a decoder-only model outputs one vector of logits (raw scores, one per vocabulary token) at each position, and that softmax turns logits into probabilities. You should also be comfortable reading short NumPy code.2 min read
11Chapter 11: Context windows and the key-value cacheThis chapter assumes you know causal self-attention (queries, keys, values, and the causal mask) and the decoding loop that produces one token at a time.3 min read
12Chapter 12: From base model to assistant: instruction tuning and preference tuningThis chapter assumes you know the pretraining objective (next-token cross-entropy), how a decoder-only model produces a probability distribution over tokens, and how sampling picks the next token. Here we cover what happens after pretraining to turn a text continuer into an assistant.3 min read
13Chapter 13: Scale: parameters, data, compute, and scaling lawsThis chapter assumes you know how a decoder-only transformer is built and how pretraining uses cross-entropy loss. It covers what "large" means in a large language model and how scale affects training.3 min read
14Chapter 14: Limitations: hallucination, knowledge cutoffs, and sensitivity to promptsThis chapter assumes you have read the earlier chapters on the next-token objective, decoding and sampling, and post-training. You should be comfortable reading short Python and thinking about probability distributions. Each limitation below follows from how the model is built and trained.3 min read