CourseTransformers: From Attention to Trained, Served and Interpreted Models · Module 5: Building a Transformer from Scratch · part 39 of 111
Part 39 · Module 5: Building a Transformer from Scratch

Lesson 5: Testing a model, from cheapest check to costliest

25 min read·13 Oct 2026
Module 5 · Lesson 5 · About 55 minutes · Needs: Lessons 1 to 3 of this module (the dependence map, reference checks, the float32 softmax); Module 1's lab (the seed noise floor)

The situation

Sol 409 at Aurora Station. Kofi Mensah finishes his review of tinyformer/model.py and sets the lab's rule: every claim needs a test, and every comparison needs a seed noise floor. "Lessons 1 to 3 found bugs by hand. I want a file that finds them in seconds, every time anything changes."

The running example is row 0 of the copy task: 16 random tokens, the separator 0, the same 16 again.

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.