These notes walk through how a small pretrained language model becomes a reasoning model: first by spending more compute at generation time, then by training against a verifier, then by imitating a stronger teacher’s traces.

They follow the chapter order of Sebastian Raschka, Build a Reasoning Model (From Scratch) (Manning, 2025, ISBN 9781633434677). The prose, figures, and exercises here are written for this site. Implementations and exercise notebooks are in the official repository. The running example throughout is the Qwen3 0.6B base model.

Course notes

  1. 01 Understanding reasoning models
  2. 02 Generating text
  3. 03 Evaluating reasoning models
  4. 04 Inference-time scaling
  5. 05 Self-refinement
  6. 06 Reinforcement learning with GRPO
  7. 07 Improving GRPO
  8. 08 Distillation
  9. 09 The Qwen3 base model
  10. 10 Other evaluation methods

Problem sets

Worked problems sit next to each chapter: the homework index.

Further code

The main path is chapters 1–8. Three appendices in the repository are useful once that path is familiar, and they are not written out as modules here:

References and further reading for each chapter are collected in the book’s appendix A and on the repository README.