No. 86 of 500 No. 9 in Generative AI & LLMs

Build a Reasoning Model (From Scratch)

By Sebastian Raschka

Print length
440 pages
Publisher
Manning
Reading level
Advanced
ISBN-13
978-1633434677
Published
August 11, 2026
Written for
ML engineers and researchers who want to implement and understand LLM reasoning techniques in code.

Synopsis

Sebastian Raschka's follow-up to Build a Large Language Model (From Scratch) tackles the techniques behind reasoning models, the systems that generate intermediate steps before giving an answer. Readers start with a small pre-trained open-weight model from the Qwen3 family, learn to generate text efficiently with KV caching, and build automatic evaluation using math verifiers. The middle chapters improve reasoning without changing any weights, implementing chain-of-thought prompting, sampling strategies, self-consistency voting, Best-of-N response scoring and self-refinement while measuring what each costs in compute and latency. The final chapters change the model itself through reinforcement learning with verifiable rewards using GRPO, refinements to that algorithm, format rewards and distillation from stronger reasoning models into smaller ones.

The method is the book's value. Rather than calling a library, Raschka writes each component in plain PyTorch, so readers see where techniques succeed, where they waste compute and where self-refinement can make answers worse. The main chapters are designed to run mostly on consumer hardware, and a public GitHub repository supplies code, exercise solutions and bonus scripts. Readers finish with working intuition for the post-training and test-time methods behind current reasoning models and a framework for reading new research in the area. The book assumes Python fluency and some machine learning background, ideally including the earlier volume, and it stays at teaching scale, so production serving and large-cluster training fall outside its scope.

Scorecard

Editorial score

How it scored

Editorial score: 82.1 / 1005 weighted criteria

  • Influence30%

    21.0/30
  • Authority25%

    21.3/25
  • Practical value20%

    18.0/20
  • Currency15%

    14.3/15
  • Readability10%

    7.5/10
  • Editorial score

    82.1/100

How the rank was computed

Rank No. 86 of 500 comes from a composite of 64.2: observable signals 27.2 of 55 points plus editorial review 37.0 of 45 points.

All 11 inputs
InputPoints
Observable signals27.2/55
Reach (Amazon ratings volume)7.1/16.5
Consensus across best-of lists8.3/13.8
Awards and bestseller evidence0.0/8.3
Reader rating, sample-adjusted7.0/8.3
Amazon sales rank2.0/5.5
Recency2.8/2.8
Editorial review37.0/45
Author authority9.6/11.3
Influence9.5/13.5
Practical value8.1/9.0
Readability3.4/4.5
Currency6.4/6.8

Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.

Verdict

A code-first route to understanding reasoning LLMs, implementing inference-time scaling, GRPO training and distillation step by step in PyTorch.

Strengths

  • Every core method implemented from scratch in PyTorch
  • Runs largely on consumer hardware
  • Explicit cost, latency and failure-mode analysis

Keep in mind

Assumes Python fluency and machine learning background; readers seeking production deployment guidance or a conceptual overview without code will find it too specialized.

Key takeaways

  1. Reasoning can improve without retraining by spending more compute at inference time, through sampling, self-consistency voting and Best-of-N selection.
  2. Reliable evaluation comes first, because automatic verifiers that check math answers make it possible to measure whether a technique actually helps.
  3. Reinforcement learning with verifiable rewards, implemented through GRPO, trains models to produce better reasoning chains when correctness can be checked automatically.
  4. Distillation transfers reasoning behavior from a strong model to a smaller one, trading some capability for much cheaper inference.

Notable facts

  • Its companion GitHub repository, rasbt/reasoning-from-scratch, showed about 5,900 stars and more than 900 forks in November 2026. Source (opens in a new tab)
  • Manning's listing carries endorsements from reviewers at Google, NVIDIA and LMSYS, including Google's Aman Chadha. Source (opens in a new tab)

About the author

Sebastian Raschka

Sebastian Raschka is an LLM research engineer with more than a decade in machine learning. He earned a PhD at Michigan State University, taught statistics as an assistant professor at the University of Wisconsin-Madison and later worked as a senior engineer at Lightning AI. He wrote Python Machine Learning and the bestselling Build a Large Language Model (From Scratch), and publishes the Ahead of AI newsletter.

Questions

Do I need to read Build a Large Language Model (From Scratch) first?
It helps but is not required. This book starts from a pre-trained Qwen3 model rather than building one, and it includes the model's source code in an appendix. Readers who already understand transformer architecture, tokenization and text generation can begin directly. Those new to the internals of LLMs will follow the reasoning chapters more easily after reading the earlier volume.
What hardware do I need for Build a Reasoning Model (From Scratch)?
The main chapters are designed to run mostly on consumer hardware within a reasonable time, and the code uses a GPU automatically when one is available. The early chapters on text generation, evaluation and inference-time scaling run on either a CPU or a GPU, while the author recommends a GPU for later chapters, including reinforcement learning, to replicate the published results.
Is Build a Reasoning Model (From Scratch) worth reading in 2026?
Yes, for engineers and researchers who want to understand reasoning models rather than only call them through an API. Published in 2026, it covers the methods behind current systems: inference-time scaling, reinforcement learning with verifiable rewards through GRPO, and distillation. Because it implements each method from scratch, the knowledge transfers to new models and papers as the field moves.

Sources

As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.