Project overview

AI-generated schematic: the course starts from a pretrained base model, then answer verification, inference-time scaling, GRPO reinforcement learning, and distillation. Color blocks show order only.

AI-generated schematic: the course starts from a pretrained base model, then answer verification, inference-time scaling, GRPO reinforcement learning, and distillation. Color blocks show sequence only—not episode length, and not a course UI screenshot.

Building Reasoning Models from the Ground Up is a free video course Sebastian Raschka released on 24 October 2026 via his Ahead of AI newsletter: 8 episodes and over 11 hours of coding footage. Starting from pretrained Qwen3 0.6B, it implements in Python and PyTorch answer verification and MATH-500 evaluation, inference-time scaling, GRPO-based reinforcement learning with verifiable rewards (RLVR), and distillation. Companion repo rasbt/reasoning-from-scratch is open-sourced under Apache-2.0.

  • Type: Free public video course plus open-source code repo. It is not a degree program; neither the announcement nor the repo offers a completion certificate or badge.
  • Host: Sebastian Raschka, PhD, via his Substack newsletter Ahead of AI; videos are on his YouTube channel.
  • Cost: Videos and code are free to watch and use. The companion book Build a Reasoning Model (From Scratch) from Manning is sold separately and is optional reading.
  • How to join: No registration on any course platform. Open the announcement[1] and watch by episode, or git clone the repo[2] and self-study the chapter notebooks.
  • Official entry: https://magazine.sebastianraschka.com/p/building-reasoning-models[1]

Eight-episode main line

The course deliberately skips pretraining, starting from an already-trained small model so the time goes to evaluation and improvement methods. In the announcement, episode 1 is environment setup; episodes 2–8 match repo chapters 2–8 notebooks. The eight episodes advance as follows:

  1. Motivation and environment setup: map relations among traditional LLMs, reasoning models, and agent frameworks; install dependencies with uv, check CUDA or Apple Silicon support, and show how to attach a remote GPU from VS Code.
  2. Load the base model and generate text: load Qwen3 0.6B pretrained weights, implement greedy decoding and streaming generation, then add KV cache and torch.compile for speed.
  3. Build a verifier: from extracting the final answer and normalizing it to judging mathematical equivalence, build a scorer and evaluate the base model on MATH-500. The same verifier later supplies the RL reward signal.
  4. Inference-time scaling (1): generate diverse answers with temperature scaling, multinomial sampling, and top-p filtering, merge them with self-consistency majority vote, and compare accuracy against extra inference compute.
  5. Inference-time scaling (2): score candidate answers with token and sequence log-probabilities, then implement a self-critique loop in which the model criticizes and revises its own answers.
  6. Reinforcement learning (1): implement a simplified GRPO, turn verifier scores into within-group relative advantages, and assemble an RLVR training loop with logging and checkpoint saves.
  7. Reinforcement learning (2): track entropy and advantage statistics; add policy-ratio clipping, a KL loss term, and format rewards conditioned on answer correctness; discuss reward hacking.
  8. Distillation: use DeepSeek R1 to generate teacher answers for a MATH dataset, implement a supervised training loop, and finally evaluate the distilled model on MATH-500.

Code license and cost boundaries

The repo uses the Apache-2.0 license. Besides each chapter’s main notebook and exercise solutions, it includes MATH-500 verification scripts, a batched GRPO script, more advanced GRPO variant scripts, and download notes for chapter 6–8 training checkpoints. Apache-2.0 covers the code only; videos are publicly viewable on YouTube, while download and redistribution follow YouTube’s terms and the author’s rights. Qwen3 weights, the MATH-500 dataset, and teacher data generated by DeepSeek R1 each follow their original publishers’ terms. The companion book (ISBN 9781633434677) offers fuller prose, figures, and exercises; the author suggests it as optional companion reading. Watching the videos and running the repo alone is enough to cover the whole main line.

AI-generated schematic: free parts on the left (videos, Apache-2.0 code, and exercise solutions).

AI-generated schematic: free parts on the left (videos, Apache-2.0 code, and exercise solutions); parts that may cost extra on the right (optional companion book, GPU compute, and third-party API calls). The figure contains no real UI or brand marks.

Practical value

This course covers the stretch from “reasoning-model post-training and inference-time scaling.” In the announcement, Raschka describes reasoning models as upgrades of traditional LLMs: more post-training with reinforcement learning from verifiable rewards, optionally plus inference-time scaling, to tackle harder problems; agent frameworks treat the reasoning model as the engine and handle context management and tool calling outside it. This course stays at the engine layer: how to evaluate a model, how to trade more inference compute for accuracy without changing weights, and how to change weights with RLVR or distillation.

Division of labor with other free courses on this site

Free courses covered here emphasize different things: Karpathy’s Neural Networks: Zero to Hero builds neural nets and language models from scratch; Hugging Face’s Agents and Context courses cover agents and context engineering in the Hub ecosystem; Claude Academy follows Anthropic product usage paths; Microsoft’s generative-ai-for-beginners is an open generative-AI course for beginners. Raschka’s course begins after “you already have a pretrained model,” suited to readers who want to understand training methods behind reasoning models such as DeepSeek R1. It is also a sequel to his earlier Coding LLMs from the Ground Up video course, though the announcement says you can start without the prior series.

Prerequisites, compute, and getting started

Prerequisites are solid Python and PyTorch; the author’s earlier Build a Large Language Model (From Scratch) is recommended but not required. On compute, the announcement says early text-generation and evaluation examples can run on CPU, while later work—especially training—is more realistic with a GPU; the repo README further notes chapters 2–4 run on CPU or GPU, and chapters 5–6 recommend a GPU to reproduce book results. Readers without a local GPU can follow chapter 2’s cloud-GPU suggestions and pay rental costs themselves; chapter 8 teacher-data generation can run locally via Ollama or through OpenRouter, which may incur API fees. The repo also ships chapter 6–8 training checkpoints so you can inspect post-training behavior without retraining.

The course’s scope is also clear: the model is only 0.6B parameters, aimed at building method intuition rather than a system that competes with large reasoning models; GRPO and the KL term are teaching simplifications, and episode 7 discusses limits of the simplified KL form; evaluation focuses on math problems, and the verifier design assumes answers can be judged programmatically.

The author’s suggested study pattern is: read a book chapter, run that chapter’s code with the video, then do the exercises. Readers who skip the book can pair each video with the matching repo notebook:

  1. Watch episode 1 first and set up the environment from the repo chapter 2 setup notes.
  2. Episodes 2–4 can be followed on CPU to learn Qwen3 loading, sampling, and the MATH-500 evaluation flow.
  3. Prepare a GPU before episodes 5–8; or download the repo checkpoints first to inspect training results, then decide whether to retrain fully.

References

  1. Sebastian Raschka. Building Reasoning Models from the Ground Up: A Full Video Course. Ahead of AI, 2026-10-24.

  2. rasbt/reasoning-from-scratch (GitHub repo, Apache-2.0).

  3. Sebastian Raschka. Reasoning Models From Scratch: Code Setup, 2026-08-30.

  4. YouTube videos: Episode 1 Motivation & Code Setup; Episode 2 Loading a Base Model, Text Generation, and KV Caching; Episode 3 The Verifier for Evaluation and RL with Verifiable Rewards; Episode 4 Inference Scaling 1; Episode 5 Inference Scaling 2; Episode 6 Reinforcement Learning 1; Episode 7 Reinforcement Learning 2; Episode 8 Distillation.

  5. Companion book (paid, optional): Build a Reasoning Model (From Scratch), Manning.

  6. Intelligent Academy · your dedicated school for the intelligent age

  7. Information compiled and published by the Scholay academic one-stop platform; report infringement for takedown.

  8. Also published on Enter Scholar, a scholars’ community for the intelligent age