LLM RL II: Preferences, Reward Models and Verifiers

RL optimizes the signal it receives, so feedback construction is part of the algorithm. This stage distinguishes subjective preference, learned proxy reward and executable verification, then attacks each signal before it can become the sole training or release metric.

Section 9 of 12 · 9 units · about 37 hours

0/9

By the end you can Train or simulate a preference reward model and build an executable verifier, then expose one policy-shift, length, format or judge shortcut and prove why training reward cannot be the sole model-selection criterion.

Units

Build it

Mini project · about 10 to 14 hours

Preference rewards, verifiers and hacking evidence

Build preference rewards and executable verifiers in policylab, then show how each can be gamed. The hacking battery and versioned lineage feed every later language-policy update and the capstone evidence pack.

  1. 1Implement fixed-batch Bradley-Terry loss with gradients in llm/ and check loss, gradient signs and margins against hand calculations, including margin and per-prompt grouped variants, keeping the oracle scripts in tests/.
  2. 2Write a target-preference definition for one task, collect small on-policy pairs, train a tiny CPU reward model with a last-token head, and report prompt-split accuracy with margins and length correlation plus a fixed calibration scale.
  3. 3Score fixed completions with outcome, process and generative heads in llm/, recompute discounted returns by hand, and compare aggregation choices against the Hands-on Modern RL outcome-versus-process page, keeping token evidence.
  4. 4Build a deterministic verifier with explicit parser boundaries in llm/, score fixed answers with both the boxed-only extractor and the fallback extractor, and report completeness and soundness separately with hidden tests retained.
  5. 5Run the Hands-on Modern RL flawed-reward experiment on your own concise and verbose answers, log reward with length and diversity traces, then audit a pairwise judge with order swaps and human spot checks for position and length bias.
  6. 6Combine the heads into one scalarized reward with versioned weights in llm/, bind every record in schema/ and ledger/, and freeze a regression set in eval/ with written ship and rollback rules that a rising-reward and falling-quality row must trigger.
What you hand in
  • The llm/ reward and verifier package with loss, scoring and extraction oracles.
  • Hacking and judge audits with curves, bias tables and retained failures.
  • Version manifests, frozen regression set and governance rules in eval/.
How to check it
How it's graded

Loss correctness

Pass: Fixed-batch loss, gradients and signs match hand calculations including margin and grouped variants.

Great: Deliberate sign, margin and grouping bugs each fail a named test.

Verifier honesty

Pass: Completeness and soundness are reported separately for both extractors with hidden tests retained.

Great: An equivalent-answer case passes under one parser rule and fails under the other, with the boundary named.

Hacking evidence

Pass: A hacked regime with rising reward and falling quality is retained with length and judge-bias readouts.

Great: The rollback names the data fix and the rerun shows the signal cleared.

Lineage and governance

Pass: Every record carries reward and verifier versions and the frozen set has written ship and rollback rules.

Great: A mid-run version change is rejected by the manifest test and starts a new study.

Resources

  • RLHF Book - Reward Models, Preferences and EvaluationNathan Lambert

    Study Chapter 5 (reward modeling: Bradley-Terry loss, outcome, process and generative reward models), Chapters 10 and 11 (preferences and preference data), Chapter 14 (over-optimization) and Chapter 16 (evaluation). Implement the pairwise reward loss, compare outcome, process and generative reward roles, and build an adversarial feedback audit covering preference bias, reward shift and overoptimization.

  • RLHF Book Course - Lectures 2, 8 and 9Nathan Lambert

    Use Lecture 2 (instruction tuning, reward models and rejection sampling), Lecture 8 (preferences and preference data) and Lecture 9 (over-optimization). Reproduce the reward-data-to-score path and keep rejection sampling as a non-RL selection baseline for later online optimization.

  • Deep Reinforcement Learning from Human PreferencesDeepMind and OpenAI

    Study the preference-query, reward-learning and policy-optimization loop. Reproduce a tiny preference model or simulator and measure how label noise or policy shift changes reward accuracy and control quality.

  • Scaling Laws for Reward Model OveroptimizationGao, Schulman and Hilton (ICML 2023)

    Read the gold-reward setup and the proxy-versus-gold curves for best-of- and RL as the KL distance grows. Reproduce the shape at toy scale: a small proxy reward model, a known gold reward and best-of- selection.

  • LLM Post-Training Laboratory - Reward and Adversarial EvaluationRoadmap-Final

    Complete the pairwise reward model, held-out and calibration analysis, deterministic verifier, judge-bias audit, reward-hacking probes and the required case where proxy reward improves while independent behavior worsens.

  • Learning to Summarize from Human FeedbackStiennon et al. (NeurIPS 2020)

    Read the reward-model and policy-training protocol, the KL penalty and the length analysis. Use it as the first full example of a reward model trained on comparisons and then optimized against.

  • Let's Verify Step by StepLightman et al. (2023)

    Read how process supervision labels steps, how the process reward model scores a solution and how outcome and process supervision compare under best-of- selection. Define step boundaries for your own task before training any process scorer.

  • Constitutional AI: Harmlessness from AI FeedbackAnthropic

    Study supervised self-critique, AI preference feedback and RL from AI feedback. Implement a bounded rubric-conditioned comparison exercise and test judge correlation and principle ambiguity rather than reproducing the full pipeline.

  • Stanford CS224R 2026 - Reward LearningStanford University

    Study Lecture 08 (reward learning, slides/08_cs224r_reward_learning_2026.pdf) with its Christiano et al. reading, and Section 1.2 of the default project guidelines for preference and verifier datasets. Use fixed chosen and rejected examples and a hidden adversarial split; write independent implementations.

  • Hands-on Modern RL - RLHF Evaluation and Process RewardsWalking Labs

    Use the outcome-versus-process page (its discounted ORM and PRM returns are worth recomputing by hand) and the process-reward and search chapter as an implementation map for verifier tests. Check claims against the original sources. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its code/chapterNN folders do not follow the site chapter numbers.