Unit 2 of 13 · about 4 hours · implement

Verifier isolation, hidden tests and sparse outcome credit

The policy optimizes exactly what the verifier pays for. Isolation and scoring rules decide whether higher reward means solved or means gamed.

You'll be able to

  • Separate visible verifier tests from hidden tests and state what each set can and cannot prove.
  • Implement all-pass gating and partial credit on fixed code outputs and show how the rule changes the update.
  • Explain sparse terminal credit with a discounted-return example and why the final score cannot name the first error.

Covers

Executable verifier isolation and adversarial hidden testsOutcome rewards and sparse terminal credit
1

Read

In this order, only the parts listed

0 of 3 done

  1. Boxed extraction, normalization and gradingBuild a Reasoning Model (From Scratch) - Chapters 3, 6 and 8

    Chapter 3, Sections 3.1 and 3.4 to 3.7, printed pp.58-80: get_last_boxed last-box rule, normalize_text with LATEX_FIXES, SymPy equality_check on the simplified difference, grade_answer with split_into_parts; the tuple case (14/3,2/3) versus (14/3,4/6) needs the split

  2. R1-Zero rule-based rewardsDeepSeek-R1 Technical Report

    Sections 2 and 3, arXiv:2501.12948v2: R1-Zero rule-based accuracy plus format rewards and language-consistency rewards for math, code and logic; read the pipeline as a claim map, not as a run target

  3. Countdown verifier datasets and scoringStanford CS224R 2026 LLM RL Default Project - Extension

    Section 1.2.4 verifier-based datasets for RLOO only, Section 1.3.3 rule-based verifier reward, Section 1.4 evaluation with evaluation/countdown.py checking format plus arithmetic with multiple samples per prompt and average score plus pass at K

2

Focus on

  • The verifier runs outside the policy with frozen tests. Visible tests teach format while hidden tests decide the score.
  • All-pass gating pays 1 only when every assert passes. Partial credit pays a per-test share on the same outputs.
  • Terminal credit gives one reward to the whole trace. Discounted return with shrinks early weight with distance, which misattributes early defining errors.
  • Format rewards stabilize parsing but can be hacked into fluent wrong answers. Track format and accuracy separately.
Common mistakes · 3
  • Letting the policy read verifier code or hidden tests during training. That turns evaluation into training data.
  • Averaging format and accuracy into one scalar. A format fix can mask an accuracy drop.
  • Treating discounted return as error location. It weights by distance, not by responsibility.
3

Try it yourself

Closed-book, before checking anything

From a blank file, score 3 fixed code outputs under all-pass gating and under proportional partial credit and show one case where they disagree. Then compute returns for with at 8, 4, 3 and 1 steps from the end to get 0.43, 0.66, 0.73 and 0.90.
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.A solution passes 2 of 3 asserts. What do all-pass and proportional rules pay?Answer

    0 and about 0.67. Same outputs give different updates.

  2. 2.Why keep hidden tests the policy never sees?Answer

    Visible tests teach format while hidden tests check generalization. A policy that saw them could memorize answers.

  3. 3.With only and , what credit does a step 8 positions back get?Answer

    About 0.43. That is distance discounting, not causal credit.

  4. 4.A trace ends right but step 6 has a missing square. What does the outcome reward reinforce?Answer

    The whole trace including step 6. That is the sparse-credit problem.

5

Practice

  • Stanford CS224R Default Project: Countdown verifier

    Section 1.2.4 verifier-based datasets and Section 1.4 evaluation with evaluation/countdown.py; implement the format-plus-arithmetic check on fixed completions before any training

    Use the public starter as study material under the course honor code. Do not publish solutions. Keep the Qwen2.5-0.5B base fixed.

You're done when

Your two scoring rules disagree on a planted partial solution, your hidden set catches it, and your hand returns match 0.43, 0.66, 0.73 and 0.90.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 10 more in the section
  • DeepSeek-R1 Technical ReportDeepSeek AI · required

    Read version 2 of the report (January 2026; the Nature 2025 paper is the peer-reviewed version): the R1-Zero and R1 training pipeline, reward design, observed behaviors and limitations. Reproduce only a reduced verifier-driven question and test whether longer sampling or selection explains the observed gain.

  • Build a Reasoning Model (From Scratch) - Chapters 3, 6 and 8Sebastian Raschka (Manning) · support

    Use Chapter 3 (a math verifier: boxed-answer extraction, normalization and equivalence checks), Chapter 6 (RLVR with GRPO on a MATH subset) and Chapter 8 (distillation from filtered rollouts) as the smallest verifier-to-distillation path on Qwen3 0.6B.

  • Stanford CS224R 2026 LLM RL Default Project - ExtensionStanford University · required

    Use the specification sections on SFT, IPO, RLOO, evaluation and one extension such as off-policy sampling, test-time inference, exploration, self-play or tool reasoning. Build independent code on a distinct task and respect all course restrictions.

Also in this section

  • RLHF Book - Reasoning, Synthetic Data, Tools and EvaluationNathan Lambert · primary

    Study Chapter 7 (reasoning and inference-time scaling), Chapter 12 (synthetic data and on-policy distillation), Chapter 13 (tool use), Chapter 14 (over-optimization) and Chapter 16 (evaluation). Build a claim map separating RLVR learning, inference-time search, on-policy distillation, tool trajectories, reward overoptimization and independent evaluation.

  • RLHF Book Course - Lectures 5, 7, 11 and 12Nathan Lambert · required

    Use Lecture 5 (the rise of reasoning models), Lecture 7 (synthetic data and modern post-training), Lecture 11 (tool use and the road to agents) and Lecture 12 (frontier model evaluation). Tie every mechanism to a distinct data and compute budget.

  • Tulu 3: Pushing Frontiers in Open Language Model Post-TrainingLambert et al. (Ai2, 2024) · support

    Read the RLVR section: verifiable rewards for math, instruction following and constraints, and how the RLVR stage sits after SFT and DPO. Compare its recipe with R1-Zero on what is rewarded and what is held out.

  • STaR: Bootstrapping Reasoning With ReasoningZelikman et al. (NeurIPS 2022) · support

    Read the generate, filter by correctness and fine-tune loop and the rationalization step. Use it as the rejection fine-tuning control that an RL method must beat at matched samples.

  • RAGEN: Understanding Self-Evolution in LLM Agents via Multi-Turn Reinforcement LearningWang et al. (2025) · support

    Read the multi-turn trajectory formulation and the training instabilities it reports for agent RL (collapse into repetitive reasoning). Use it to design the diagnostics for a small multi-turn environment.

  • Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - LLM RL Default Final ProjectUC Berkeley · support

    Read the default project for open-ended instruction following: offline DPO, IPO and AOT, online GRPO, Dr. GRPO and GSPO, and judge-based win rates against a frozen base. Use it as a second extension menu; its compute assumes cloud GPUs and a paid judge model.

  • Hands-on Modern RL - Reasoning, Agentic RL and SafetyWalking Labs · support

    Use the build-an-agentic-training-system page (a from-scratch trainer exercise), one reasoning or search control and the reward-hacking evaluation chapter selectively. Skip the pages that need API keys or several GPUs and the frontier surveys. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its code/chapterNN folders do not follow the site chapter numbers.

  • veRLByteDance · support

    Inspect the hybrid-controller architecture, worker roles, supported algorithms and examples at commit 8718ca3 after single-device losses pass. Trace one rollout from generation through reward and update, record policy lag and run only hardware-compatible examples.

  • LLM Post-Training Laboratory - Final IntegrationRoadmap-Final · required

    Finish the bounded rollout and verification queue, reasoning or tool extension, independent clean and adversarial evaluation, reward-hacking postmortem, policy-lag and throughput records, clean reproduction and one prespecified negative or positive result.

  • Reinforcement Learning CheckpointRoadmap-Final · support

    Take the checkpoint closed-note after the integrated project. Pass the estimator and state reconstruction, unseen failure diagnosis, matched-budget comparison, external evaluation and research-readiness clauses.