Preference Modeling and Direct Optimization

Preference optimization can improve its own reward while degrading real behavior. This stage derives the data and objective path, then tests it against length, style, evaluator and distribution shortcuts.

Section 7 of 11 · 10 units · about 45 hours

0/10

By the end you can Gradient-check the chosen preference objective, audit its data and policy versions, then show that its improvement over SFT survives external evaluation and controls for response length, style, judge bias, and reference mismatch.

Units

Build it

Mini project · about 16 to 20 hours

Audited preferences with independent behavior and rollback evidence

Extend lmlab in pref/ with audited comparison data, a bounded reward head and a checked DPO path from the existing SFT checkpoint. Test whether preference optimization changes the study's behavior rather than merely its proxy, length or judge score, using your machine and no paid judge.

  1. 1Version preference records in pref/ with generator identities, source-group splits, raw votes, ties and adjudication. Pass TensorTonic canonical-pair cases; retain blinded order/identity/length/style audits and trace a principle-conditioned label's exact principle and judge identity, distinguishing comparison provenance from critique/revision data.
  2. 2Implement Bradley-Terry likelihood and certify the KL-regularized optimum against independent algebra and TensorTonic policy-objective cases. Before training, retain repeated-vote calibration, offset/scale and separated-vote regressions; test reward-head pooling against last-real-token fixtures, padding changes, identical pairs and partial accumulation windows.
  3. 3Derive DPO and implement shifted response-only scoring with explicit EOS, padding, empty and truncation rules. Match analytic loss and gradients, TensorTonic DPO cases, pinned RLHF Book scoring/loss code and CS336's tiny-model DPO test; preserve token evidence and reference-identity rejection tests.
  4. 4Gate training on parameter/FLOP counts and versioned audits: annotator-noise copies, swapped labels, duplicate leakage, mask shifts, wrong normalization and reference mismatch must fail named independent checks. Retain before-and-after regressions; optionally specify an alternative objective contract without requiring another training sweep.
  5. 5Train or reuse the section's bounded frozen-backbone reward head across seeds. Freeze calibration on separate prompts, then check held-out ranking and probability calibration under generator and length shifts against trusted labels; retain raw scores, shortcut probes, counts and negative or inconclusive evidence.
  6. 6Compare untouched SFT, chosen-only SFT and DPO with a versioned training-label-noise intervention at matched training and inference budgets across seeds. Use the frozen eval/ suite and untouched held-out labels; retain independent capability, safety, calibration and diversity outcomes beside margins, proxy rewards and policy drift.
  7. 7Reproduce the selected comparison from clean state and rebuild reports/ from raw registry/ records. Check length/style and judge controls against blinded review; retain paired uncertainty, all candidate-generation, labeling, reference-scoring and failed-run costs, proxy-versus-behavior discrepancies, reduced-scale limits and an owned release or rollback decision.
What you hand in
  • Versioned pref/ data and label audit, scalar reward head, DPO scorer and objective preflight regressions.
  • Immutable SFT, reference and preference checkpoints with raw votes, generations, calibration, shift, noise and budget records in registry/.
  • Clean reproduction and independent behavior report with length/style/judge controls, negative evidence and rollback ownership.
How to check it
How it's graded

Label and reward integrity

Pass: Raw votes, adjudication, presentation audits and principle provenance survive conversion; independent likelihood and pooling oracles pass, and held-out calibration and shift reports retain untouched labels and shortcut evidence.

Great: Offset, scale and separation tests distinguish identification failures from probability errors; disagreements remain traceable to source, rubric, annotator and generator without being erased by adjudication.

Objective preflight correctness

Pass: Analytic and pinned-reference loss/gradient tests validate shifted response scoring and DPO; each planted label, leakage, mask, normalization and reference defect fails a named check before training.

Great: Equal-valued independent score inputs are distinguished from identical responses sharing model parameters, and gradient checks expose defects hidden by initial scalar loss equality.

Independent behavior decision

Pass: Matched multi-seed controls, noise intervention, length/style/judge checks and untouched capability/safety evaluation support a bounded verdict; clean reproduction rebuilds paired outcomes, costs, failed attempts and rollback evidence.

Great: The report separates proxy fit from behavior, discloses residual budget mismatches and tests the strongest alternative explanation without requiring DPO to win.

Resources