01Chapter 1: Why language models need subword unitsThis chapter assumes that you can write basic Python with dictionaries, tuples, and loops. You should know that a language model reads a token, which is one unit of input such as a word or piece of a word, and that you can count item frequencies with collections.Counter.2 min read
02Chapter 2: Encoding new text with learned BPE mergesThis chapter assumes you know Python basics, what a token is, and how BPE merges are learned from a corpus. Here, you apply a learned merge list to new text, then compare how byte-level BPE, WordPiece, and the unigram model build and apply their vocabularies.1 min read
03Chapter 3: SentencePiece: tokenising raw text without pre-tokenisationThis chapter assumes you can write Python, know how BPE merges and WordPiece's ## prefix work, and understand that a model reads integer token IDs. You need the sentencepiece package and a plain-text file, corpus.txt, with one sentence per line.2 min read