The one sentence
DPO turns preference optimization into a direct classification-style policy loss, removing the explicit reward-model and PPO loop from standard RLHF.
DPO lowered the operational barrier for post-training: teams can use pairwise preference data with a standard supervised fine-tuning loop instead of maintaining separate reward-model training, online sampling, PPO stability machinery, and extensive RL tuning.
---
Core idea
Start from the KL-constrained RLHF objective, express the latent reward as a function of the optimized policy and reference policy, substitute that expression...
Start from the KL-constrained RLHF objective, express the latent reward as a function of the optimized policy and reference policy, substitute that expression into a Bradley-Terry preference likelihood, and train the policy directly on preferred/dispreferred...
Modelreason
Runtimeact
Worldobserve
01
Train or choose a supervised reference policy.
02
Collect or load preference pairs on the target distribution.
03
Compute log probabilities of preferred and dispreferred completions under both current and reference policies.
04
Construct the DPO preference margin from policy/reference log-ratio differences.
---
Executable shape
The mechanism should fit on one screen.
```python
for x, y_win, y_lose in preference_pairs:
pi_margin = logp(policy, y_win, x) - logp(policy, y_lose, x)
ref_margin = logp(reference, y_win, x) - logp(reference, y_lose, x)
loss = -log_sigmoid(beta * (pi_margin - ref_margin))
update(policy, loss)
return policy
```
---