Unit 9 of 10 · about 6 hours · measure

External evaluation and the versioned sampling, labeling and optimization loop

Preference accuracy is an internal diagnostic. The section's result is a bounded claim about a language model's external behavior, supported by controls that separate training from longer answers, sampling changes and judge preferences.

You'll be able to

  • Compare untouched SFT, chosen-only SFT and DPO under matched or explicitly disclosed training and generation budgets.
  • Evaluate capability, safety, calibration and diversity on held-out prompts never used for preference training or selection.
  • Version a sampling, labeling, optimization and rollback loop while retaining failed runs and inconclusive results.

Covers

Independent capability, safety, calibration and diversity evaluationVersioned sampling, labeling, optimization, evaluation and rollback loop
1

Read

In this order, only the parts listed

0 of 3 done

  1. DPO: evaluation contracts and judge validationDirect Preference Optimization

    arXiv:2305.18290v3, Section 6, Tasks, Evaluation and Methods; Sections 6.3, Generalization to a new input distribution, and 6.4, Validating GPT-4 judgments with human judgments

    Read the controls and evaluator comparison. Paid judge calls and the paper's model sizes are not required; use your frozen local task scorer and blinded manual review.

  2. Tulu 3: preference-data and recipe ablationsTulu 3, Section 5 (Preference Finetuning)

    arXiv:2411.15124v5, Sections 5.2 to 5.4: Tülu 3 Preference Data (5.2.1, From Prompts to Preference Data), Key Findings of Data Ablations, and Preference Tuning Recipe and Analyses; Figure 7 and Table 18

    Trace one data-source ablation and one objective comparison. Do not reproduce the model pool, proprietary annotation or distributed training. Its final recipe uses length-normalized DPO, not the original summed loss.

  3. CS336 supplement: after-training behavior checksCS336 Assignment 5 Supplement - Preference Data and DPO

    Section 6.4, Problem dpo_training, parts (b) to (d): preference, safety and capability comparison

    Replace hosted judging with manual review and small local capability/safety subsets. In 6.4's preceding paragraph, raw chosen likelihood exceeding rejected likelihood is not implicit reward accuracy: use the reference-adjusted margin instead.

2

Focus on

  • Freeze the evaluator from the Language-Model Evaluation section, prompt groups, parser, decoding, output budget, tie/failure policy and selection rule before training. Final prompts and labels must not enter preference collection, calibration or checkpoint selection.
  • Keep an untouched SFT control and a chosen-only SFT control trained on the same audited data. Match update-token or compute budgets where possible; disclose reference-scoring, labeling, candidate generation and any mismatch rather than calling equal steps equal compute.
  • Report independent task correctness, harmful compliance and benign refusal separately, probability calibration on a defined labeled task, and diversity/repetition at matched sampling settings. Every preference win rate includes both response-length distributions, item counts, tie handling and prompt-group uncertainty.
  • Use development-only interventions for label noise, , data size, length/style controls and judge swaps. Archive failed/inconclusive runs, then freeze one candidate for untouched final evaluation and a clean-state repeat. A changed judge or rubric starts a new version of the loop.
Common mistakes · 3
  • Selecting a checkpoint or a rubric on the final held-out scores. That set becomes development data; reserve a new untouched set for the final claim.
  • Dropping invalid generations or failed attempts from the denominator. Keep them under the predeclared scoring rule and report their counts.
  • Calling a small positive win-rate difference a gain without uncertainty or length/style controls. A failed control or broad interval supports a narrower or inconclusive claim.
3

Try it yourself

Closed-book, before checking anything

Rebuild a report from a fixed synthetic six-prompt ledger, not its summary: candidate outcomes are three wins, two losses and one tie; candidate token lengths are [20, 30, 40, 50, 60, 70] and baseline lengths are [30, 30, 30, 30, 30, 30]. With ties counted as half-wins and all six prompts retained, obtain win rate , candidate mean length 45 and baseline mean length 30. The token counts use one declared tokenizer; this arithmetic fixture is not model evidence. Explain why the result alone cannot establish a length-independent gain, then use the same raw-record accounting on your bounded study.
4

Quiz yourself

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

0 got · 0 missed

  1. 1.Preference accuracy rose while held-out task accuracy fell. Which result decides the claim?Answer

    The external outcome and predeclared gates. Rising preference accuracy cannot override a capability or safety regression; preserve the negative result and diagnose the mechanism.

  2. 2.Why keep chosen-only SFT when you already have untouched SFT?Answer

    It tests whether gains come from extra exposure to the preferred responses rather than the contrastive objective. Account for its different token and reference-scoring cost.

  3. 3.What must be versioned to roll back a labeling round?Answer

    The generating and reference checkpoints, sampling config, prompt split, raw outputs/votes, rubric or judge, filters, training settings, evaluator and selected artifact. Roll back to a complete accepted manifest, not just a weight file.

5

Practice

  • RLHF Book Chapter 8 Suggested Experiments: small DPO run and data intervention

    Suggested Experiments items 1 and 4: Train a small DPO run on UltraFeedback; Change the data before changing the loss

    Adapt to your audited preference subset and immutable small-decoder SFT checkpoint from the Adaptation and Distillation section: at most 1,000 pairs, context at most 256, batch 1 and at most 100 updates per trained arm. Use your GPU or the smaller CPU decoder, with precomputed frozen reference scores if needed. Pin PyTorch 2.14.1; for a TRL implementation also pin TRL 1.15.0, Transformers 5.19.0 and datasets 5.1.0. Compare at least two fixed seeds, keep the objective unchanged for the noise intervention, and state the reduced-scale limits. The section mini-project retains the baselines, held-out behavior, length/style/judge controls and rollback record.

You're done when

A clean-state repeat reconstructs your selected comparison from manifests and raw held-out outputs, and your report states whether the gain survives length, style, judge and failure controls or remains inconclusive.

Only when you can do this without notes.

Leads to

Notes

Resources · 3 for this unit, 17 more in the section
  • Direct Preference OptimizationStanford University · required

    Read Section 4 and Appendix A: derive the objective from the KL-constrained reward formulation, implement it from policy and reference log probabilities summed over response tokens, and gradient-check , sign, masking and identical-pair cases. TRL's sigmoid_norm variant normalizes by length, which the paper does not.

  • Tulu 3, Section 5 (Preference Finetuning)Allen Institute for AI · support

    Read Sections 5.2 to 5.4: building on-policy preference data, the data ablations and the DPO recipe. Use the ablations as the model for your own one-variable comparison.

  • CS336 Assignment 5 Supplement - Preference Data and DPOStanford University · required

    Do supplement Section 6: inspect the HH preference data (look_at_hh) and implement dpo_loss until its test passes. Run a bounded DPO comparison only after the baseline and evaluator are frozen, with a small open model in place of the Llama 3.1 8B B200 run.

Also in this section