Unit 11 of 11 · about 3 hours · measure
Compute-matched rejection and SFT controls and external evaluation
An objective comparison is only credible when extra chosen examples, candidate sampling and judge calls cannot explain the gain. This unit turns the diagnostic study into an auditable behavior claim.
You'll be able to
- Compare DPO with preferred-only SFT, rejection fine-tuning and inference-time selection under matched or disclosed budgets.
- Evaluate held-out task behavior, safety and style independently of training preferences.
- Defend the smallest improvement claim supported by raw outputs, uncertainty and negative evidence.
Covers
Read
In this order, only the parts listed
0 of 2 done
- DPO: controls and external judgmentsDirect Preference Optimization
arXiv:2305.18290v3, Section 6, Evaluation and Methods; Sections 6.1 and 6.4
Read the baseline definitions, reward-KL frontier and human-versus-judge comparison. The paper's model-scale results are not local targets, and its best-of-many comparison does not by itself establish compute-matched superiority.
- Post-training laboratory: comparison and final evaluationLLM Post-Training Laboratory - Direct Preference Objective
Milestones E and F; Measurement requirements; Design-defense questions 2 to 6; Out of scope
Evaluate only the section's small DPO and control policies. Use pre-generated responses and a finite-response policy on CPU when model adaptation is impractical; limit conclusions to that reduced setting.
Focus on
- Distinguish rejection fine-tuning, which trains on selected candidates, from best-of-many, which selects at inference without updating parameters. Include untouched SFT and preferred-only fine-tuning so selection and extra supervised exposure are visible.
- Share initialization, prompt splits, candidate pool where applicable, decoding and final evaluation. Track generation tokens, scoring calls, reference scoring, update tokens, tuning attempts and wall time separately; equal optimizer steps do not equal compute.
- Use a task-specific executable check where possible, a separate safety set and style or verbosity slices. For subjective judgments, blind model identities, counterbalance answer order and audit a human-reviewed sample for position and length bias.
- Freeze the evaluator and selection rule before final testing. Keep raw outputs and failures with prompt, policy, decoding and evaluator identity so every score and exclusion can be recomputed.
Common mistakes · 3
- Charging a selection baseline only for its winning response. Discarded candidates and their scores are part of its cost.
- Calling a judge independent because it was not trained during this experiment. It may still share training-label biases or have been used for model selection.
- Calling a small adversarial set a safety certification, or a finite-response demonstration evidence of model-scale alignment.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What does a best-of-many gain over single-sample SFT establish?Answer
A gain from the larger inference-time candidate budget and selection rule. It does not establish a learned parameter change.
2.Why are equal training steps insufficient for compute matching?Answer
Methods process different numbers and lengths of sequences and may require reference forwards, candidate generation and scoring. Count those costs and disclose what remains unmatched.
3.A DPO model wins more judge comparisons only when it is more verbose. What can you claim?Answer
An improvement under that judge and length distribution. A general quality claim needs length or style controls and independent task or human evidence.
4.What if the independent evaluation finds no improvement?Answer
Retain the null or negative result, its uncertainty and the proxy gains. It bounds the claim and can identify a data, objective or evaluator failure without inventing success.
You're done when
A reader can recompute your held-out comparisons and full candidate costs from raw records, and your conclusion distinguishes learned behavior from selection, length and evaluator effects.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 8 more in the section
- Direct Preference OptimizationRafailov et al. · required
Read the complete derivation, objective and experiments. State the preference-model and reference assumptions, then compare a scratch DPO update with SFT and rejection-style baselines on a held-out slice.
- LLM Post-Training Laboratory - Direct Preference ObjectiveRoadmap-Final · required
Complete the DPO-style objective with exact sequence log probabilities, frozen reference identity, fixed loss and gradient tests, common raw evaluation records, support analysis and reward, length, style and judge-hacking probes.
Also in this section
- RLHF Book - Direct AlignmentNathan Lambert · primary
Study Chapter 8 (DPO, its derivation, numerical concerns and online versus offline data) and the
code/direct_alignmentpackage at natolambert/rlhf-book at commit 1042143 (DPO, IPO, KTO and APO are validated there; its SimPO and ORPO runs are marked noisy). Re-derive DPO from the KL-regularized objective, implement sequence log-ratio losses from blank tensors and test chosen-rejected swaps, prompt masking, reference drift and length normalization. - A General Theoretical Paradigm to Understand Learning from Human PreferencesGheshlaghi Azar et al. · required
Study the preference-model misspecification argument and IPO objective. Use one synthetic preference problem to compare DPO and IPO behavior as noise, margin and data reuse change.
- KTO: Model Alignment as Prospect Theoretic OptimizationEthayarajh et al. (ICML 2024) · support
Read the unpaired-feedback setting and the KTO loss with its reference point. State what data KTO needs that DPO does not, and test its loss on fixed log probabilities.
- SimPO: Simple Preference Optimization with a Reference-Free RewardMeng, Xia and Chen (NeurIPS 2024) · support
Read the length-normalized, reference-free reward and the target margin. Use it as the no-reference baseline and compare its length behavior with summed-log-probability DPO.
- Stanford CS224R 2026 - LLM Preference OptimizationStanford University · required
Study Lecture 09 (RL for LLMs: preference optimization,
slides/09_cs224r_rlhf_2026.pdf) and Section 1.3.2 (IPO) of the default project guidelines. Implement independently, preserve the reference policy and follow course material restrictions. - TRL DPO TrainerHugging Face · support
After the scratch loss passes, inspect the DPOTrainer data contract and options for TRL 1.15.0. Differential-test one tiny batch against the local objective and record library version, loss type, , padding, truncation and reference behavior.
- TensorTonic - DPO and Preference ProblemsTensorTonic · support
Solve Implement the DPO Loss (
cs336-l15-direct-preference-optimization-loss), Canonicalize Pairwise Preference Data (cs336-l15-canonical-preference-pairs) and Score a KL-Regularized Policy Batch (cs336-l15-kl-regularized-policy-objective), free problems in the Language Modeling from Scratch plan, as closed-book checks after your own loss passes. - Hands-on Modern RL - Chapter 14 DPOWalking Labs · support
Use the DPO derivation page and the hands-on page for a bounded DPO experiment and metrics. Its displayed loss is the per-pair summand (average it over the dataset), and its implicit reward is exact only at the KL-regularized optimum; its training logs are illustrative. Replace any opaque trainer-only step with a checked local loss and retain a or length regime where quality worsens. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers.