Build A Reasoning Model (From Scratch)
Code for a book that teaches how AI "reasoning" models work by building a small one yourself.
- Your data
- Stays on your device
- Coding needed
- Developers only
- Cost
- Free
- Computer
- An ordinary computer is fine
Code for a book that teaches how AI "reasoning" models work by building a small one yourself.
This is the official code for Sebastian Raschka's book Build a Reasoning Model (From Scratch). Reasoning models are AI language models that work through a problem step by step before answering.
Chapter by chapter, you start from an existing open model (Qwen3) and add reasoning skills yourself: checking answers, spending more effort at answer time, training with reinforcement learning, and distillation (teaching a small model from a bigger one).
The README says the main chapters are designed to run on ordinary consumer computers. The book itself is sold separately.
Programmers and students who want to understand how modern reasoning AI works by coding it.
Developers only. You need Python and some coding experience to follow along. New to this? Start here.
Using Claude Code, Cursor or another AI coding assistant? Paste the prompt and it will walk you through the setup.New to this?