Mid-level interview questionAsked at TikTok · interview write-up
Explain DPO and how it differs from PPO-based RLHF, then describe how you would construct its preference training data.
Model answer
PPO-based RLHF trains a reward model, then samples and maximises reward with a KL penalty. DPO solves that objective in closed form, training on preference pairs with a classification-style loss: raise the chosen answer's log-ratio over the rejected one, relative to the reference. No reward model or sampling loop.
Scroll sideways to see the whole diagram
RLHF: fit a reward model to human preferences, then optimise the policy against it with reinforcement learning.
Text version
- RLHF: fit a reward model to human preferences, then optimise the policy against it with reinforcement learning.
- DPO: one supervised-style loss on the same pairs. No reward model, no sampling loop, far fewer moving parts.
Ouyang et al. (2022), Training language models to follow instructions with human feedback; Rafailov et al. (2023), Direct Preference Optimization.
Data: per prompt, sample several responses from the SFT model itself; humans or a validated judge pick chosen and rejected. Drop ties, watch length bias.
Practise the rest
20 Fine-tuning & alignment questions, 492 in all, each with a model answer. Free.
More from TikTok interview questions.
More Fine-tuning & alignment interview questions
- Prompting, RAG or fine-tuning: how do you choose?
- What is LoRA, and why is it so much cheaper than full fine-tuning?
- You're handed fine-tuning code whose loss behaves oddly. What do you check?
- Compare RLHF with a reward model to DPO.
- Debug a GRPO training loop. What is the probability ratio, and what goes wrong with it?
- Design a platform for fine-tuning LLMs on AWS, covering distributed training and security between tenants.