ModelsMLFine-Tuning

Build a Reasoning Model (From Scratch)

by Sebastian Raschka (Manning)

AdvancedBookPaid~440 pages, self-paced

Implement LLM reasoning from scratch in PyTorch—inference-time scaling, RL, and distillation.

Start LearningReviewed July 7, 2026

Overview

"Build a Reasoning Model (From Scratch)" by Sebastian Raschka (Manning, 2026), author of the bestselling "Build a Large Language Model (From Scratch)," teaches how modern reasoning LLMs actually work by implementing their core techniques by hand in Python and PyTorch rather than calling libraries. Starting from a conventional pretrained LLM, the book walks through how text generation works, then builds reliable evaluation tools using verifiable rewards and math verifiers, improves reasoning through inference-time methods (chain-of-thought prompting, sampling, self-consistency, self-refinement, Best-of-N, and response scoring), and moves into training-based approaches including reinforcement learning with automatic verifiers and GRPO, plus distillation from stronger reasoning models into smaller ones. It spans about 440 pages, and its from-scratch code examples run on a standard laptop (with optional cloud GPUs for faster training); complete source code is on GitHub. It is aimed at readers comfortable with Python and basic machine learning who want a deep, implementation-level understanding of the full reasoning-model development pipeline.

At a Glance

Topic
Models
Level
Advanced
Format
Book
Cost
Paid
Duration
~440 pages, self-paced
Provider
Sebastian Raschka (Manning)
Hands-on
Yes — code/exercises
Certificate
None

What You’ll Learn

  • Build reliable LLM evaluation tools using verifiable rewards and math verifiers
  • Improve reasoning with inference-time methods: chain-of-thought, sampling, self-consistency, self-refinement, Best-of-N
  • Apply reinforcement learning with automatic verifiers, including GRPO, from scratch
  • Distill reasoning capability from larger models into smaller ones
  • Understand the end-to-end reasoning-model development pipeline in PyTorch

Highlights

  • By Sebastian Raschka, author of 'Build a Large Language Model (From Scratch)'
  • From-scratch PyTorch implementations, not library wrappers
  • Runs on a standard laptop; full source code on GitHub
  • Covers the hot 2025-2026 reasoning stack: inference-time scaling, RL/GRPO, distillation

Who It’s For

Best For

  • AI/ML engineers who want an implementation-level grasp of reasoning LLMs
  • Practitioners building or fine-tuning reasoning models
  • Readers of 'Build a Large Language Model (From Scratch)' going deeper

Prerequisites

  • Comfortable with Python
  • Basic machine learning and PyTorch familiarity
  • Helpful: understanding of how LLMs are trained

FAQ

What is Build a Reasoning Model (From Scratch)?

A hands-on book, for engineers who know Python and some ML, that builds the core techniques behind reasoning LLMs from scratch in PyTorch. It starts from a pretrained model and works through evaluation, inference-time scaling, reinforcement learning, and distillation.

Is Build a Reasoning Model (From Scratch) free?

Build a Reasoning Model (From Scratch) is a paid resource.

What level is Build a Reasoning Model (From Scratch) for?

Build a Reasoning Model (From Scratch) is aimed at a advanced audience. Recommended background: Comfortable with Python, Basic machine learning and PyTorch familiarity, Helpful: understanding of how LLMs are trained.

How long does Build a Reasoning Model (From Scratch) take?

Expect roughly ~440 pages, self-paced. Most learners work through it at their own pace.

What will I learn from Build a Reasoning Model (From Scratch)?

You'll learn: Build reliable LLM evaluation tools using verifiable rewards and math verifiers; Improve reasoning with inference-time methods: chain-of-thought, sampling, self-consistency, self-refinement, Best-of-N; Apply reinforcement learning with automatic verifiers, including GRPO, from scratch; Distill reasoning capability from larger models into smaller ones; Understand the end-to-end reasoning-model development pipeline in PyTorch.

Topics

reasoning modelspytorchreinforcement learninggrpoinference-time scalingdistillation