Turn your Week 2 rubric scores into clean chosen/rejected JSONL — with a tie-drop, a position-swap check, and a validation pass
Day 18 of 66
You've traced the click (Day 16) and designed the collection (Day 17). Now you build the artifact a training team actually ingests: a file of chosen/rejected pairs in valid JSONL. The full preference_pairs.py is in the Try This box below — type it in, don't paste, so you read every line.
The inputs to today's script are rubric-scored outputs — the exact scores your Week 2 rubric.py produces. The rubric gave each output a number; today you convert those numbers into the relations the reward model wants. Two weeks of work join into one pipeline: rubric → scores → pairs → grader.
chosen, the lower is rejected.{"prompt", "chosen", "rejected"} object per line. This is the file the trainer reads.chosen ≠ rejected.The "Try This — On Real Data" box below contains the full preference_pairs.py. Type it in and run it. Then point it at your own rubric-scored outputs — the ones from Week 2 — and generate at least ten real pairs.
As each pair prints, say the RM's objective out loud: "reward(chosen) > reward(rejected) — that's the whole signal." If you can't defend why the chosen one won, that pair is noise, and noise in a grader is worse than no data.
A single mislabeled image in an SFT set is one bad example among thousands — diluted. A single bad pair is different: it teaches the reward model a wrong rule ("this kind of output beats that kind"), and the RM then applies that rule to every output it scores during RLHF. One bad pair doesn't add one error — it bends the grader, and the bent grader mis-scores forever. This is exactly why the validation and swap-check steps aren't optional polish; they're the difference between fuel and contamination.
Open prefs.jsonl in a text editor and read it as the training team will: is every line parseable? Any chosen == rejected slip through? Then run the swap check on a few pairs and note any that flipped — those are your position-bias casualties. Screenshot the valid output and the pair count; it's the start of this week's portfolio artifact.
An annotator produces pairs. A lead ships a validated dataset — and owns the steps that make it trustworthy: the tie-drop, the position-swap check, and a line-by-line validation pass that proves every record is parseable JSON with chosen ≠ rejected. A lead hands the training team fuel, not a file they have to debug.
Say this in an interview: "I don't just generate chosen/rejected pairs — I run a swap-check to catch position bias and validate the JSONL before it leaves my hands. If I can't defend why the chosen response won, that pair is contamination, and I drop it rather than poison the grader."