Jump to ratings and reviews
Rate this book

Build a Reasoning Model

Rate this book
Get the eBook free when you register your print book at Manning.

"An exceptional deep dive into the next frontier of AI.”
—Aman Chadha, Google

This book is a practical guide to understanding how modern reasoning-oriented LLMs work by building their core methods step by step. The book tells a clear engineering start with a conventional pre-trained LLM, learn how text generation works, build reliable evaluation tools, improve reasoning through inference-time methods, then move into training-based approaches such as reinforcement learning and distillation.

The progression is deliberate. Early chapters establish the baseline model and explain text generation, KV caching, and evaluation with math verifiers. The middle chapters show how reasoning can be improved without changing model weights, using chain-of-thought prompting, sampling, self-consistency, response scoring, and self-refinement. Later chapters move to changing the model itself through reinforcement learning with verifiable rewards, GRPO improvements, format rewards, and finally distillation from stronger reasoning models into smaller ones.

The book is especially useful because it implements the core methods from scratch rather than treating them as black-box library calls. Readers see how self-consistency, self-refinement, Best-of-N, and training-based methods actually work, including their cost and latency trade-offs. It also discusses common failure modes, including cases where refinement can make answers worse. Difficult concepts such as softmax, temperature, and top-p sampling are clarified with code-linked explanations and diagrams, and visual workflows make pipelines and scoring methods easier to follow.

Reading the book feels like following a guided technical build rather than a loose survey of AI topics. Each concept is introduced because the project now needs it. Diagrams, roadmaps, code listings, exercises, and repeated workflow summaries help readers stay oriented through advanced material. This structure reflects Sebastian Raschka’s professional explaining complex machine learning topics by making every detail concrete and showing exactly where each section fits in the larger story. He does not treat mechanisms like evaluation, log-probabilities, KL regularization, or distillation as isolated abstractions; he connects them to the goal of making reasoning models understandable and implementable.

Physically and organizationally, the book has eight chapters and seven substantial appendixes. That design keeps the main narrative focused while moving supporting material like references, exercise solutions, model source code, larger models, batching, evaluation alternatives, and chat interfaces into ordered appendixes. The result is a logically flowing book that remains hands-on, navigable, and technically deep without constantly interrupting the central build.

What's inside

• From-scratch implementations of core LLM reasoning improvements
• Verifier-based evaluation methods
• RL with automatic verifiers for mathematics tasks

About the reader

For readers who know Python and have some knowledge of machine learning.

About the author

Sebastian Raschka is an LLM Research Engineer with over a decade of experience. He is the author of the bestselling book Build a Large Language Model (From Scratch).

Table of Contents

1 Understanding reasoning models
2 Generating text with a pretrained LLM
3 Evaluating reasoning models
4 Improving reasoning with inference-time scaling
5 Inference-time scaling via self-refinement
6 Training reasoning models with reinforcement learning
7 Improving GRPO for reinforcement learning
8 Distilling reasoning models for efficient reasoning
A References and further reading
B Exercise solutions
C Qwen3 LLM source code
D Using larger LLMs
E Batching and throughput-oriented execution
F Common approaches to model evaluation
G Building a chat interface

440 pages, Paperback

Published August 11, 2026

Loading...
Loading...

About the author

Sebastian Raschka

36 books180 followers
Some of my greatest passions are "Data Science" and machine learning. I enjoy everything that involves working with data: The discovery of interesting patterns and coming up with insightful conclusions using techniques from the fields of data mining and machine learning for predictive modeling.

I am a big advocate of working in teams and the concept of "open source." In my opinion, it is a positive feedback loop: Sharing ideas and tools that are useful to others and getting constructive feedback that helps us learn!

A little bit more about myself: Currently, I am sharpening my analytical skills as a PhD candidate at Michigan State University where I am currently working on a highly efficient virtual screening software for computer-aided drug-discovery and a novel approach to protein ligand docking (among other projects). Basically, it is about the screening of a database of millions of 3-dimensional structures of chemical compounds in order to identifiy the ones that could potentially bind to specific protein receptors in order to trigger a biological response.

In my free-time I am also really fond of sports: Either playing soccer or tennis in the open air or building models for predictions. I always enjoy creative discussions, and I am happy to connect with people. Please feel free to contact me by email or in one of those many other networks!

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
24 (61%)
4 stars
11 (28%)
3 stars
3 (7%)
2 stars
1 (2%)
1 star
0 (0%)
Displaying 1 - 16 of 16 reviews
Profile Image for Özgür.
147 reviews3 followers
Want to Read
February 8, 2026
Sebastian's books are really the ones you should read if you learn by building...I am guessing they will be two in a small set of AI / LLM books that will stay current (at least longer than others) as they focus on the basics and building at a lower level which will require a algo innovation to be replaced by something newer than like others sharing the (hype) patterns of the day e.g. X10 prompt engineering books...
Profile Image for Christian Singer.
42 reviews2 followers
August 26, 2026
The successor to Build a Large Language Model examines the techniques used to turn a conventional LLM into a reasoning model. Reasoning models generally do not require a fundamentally different architecture. Instead, prompting or additional training encourages them to generate intermediate problem-solving steps before producing a final answer. These steps can resemble an articulated human reasoning process, although the model’s underlying mechanism remains probabilistic rather than equivalent to human reasoning.

At a high level, the book covers two families of methods. The first operates at inference time and does not modify the model’s weights. It includes techniques such as chain-of-thought prompting, self-consistency, and self-refinement, and occupies the first half of the book.

The second family relies on additional training. One approach is reinforcement learning with verifiable rewards, in which an automatically checkable task—such as a mathematics problem—provides the reward signal. Another is distillation, in which a larger and more capable teacher model generates answers and reasoning traces that are then used to fine-tune a smaller student model.

The implementations are deliberately small-scale and designed to remain accessible. Raschka uses a compact pretrained Qwen3 model and executable examples to demonstrate evaluation, inference-time scaling, GRPO, and distillation. Although these experiments are far smaller than industrial training runs, they illustrate principles used in the development of modern reasoning models. Much of the material can be explored on consumer hardware, although the training-oriented chapters benefit substantially from access to a GPU.

The book is intended for readers seeking a practical introduction to reasoning techniques. Rather than formal derivations and theorems, it primarily presents executable PyTorch code that shows the methods in action. Although Raschka states that detailed knowledge of LLM internals is not required, I found that such a background makes the material considerably easier to understand. For readers of the preceding volume, the book therefore feels like a natural continuation.

The book definitely made LLM reasoning less of a black-box for me and especially drove the point home that reasoning models aren't another class of models fundamentally different from normal LLMs.
3 reviews
September 14, 2026
Again a masterpiece from Sebastian Raschka

I already read Sebastian Raschka's book , asusual this book also has clear explanations , his style ( the way of explaining complex topics in simple english to make everyone understand with examples is really great ) . The book has code aswell so that you can run it and learn it . This is a must read for those who want to know and learn how reasoning models work and how to train one. This book will be helpful for all types of readers , that is the targeted audience is not just the one who already have knowledge in this field , those who are entirely new to AI can also read this and understand.
1 review
August 26, 2026
What fascinated me most about Sebastian Raschka's book is the pedagogical progression it follows and its attention to detail. It starts slowly, introducing how text generation works in LLMs with simple examples and reasoning models via prompt engineering. It guides you along so gradually that, almost without noticing, you find yourself working with GRPO and RLVR.

The examples run at a scale you can handle on a consumer GPU, no GPU cluster needed, and none would even help here, since what you're actually gaining from this book is an understanding of the modern concepts behind building LLMs.

This is a book to read without rushing, one to sit with and absorb. It's not a recipe book, and you won't find the latest production trick here. It has its own rhythm, and it's meant to be enjoyed.
4 reviews1 follower
August 12, 2026
Not a very technical read, figured this would be his LLM book with a fresh coat of paint. It’s not. You grab a small pre-trained model and bolt reasoning onto it bit by bit, and the thing that won me over is that he makes you build the eval stuff first, his a very good teacher and looking forward to more books from him.
2 reviews1 follower
September 6, 2026
This book is genuinely valuable if you're starting to explore how reasoning systems work. It’s important to note that it does not include modern research from 2024–2026 — simply because the author couldn’t incorporate developments that happened after writing. Still, if you're planning to build your first reasoning model, this book is essential.

The strongest parts of the book
• Reasoning Primitives The core of the book, and truly excellent. Observation, Transformation, Inference, Verification, and Explanation. Without these primitives, any reasoning system becomes monolithic and poorly modular.
• Verification Loops Another outstanding section. Verifying each reasoning step, detecting inconsistencies, preventing conclusions without data, and enabling self-correction.
• Modular Heuristics Clear, practical, and very well explained. Independent heuristics, specialized micro-agents, diagnostic composition, and system extensibility.

What you don’t need to read
If you're not training models or building datasets, you can safely skip:
Model training
Dataset building
RLHF, deployment, and parameter optimization

These sections are irrelevant if you're working with modular agent systems or runtime frameworks like Hermes.

What the book is missing (modern research 2024–2026)
To build state-of-the-art reasoning systems, you’ll need to complement the book with:
Meta-CoT (reasoning about reasoning)
Graph-of-Thought (GoT)
Modern agent frameworks: ReAct, Toolformer, AutoGen, CAMEL, Voyager, Reflexion, OpenAI Swarm
DSPy (declarative optimization of heuristics)
Personal additions for financial reasoning systems

If you're working with financial time series, you’ll also need: Rolling volatility, rolling drawdown, rolling correlations, DCC, and HMM/MSM — none of which are covered in the book.
1 review
October 25, 2026
Five stars, with chapters 6 to 8 as the high point.

I worked through the book, then spent a day running the chapter 3 and chapter 6 code on my Macs.

The idea is simple: rather than describe reasoning models, build one. You load a small pretrained Qwen3 in plain PyTorch, write a deterministic verifier and a MATH-500 benchmark, then measure three ways to improve the model on that same bench: inference-time scaling, reinforcement learning with GRPO written from scratch, and distillation. Using the same benchmark makes the comparison easy to follow.

The best part is the honesty. Raschka shows the KL term that collapses a run, the log-probability scoring that picks confident mistakes, the self-refinement method that loses to the previous chapter's self-consistency. Each failure gets explained.

What I missed: each experiment is run once, and some conclusions rest on gaps of one to three points with no error bars. Everything is maths. Nothing on quantization or serving. And "from scratch" needs a footnote: the model, tokenizer and KV cache come from the companion package, with their code in an appendix.

A tip for Mac readers: bfloat16 training gave me NaN gradients right away with PyTorch 2.10, while float32 ran clean.

I received a free review copy from Manning.
Profile Image for Priyatham Bollimpalli.
62 reviews11 followers
August 14, 2026
I received an advance copy of this book.

This is a practical, code-first introduction to how reasoning models are built and improved. It starts with a pre-trained open-source model, so it is not “from scratch” in the sense of training a model from nothing. Instead, it focuses on the parts that are more useful to learn hands-on: evaluation, inference-time techniques, reinforcement learning, and distillation. My favorite part is that each concept is tied to code. The book does not leave reasoning models as an abstract topic. Raschka is very good at explaining technical ideas clearly and practically, and that comes through here.

One limitation is that the book focuses heavily on mathematical reasoning. That works well because answers are easier to verify and experiments are easier to measure, but it also means there is less coverage of areas like tool use, agents, retrieval, real-world evaluation, and deployment.

Overall, I found this to be a useful technical book for readers who want to understand reasoning models by building the important pieces themselves.
1 review
September 19, 2026
"Build A Reasoning Model (From Scratch) by Sebastian Raschka is an excellent hands-on introduction to the development process that progresses technically into a modern reasoning model. Reasoning models are natural extensions to LLMs, making this book a great (but not required) companion to the Raschka's previous book, "Build A Large Language Model (From Scratch)". What I particularly like is the progression of the book itself, from pretrained LLM, through evaluation, inference-time techniques, reinforcement learning, and distillation. The real value is that the Raschka breaks the process into experiments that you can actually implement and understand. Most importantly, he breaks them into easily 'digestible' sizes that make logical sense and therefore don't distract from focusing on what is important technically. Clear and logical exposition and the working PyTorch code make this book an useful addition to the library of anyone who wishes to move beyond simple understanding of LLMs and reasoning models.
1 review
September 13, 2026
As a software engineer trying to understand modern AI systems beyond simply calling models through APIs, I found this book extremely valuable.

What I liked most is the “from scratch” approach. Instead of hiding concepts behind frameworks, the book explains the important building blocks and connects them directly to Python code. The progression from a base model to evaluation, inference-time reasoning, reinforcement learning, GRPO, and distillation makes the overall picture much easier to understand.

It also helped me see reasoning as an engineering problem with real trade-offs around accuracy, tokens, compute, latency, and evaluation—not as some mysterious capability of an LLM.

Some sections are quite technical and deserve careful reading, but that is part of the value. If you are comfortable with Python and want to understand reasoning models beyond the black-box API level, I highly recommend this book.
73 reviews
September 4, 2026
The book is a great follow-up to the first one about creating a Large Language Model from scratch. The explanations are clear and informative, making complex topics easier to understand. I think some knowledge about LLMs or completion of 1st book is required to get most out of it.

The only downside is that I hoped it would also cover tool use, agents and retrieval as part of reasoning training. Maybe these would be interesting topics for Sebastian's third book on LLMs. Overall, it's an excellent resource for deepening understanding of language models.
2 reviews1 follower
August 11, 2026
One of the most amazing books on LLMs. I really like its incremental approach, starting from scratch, explaining and coding each concept step by step, and gradually moving toward advanced topics.

If you are a beginner in LLMs and want to build a strong foundation in LLM reasoning with hands on tutorial, this book is for you.
1 review
August 24, 2026
I know Sebastian from his previous Build a Large Language Model (From Scratch) book and was really looking forward to this follow-up. It did not disappoint! He is a great writer and knows the kind of details only someone who actually builds these models can explain. I had a really positive experience reading it and walked away with a much deeper understanding.
245 reviews3 followers
August 11, 2026
I was the technical reviewer on this book. It is a really clear and easy to understand guide to the techniques to turn an LLM into a reasoning model.

The main surprise to me is how simple they are. The book is well laid out and each chapter flows well into the next.
6 reviews
October 11, 2026
Read this and Build a Large Language Model back-to-back and things are clicking in a way that they haven't before. I really enjoy his pedagogical style, and hope he continues writing more books!
1 review
November 27, 2026
It's an interesting book, but could have been condensed now to 20 pages or less. There is a lot of repetition and many diagrams that appear to be there just to fill up space.
Displaying 1 - 16 of 16 reviews