Train a Reward Model From Noisy Pairwise Code Preferences
Last updated: November 29, 2026
Quick Overview
You have 120,000 pairwise preferences where expert reviewers chose the better of two model solutions to a coding prompt, with some ties and known label noise. Explain how you would train and validate a reward model on this data, including the loss and how you would handle ties and noisy raters.
Turing
November 29, 20260
0
0 solved
You have 120,000 pairwise preferences where expert reviewers chose the better of two model solutions to a coding prompt, with some ties and known label noise. Explain how you would train and validate a reward model on this data, including the loss and how you would handle ties and noisy raters.
Turing delivers RLHF preference pairs to frontier labs and is often asked to prove the data improves a reward model. The interviewer checks that the candidate knows the Bradley-Terry objective, data splitting traps, and how label quality shows up in reward model accuracy.
What the Interviewer Expects
- States the Bradley-Terry loss on reward differences
- Has a concrete plan for ties
- Splits data by prompt, not by pair
- Uses rater reliability to weight or filter labels
- Validates with held-out accuracy and a downstream check
- Names reward hacking risks such as length bias
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How would you check whether the reward model just prefers longer answers?
- When would you use DPO directly instead of training a separate reward model?
- How could execution results from unit tests be combined with human preferences?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Each record: prompt, response A, response B, preferred side or tie, rater ID, and maybe a strength rating. Is the goal a reward model for RL, or evidence that the data is good? Are some prompts labele...
Approach
Put a scalar head on the LLM: . For a pair where is preferred, Bradley-Terry gives and the loss $-\log \sigma(\Delt...