01Chapter 1: Summarisation and translation as text-to-text problemsThis chapter assumes basic Python, familiarity with neural networks and loss functions, and a high-level understanding of Transformers and self-attention. You should also know that a token is a small piece of text, such as a word, part of a word, or punctuation mark.3 min read
02Chapter 2: How an encoder-decoder model worksAssume you know basic Python, neural-network training, PyTorch tensors, and the high-level idea of Transformer self-attention. This chapter focuses on the working model: how a source sequence becomes a target sequence in an encoder-decoder Transformer.3 min read
04Chapter 4: Tokenisation, special tokens and target textAssume you know basic Python, neural networks and loss functions, the Transformer self-attention mechanism, and the Hugging Face Transformers library. This chapter focuses on how text becomes model inputs and how the expected output becomes target labels.2 min read
05Chapter 5: Training with teacher forcing and the cross-entropy lossThis chapter assumes that you know basic Python, PyTorch tensors, neural-network loss functions, and the high-level structure of a Transformer. You should also know that an encoder reads the source sequence and a decoder produces the target sequence one token at a time.3 min read
06Chapter 6: Choosing a pretrained model: BART, T5, MarianMT and mBARTAssume you know basic Python, Transformer terminology, and how tokenisation and model generation work. This chapter focuses on choosing a pretrained encoder-decoder model rather than implementing the architecture.3 min read
07Chapter 7: Generating text: greedy search, beam search and length controlsThis chapter assumes you know Python, PyTorch tensors, and the basic Transformer encoder-decoder structure. You should also know that the decoder generates one token at a time, using the source representation and the tokens it has already produced.2 min read
08Chapter 8: Summarising text with an encoder-decoder modelThis chapter assumes that you know basic Python, understand tensors and loss functions, and have a high-level idea of Transformer self-attention. You should also be familiar with tokenisation and the Hugging Face Transformers library.2 min read
09Chapter 9: Translating text and selecting language pairsThis chapter assumes basic Python, neural-network training, Transformer self-attention, and PyTorch or Hugging Face Transformers. You will use an encoder-decoder model to translate a source sequence into a target sequence.3 min read
10Chapter 10: Summarising documents longer than the context windowThis chapter assumes that you know Python, basic PyTorch tensors, and the main parts of a Transformer. You should also understand tokenisation, sequence-to-sequence models, and autoregressive decoding.2 min read
11Chapter 11: Fine-tuning a model on your own dataAssume you know basic Python, PyTorch tensors, Transformer attention, and loss functions. You should also understand that an encoder-decoder model reads a source sequence and generates a target sequence one token at a time.2 min read
12Chapter 12: Measuring quality with ROUGE, BLEU and chrFThis chapter assumes that you know basic Python, tokenisation, and how an encoder-decoder model generates text. It also assumes that you have a prediction and one or more reference texts for each example.3 min read
13Chapter 13: Hallucination, repetition and other failure modesAssume you know basic Python, neural networks, loss functions, Transformer self-attention, and the Hugging Face Transformers library. This chapter focuses on diagnosing failures in encoder-decoder models rather than treating every poor output as a decoding problem.2 min read