- 1Split into train / dev / holdout, store as {prompt, chosen, rejected} triples, and freeze the seed used for candidate generation so the dataset is reproducible.
- 2Have humans (or a strong judge model) rank or pairwise-compare the candidates per prompt, producing a chosen/rejected label for each pair.
- 3Filter pairs where the quality gap is too small to learn from (e.g. judge confidence below a threshold, or rubric tie), keeping only pairs with a clear preferred side.
- 4Deduplicate near-identical chosen and rejected texts (and drop pairs where chosen is approximately rejected) so the model is not asked to learn distinctions between essentially the same answer.
- 5For each prompt, generate 4-8 candidate responses from the current SFT model at temperature ~1.0 to get genuine diversity, not near-identical samples.
- 6Sample ~5,000 prompts from the production traffic distribution (or a proxy) so the trained preference signal matches what users actually ask.
Prompts first, then candidates, then labels, then two filtering passes (deduplication and quality-gap), then the final split. Each step depends on the artifact the previous step produced.
Think of judging a baking competition. You first invite contestants (the prompts), then collect their cakes (the candidate responses), then have judges score and rank them (the labels). Before you publish the results, you check that no two cakes are identical entries and that the winning cake is meaningfully better than the runner-up. Only then do you split the results into the official records and an audit set. Doing these steps out of order means judges score nothing, or you keep ties as wins, or you train your taste critic on noise. The sequence reflects what each step needs to exist first.
Detailed answer & concept explanation~9 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: walk through the six-step dependency chain, emphasise that the two filter passes go between labelling and splitting, and explain why each filter is load-bearing.
Real products, models, and research that use this idea.
- Anthropic's published RLHF data pipelines follow this same dependency order, with prompts sourced from production traces and candidates generated from successive policy versions.
- UltraFeedback, the most-cited open DPO dataset in 2026, uses a strong judge model for labelling and explicitly documents its near-duplicate and quality-gap filtering rules.
- Hugging Face TRL's DPO documentation expects the data in {prompt, chosen, rejected} format produced exactly by this kind of pipeline, regardless of whether labelling was human or model-based.
- Allen AI's Tulu 3 release used a multi-source preference dataset assembled following this six-step pattern, with per-stage ablations published.
- Production teams fine-tuning Llama 4 Maverick or DeepSeek V4 with DPO commonly use Claude Opus 4.7 or GPT-5.5 as the judge model, with random human spot-checks to validate label quality.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide between a strong judge model and human labellers for the labelling step, and how would you combine them?
QWhy is the temperature 1.0 choice for candidate generation important, and what changes if you use temperature 0.7 or 1.5?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Skipping the quality-gap filter and training on labelled pairs where the chosen and rejected responses are essentially tied. That teaches the model to chase noise rather than real preference signal.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.