Adaptation
Preference tuning: RLHF and DPO
Teach a model which of two answers is better, not just what one good answer looks like.
What it is and why it exists
RLHF: collect human preference pairs, train a reward model, then optimise the policy with RL (e.g. PPO) against it. DPO skips the reward model and the RL loop: it optimises the policy directly on preference pairs with a simple classification-style loss. RLAIF uses AI feedback instead of humans. These shape tone, helpfulness and refusals.
Quick prototype
—
In production, at scale
Usually after SFT: collect chosen/rejected pairs from your domain, run DPO (simpler, stable), evaluate on preference win-rate and task metrics, watch for reward hacking and verbosity drift.
Vendors and tools
| Hugging Face TRL | DPO, PPO, ORPO, KTO trainers |
|---|---|
| OpenAI preference fine-tuning | DPO via API |
On AWS: SageMaker for custom RLHF/DPO pipelines.
How it fails
- Model learns that longer answers win
- Preference data from annotators who disagree
What the interviewer asks next
DPO vs RLHF in one sentence?
Both learn from preference pairs; RLHF trains a reward model and does RL against it, DPO optimises the model directly on the pairs — fewer moving parts.