Unit 1 of 10 · about 4 hours · explain

Policy-dependent preference data and pairwise, listwise and tie labels

A preference label describes a comparison under a collection process, not an absolute quality certificate. That process defines what the later reward or policy fit can claim.

You'll be able to

  • Specify whose preferences a dataset represents, under which rubric and prompt distribution.
  • Trace each comparison to its generating policy, sampling settings and presentation order.
  • Convert rankings into strict pairs without silently turning ties, missing judgments or ratings into wins.

Covers

Policy-dependent preference-data generation and prompt samplingPairwise, listwise, ratings, ties and indifference labels
1

Read

In this order, only the parts listed

0 of 2 done

  1. The RLHF Book: Chapter 10, The Nature of Preferences; Chapter 11, Preference DataRLHF Book - Reward Models, Direct Alignment and Preferences

    Chapter 11: Collecting Preference Data through Structured Preference Data, including Interfaces, Rankings vs. Ratings and Multiturn Data; Open Questions in RLHF Preference Data

    Skip Sourcing and Contracts. For the specification problem, also read Chapter 10, When Preference Replaces Correctness and Complexity of Optimizing Preferences, at https://rlhfbook.com/c/10-preferences.html. Do not repeat the basic judge survey from the LLM Foundations unit on model judges and human review.

  2. CS336 Spring 2026 Assignment 5 supplement: inspect HHCS336 Assignment 5 Supplement - Preference Data and DPO

    Section 6.2, Looking at Preference Data, Problem look_at_hh, parts (a) and (b), printed p. 16

2

Focus on

  • Record prompt source, generator checkpoint, decoding settings, rubric, labeler identity or type, displayed order and raw votes before making chosen/rejected records.
  • Preference collection often calls data from the same model family on-policy. This is not the strict RL definition of samples from the current update's policy. Off-policy pairs are usable, but coverage must be tested rather than assumed.
  • A ranking creates dependent pairs within a prompt. Preserve the ranking and prompt group so expanding it does not silently overweight prompts with more candidates.
  • Separate indifference, both-bad, uncertainty and missing labels. A rating difference is not automatically a calibrated preference probability.
Common mistakes · 3
  • Treating chosen as correct. Two wrong answers can still have a meaningful relative preference.
  • Splitting expanded pairs randomly. The same prompt, conversation or candidate can then cross the train/evaluation boundary.
  • Discarding the source collection after merging HH. Helpful, harmless and rejection-sampled data need separate audit slices.
3

Try it yourself

Closed-book, before checking anything

Without notes, draw the provenance chain from a sampled prompt to a training pair. For candidate IDs a, b, c, d with ranks [1, 2, 2, 4], list the five strict winner-loser pairs and retain the tie separately. State which weighting rule would give this prompt the same total weight as a prompt with only one pair.
4

Quiz yourself

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

0 got · 0 missed

  1. 1.Does changing the generator leave the preference task unchanged?Answer

    The rubric may stay fixed, but the compared response distribution changes. New failure modes and harder or easier comparisons can change observed agreement and learned behavior.

  2. 2.How many strict pairs come from ranks [1, 2, 2, 4]?Answer

    Five: a beats b, c and d; b and c each beat d. The b/c tie supplies no strict winner.

  3. 3.Can an indifference label enter ordinary binary DPO unchanged?Answer

    No. Declare a policy such as excluding it from the strict-pair objective while reporting it, or using an explicitly defined soft-label or tie-aware objective. Do not pick a winner arbitrarily.

5

Practice

  • CS336 Assignment 5 supplement: look_at_hh

    Section 6.2, parts (a) and (b): combine the four HH collections, retain source, remove multi-turn examples as specified, and inspect three helpful and three harmless comparisons

    This is a written/data-inspection problem, not an autograded one. Save accepted and excluded counts and your reasons for disagreeing with any labels. Use a bounded subset on CPU. The public handout and tests are study material; never publish assignment solutions.

  • TensorTonic: Canonicalize Pairwise Preference Data

    Implement canonical_preference_pairs(records)

    Free. Public cases cover a three-candidate ranking, unsorted candidate input and two prompt records. Add your own tie and duplicate-ID rejection cases; the public cases do not establish those behaviors.

You're done when

Your HH inspection retains source and exclusion counts, your strict-ranking converter passes the public examples, and your collection contract specifies ties, grouping and generator lineage.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 18 more in the section
  • RLHF Book - Reward Models, Direct Alignment and PreferencesNathan Lambert · primary

    Read Chapter 5 (reward models), Chapter 8 (direct alignment), Chapters 10 and 11 (preferences and preference data) and Chapters 14 and 15 (over-optimization and regularization) at rlhfbook.com/c/NN-slug.html. Only Chapters 5 and 8 have Suggested Experiments; do those. Trace preference data through reward modeling or DPO and list each distribution and evaluator assumption before training.

  • 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