Unit 10 of 11 · about 4 hours · measure
Preference accuracy versus behavior, overoptimization and held-out slices
DPO can rank the recorded pair better while moving probability into unmeasured behavior. Held-out generations and slices are needed to tell a useful update from proxy overoptimization.
You'll be able to
- Exhibit a preference-margin improvement accompanied by worse independent behavior.
- Measure sensitivity to regularization, epochs, label noise and data reuse without selecting on final evaluation.
- Report prompt-group and annotator slices with provenance and uncertainty.
Covers
Read
In this order, only the parts listed
0 of 3 done
- The RLHF Book: preference displacementRLHF Book - Direct Alignment
Chapter 8, Numerical Concerns, Weaknesses, and Alternatives: preference-displacement figure and discussion; Suggested Experiments, item 4, Change the data before changing the loss (page read 2026-10-14)
Read the displacement discussion, not the variant catalog. A probability decrease for both recorded completions is possible, not a necessary outcome of every update. Use only the bounded data-change idea from item 4.
- IPO paper: weak regularization and overfittingA General Theoretical Paradigm to Understand Learning from Human Preferences
arXiv:2310.12036v2, Section 4.2, Weak Regularisation and Overfitting; Sections 5.3 to 5.4, two-action and sampled-preference examples
- Post-training laboratory: held-out behavior evidenceLLM Post-Training Laboratory - Direct Preference Objective
Core requirements: immutable preference data with split and annotator provenance, independent metrics and adversarial set; Milestones D to F
Use prompt-group splits and annotator slices for the DPO study. If annotator identities are absent, report that limitation rather than inventing an annotator holdout.
Focus on
- Separate training pair accuracy, held-out pair accuracy and independently scored generated responses. The first two evaluate implicit reward ranking; neither measures the full policy distribution's task performance.
- Split by prompt or duplicate group before creating pairs. Keep tuning prompts separate from a final held-out set. Where identities exist, distinguish a held-out annotator test from a per-annotator slice on seen annotators.
- Prespecify a small , epoch or reuse sweep, with a controlled noise condition. Larger does not inherently mean more overoptimization: for a fixed reward it strengthens regularization, while empirical training also changes gradient scales and fit.
- Keep every checkpoint, failed run and length or style slice. Pair comparisons by prompt and estimate uncertainty over independent prompt groups and training seeds, not individual correlated pairs.
Common mistakes · 3
- Counting many pairs from one prompt as independent evaluation observations. Pair expansion does not create new prompts.
- Selecting the best epoch or regularization value on the reported final test prompts. That set has become tuning data.
- Treating length-controlled judgment as proof of safety or task correctness. It addresses one confound, not every evaluator shortcut.
Try it yourself
Closed-book, before checking anything
torch.float64 to absolute tolerance . This is a constructed policy change, not a claim about a particular optimizer trajectory. Then use the mini-project's bounded sensitivity study to look for the same diagnostic pattern on held-out prompts.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Where did the probability mass go in the counterexample?Answer
Both recorded completion probabilities fell; the unobserved response gained their lost mass. The pairwise loss constrains their ratio, not their combined probability.
2.Does a higher held-out pair accuracy establish a better generative policy?Answer
No. It establishes better ranking on those comparisons. Generated task quality, validity, diversity and safety need separate evaluation.
3.What can a fixed-coefficient DPO loss do on repeatedly reused, perfectly separable labels?Answer
It can keep pushing the preferred adjusted logit upward without a finite empirical optimum. Early stopping or other regularization is additional to choosing a coefficient.
4.What evidence supports generalization to new annotators?Answer
An identified annotator group excluded from training and tuning, with adequate prompt coverage and reported uncertainty. A source label or anonymous dataset split alone does not establish this.
You're done when
You reproduce the exact proxy-behavior reversal and report the bounded study's held-out slices, uncertainty and negative or null results without final-set selection.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 7 more in the 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.
- 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
- 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.
- 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.