Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Build a Reasoning Model (From Scratch)
Purchase options and add-ons
"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 story: 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 strength: 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
- ISBN-101633434672
- ISBN-13978-1633434677
- PublisherManning
- Publication dateAugust 11, 2026
- LanguageEnglish
- Dimensions7.38 x 1 x 9.25 inches
- Print length440 pages
Frequently bought together

Customers who viewed this item also viewed
- Build a Large Language Model (From Scratch)PaperbackFREE Shipping by AmazonGet it as soon as Sunday, Sep 20
- Domain-Specific Small Language Models: Efficient AI for local deploymentPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- Sutskever's List: Foundational ideas of modern AIPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- Reinforcement Learning from Human Feedback: LLM alignment and post-trainingNathan LambertPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- Build an AI Agent (From Scratch): Agents that reason, plan, and act autonomouslyJungjun HurPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- Knowledge Graphs and LLMs in Action: Build AI systems using connected dataPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
Customers also bought or read
- Reinforcement Learning from Human Feedback: LLM alignment and post-training
Just releasedPaperback$59.99$59.99FREE delivery Mon, Sep 21 - Domain-Specific Small Language Models: Efficient AI for local deployment
Paperback$41.51$41.51FREE delivery Mon, Sep 21 - Build a Large Language Model (From Scratch)#1 Best SellerComputer Neural Networks
Paperback$49.24$49.24FREE delivery Sun, Sep 20 - Knowledge Graphs and LLMs in Action: Build AI systems using connected data
Paperback$55.99$55.99FREE delivery Mon, Sep 21 - AI Agents in Action, Second Edition: Intelligent workflows with LLMs, MCP, A2A, and more#1 New ReleaseNatural Language Processing
Paperback$47.48$47.48FREE delivery Mon, Sep 21 - Sutskever's List: Foundational ideas of modern AI#1 New ReleaseComputer Vision & Pattern Recognition
Paperback$49.99$49.99FREE delivery Mon, Sep 21 - AI Agents and Applications: With LangChain, LangGraph, and MCP
Paperback$51.69$51.69FREE delivery Mon, Sep 21 - AI Systems Performance Engineering: Optimizing Model Training and Inference Workloads with GPUs, CUDA, and PyTorch
Paperback$87.70$87.70FREE delivery Mon, Sep 21 - Deep Learning with PyTorch, Second Edition: Training and applying deep learning and generative AI models
Paperback$51.68$51.68FREE delivery Mon, Sep 21 - Design Multi-Agent AI Systems Using MCP and A2A: Engineer your own Python-based agentic AI framework with tool use, memory, and multi-agent workflows
Paperback$41.79$41.79FREE delivery Mon, Sep 21 - 50 ML Projects To Understand LLMs: Investigate transformer mechanisms through data analysis, visualization, and experimentation
Paperback$44.99$44.99FREE delivery Mon, Sep 21 - 30 Agents Every AI Engineer Must Build: Build production-ready agent systems using proven architectures and patterns
Paperback$41.79$41.79FREE delivery Mon, Sep 21 - Hands-On Large Language Models: Language Understanding and Generation
Paperback$37.68$37.68FREE delivery Mon, Sep 21 - Vision Language Models: Building VLMs with Hugging Face
Just releasedPaperback$70.87$70.87FREE delivery Sun, Sep 20 - Agentic Coding with Claude Code: The everyday developer's guide to agentic coding with Claude Code
Paperback$36.33$36.33FREE delivery Mon, Sep 21 - AI Engineering: Building Applications with Foundation Models#1 Best SellerEnterprise Applications
Paperback$52.40$52.40FREE delivery Sun, Sep 20 - Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents
Paperback$46.39$46.39FREE delivery Mon, Sep 21 - Building AI Agents with LLMs, RAG, and Knowledge Graphs: A practical guide to autonomous and modern AI agents
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - Agentic Architectural Patterns for Building Multi-Agent Systems: Proven design patterns and practices for GenAI, agents, RAG, LLMOps, and enterprise-scale AI systems
Paperback$44.99$44.99FREE delivery Sun, Sep 20 - Agentic Spec-Driven Development: A Practical Method for Using AI to Build Complete Specifications for Software, Products, and Knowledge Work
Paperback$39.95$39.95FREE delivery Mon, Sep 21 - Hands-On Machine Learning with Scikit-Learn and PyTorch: Concepts, Tools, and Techniques to Build Intelligent Systems
Paperback$77.72$77.72FREE delivery Mon, Sep 21 - Optimization: A Bootcamp for Machine Learning, Inverse Problems, and Control
Just releasedHardcover$63.86$63.86FREE delivery Sun, Sep 20 - Machine Learning for Trading: A disciplined workflow from research to live execution, with nine case studies and AI agents#1 New ReleaseComputer Neural Networks
Paperback$59.99$59.99FREE delivery Mon, Sep 21 - Distributed AI Systems: A practical guide to building scalable training, inference, and serving systems for production AI#1 New ReleaseMemory Management Algorithms
Paperback$36.99$36.99FREE delivery Mon, Sep 21 - An Illustrated Guide to AI Agents: Concepts and Code for Building Agents with LLMs, Tools, and Memory
PreorderPaperback$79.99$79.99 - The Mathematics of Large Language Models: Machine Learning Theory Made Readable: LLMs, Transformers, Diffusion, Neural Networks, Optimization, and ... (The Mathematics of Artificial Intelligence)
Just releasedPaperback$32.99$32.99Delivery Mon, Sep 21 - Machine Learning Q and AI: 30 Essential Questions and Answers on Machine Learning and AI
Paperback$35.99$35.99FREE delivery Sun, Sep 20 - Reinforcement Learning, second edition: An Introduction (Adaptive Computation and Machine Learning series)
Hardcover$80.48$80.48FREE delivery Sun, Sep 20
From the Publisher
"Distills the profound ideas in the clearest, most accessible way."
Byron Hsu, LMSYS
“Big. Dope. Great read, fun writing."
Chris Alexiuk, NVIDIA
“The gold standard for developers wanting to build at the cutting edge of AI."
Omar Sanseviero, Author of Hands-On Generative AI with Transformers and Diffusion Models
why this book?
Build a Reasoning Model (From Scratch) helps you understand modern reasoning-oriented LLMs by building their core techniques from scratch rather than treating them as black boxes.
The book gives practical experience with evaluation, inference-time scaling, self-consistency, self-refinement, reinforcement learning with verifiable rewards, GRPO, and distillation.
Readers who know Python and some machine learning will gain a clear, hands-on path from using a pretrained LLM to improving, training, and evaluating reasoning models.
about Manning
Manning helps developers and tech professionals stay ahead in a fast-moving industry with expert-led books, videos, and projects. Learning never stops, but it’s hard to keep up, so we focus on content that’s practical, clear, and trusted. As an independent publisher, we adapt quickly, from pioneering early-access books to offering DRM-free eBooks. Our series, like "In Action" and "In a Month of Lunches", reflect a commitment to making complex topics accessible.
Deep Learning with Python, Third Edition
|
AI Agents in Action
|
Build a Large Language Model (From Scratch)
|
LLMs in Production: From language models to successful products
|
Data Analysis with LLMs: Text, tables, images and sound (In Action)
|
Causal AI
|
|
|---|---|---|---|---|---|---|
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
Add to Cart
|
|
| Customer Reviews |
4.2 out of 5 stars 42
|
4.0 out of 5 stars 51
|
4.5 out of 5 stars 613
|
4.5 out of 5 stars 36
|
4.8 out of 5 stars 7
|
4.4 out of 5 stars 14
|
| Level of proficiency | Intermediate | Intermediate | Intermediate | Intermediate | Intermediate | Advanced |
| About the reader | For readers with intermediate Python skills. | For intermediate Python programmers. | Readers need intermediate Python skills and some knowledge of machine learning. | For data scientists and ML engineers. | For data scientists and data analysts. | For data scientists and machine learning engineers. |
| Special features | Includes liveBook with out built-in AI assistant. | Includes liveBook with out built-in AI assistant. | Includes liveBook with out built-in AI assistant. | Includes liveBook with out built-in AI assistant. | Includes liveBook with out built-in AI assistant. | Includes liveBook with out built-in AI assistant. |
| Pages | 648 | 344 | 368 | 456 | 232 | 520 |
Editorial Reviews
About the Author
Product details
- Publisher : Manning
- Publication date : August 11, 2026
- Language : English
- Print length : 440 pages
- ISBN-10 : 1633434672
- ISBN-13 : 978-1633434677
- Item Weight : 15.8 ounces
- Dimensions : 7.38 x 1 x 9.25 inches
- Best Sellers Rank: #9,252 in Books (See Top 100 in Books)
- #1 in Programming Algorithms
- #1 in Computer Algorithms
- #4 in Data Processing
- Customer Reviews:
About the author

Sebastian Raschka, PhD is an LLM Research Engineer with over a decade of experience in artificial intelligence. His work bridges academia and industry, including roles as senior engineering staff at an AI company and a statistics professor.
As an independent researcher and industry expert, Sebastian collaborates with companies on AI solutions and serves on the Open Source Advisory Board at University of Wisconsin–Madison.
Sebastian specializes in LLMs and the development of high-performance AI systems, with a deep focus on practical, code-driven implementations.















