Explore the research collection
1 entry · Follow this search
- Paper
Reasoning From Scratch: RLVR Round 2 — GRPO Stabilization (Clipped Policy Ratios, KL Loss, Format Rewards)
Sebastian Raschka's ~106-minute "RLVR round 2" video in the Build a Reasoning Model (From Scratch) series (companion to his July 2026 Manning book; code at github.com/rasbt/reasoning-from-scratch). A practical guide to stabilizing GRPO beyond the baseline round-1 implementation: interpreting GRPO training metrics, running longer training jobs with Python scripts, plotting training logs, and diagnosing unstable training. Core stabilizers covered with implementations and results: clipped policy ratios to limit oversized policy updates, a KL loss term against reward hacking (plus the limitations of the simplified KL estimator), and format rewards with <think> tags — including adding special tokens to the tokenizer and rewarding format only for correct answers. Diagnostics: tracking advantage statistics, computing and interpreting policy entropy in PyTorch, and analyzing advantage/entropy metrics together. Also evaluates checkpoints on MATH-500 and closes with further GRPO improvements from the research literature plus distillation as the next step. Key caution from the series: the baseline GRPO run takes Qwen3-0.6B from 15.2% to 47.4% on MATH-500 in 50 steps, but longer training can degrade accuracy; reward alone is an insufficient signal since it can rise via reward hacking while held-out capability falls.