01Chapter 1: Why language models need subword unitsThis chapter assumes that you know basic Python, dictionaries, tuples, loops, and frequency counting. You should also understand that a language model receives a sequence of tokens rather than an entire sentence at once.3 min read
03Chapter 3: Normalisation and pre-tokenisation before subword splittingThis chapter assumes basic Python, dictionaries, loops, frequency counts, and the idea that a token is an input unit for a language model. The goal is to understand the text transformations that happen before BPE, WordPiece, or unigram splitting.2 min read
05Chapter 5: Encoding new text with learned BPE mergesAssume you know basic Python, dictionaries, tuples, loops, token frequencies, and the idea of a token as a language model input unit. This chapter focuses on applying a learned Byte Pair Encoding (BPE) vocabulary to new text.2 min read
06Chapter 6: Byte-level BPE and why it never needs an unknown tokenThis chapter assumes that you know what a token is, can read basic Python, and understand that ordinary BPE learns frequent adjacent symbol pairs. Byte-level BPE applies the same merge idea to bytes rather than to pre-split words or Unicode characters.3 min read
08Chapter 8: WordPiece encoding with greedy longest match and ## prefixesWordPiece encoding converts a pre-tokenised word into vocabulary pieces. It assumes you know basic Python, dictionaries, loops, and token frequency counts. It also assumes that normalisation and pre-tokenisation have already happened. For example, a tokenizer may lowercase text and split punctuation2 min read
09Chapter 9: The unigram language model tokeniserThis chapter assumes that you know what tokens and vocabularies are, and that you can follow basic frequency calculations and Python loops. You should also understand that a word can be split into several subword pieces.2 min read
10Chapter 10: SentencePiece: tokenising raw text without pre-tokenisationSentencePiece is a subword tokeniser that learns directly from raw text. It does not require a separate word-splitting step. This chapter assumes basic Python, dictionaries, loops, token concepts, and frequency counts.2 min read
11Chapter 11: Special tokens, continuation markers, and whitespace markersThis chapter assumes basic Python, dictionaries, loops, and token frequencies. You should also know that a tokenizer converts text into tokens, and that a language model receives token IDs rather than raw strings.2 min read
12Chapter 12: Choosing a vocabulary sizeThis chapter assumes you know what tokens are and have basic Python, dictionaries, loops, and frequency counts. You should also know that BPE, WordPiece, and SentencePiece turn text into a sequence of vocabulary entries.2 min read
13Chapter 13: Pitfalls: multilingual text, numbers, and train/inference mismatchThis chapter assumes you understand tokens, subword vocabularies, BPE merges, WordPiece matching, and SentencePiece models. The focus here is operational: how tokenizer choices fail on real data and how to detect those failures.3 min read