CourseTransformers: From Attention to Trained, Served and Interpreted Models · Module 8: Pretraining · part 57 of 111
Part 57 · Module 8: Pretraining

Lesson 1: The data pipeline, and comparing objectives fairly

29 min read·13 Oct 2026
Module 8 · Lesson 1 · About 50 minutes · Needs: Module 6, Lessons 1 and 4 (the proxy, train with loss_fn, data and monitor, the test split)

The situation

Sol 421 at Aurora Station. Lesson 2 will race eight pretraining objectives, and Kofi Mensah has set the terms first: "Before any race, show me the corpus, and show me the race is fair." He wants a corpus report, a trained tokeniser, and a comparison harness with seeds.

This lesson builds the pipeline from documents to batches, then the harness. The running example is document 0, the assignment sheet for sol 379, and its first row: "Bruno Ferreira works in the water plant on the coolant loop."

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.