Free module
How language models are trained
Learn how language models are trained hands on: pretraining, instruction tuning, reward models and RLHF, DPO, reasoning models and benchmark contamination.
The lessons
Each lesson is free and interactive. Press Start lab to run its commands in a live lab and to sit its quizzes and tasks, with no account needed.
1 · Container lab
Pretraining a language model
I can read a pretraining loss curve and say when a model stops getting better.
Read the lesson2 · Container lab
Instruction tuning with a loss mask
I can turn question and answer pairs into training examples with a loss mask.
Read the lesson3 · Container lab
Reward models and RLHF
I can fit a reward model to votes between pairs of answers.
Read the lesson4 · Container lab
Direct preference optimisation by hand
I can work out the DPO loss for a preference pair by hand.
Read the lesson5 · Container lab
How reasoning models are trained
I can use a checked reward to explain how a model learns to work before it answers.
Read the lesson6 · Container lab
Benchmarks and contamination
I can check a benchmark for contamination with n-gram overlap.
Read the lesson
Worked in a real lab
Every lesson of this module is worked in a lab started for you alone. The labs it uses:
Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.