show me the formula for DPO algorithm
- User
show me the formula for DPO algorithm
- Assistant
Direct Preference Optimization (DPO) is a method designed to align language models with human preferences by directly optimizing the policy without the need for an explicit reward model or reinforcement learning loop. This approach simplifies the alignment process, treating it as a supervised learning problem over preference data.
In DPO, the optimal policy (\pi^*) is derived by maximizing the likelihood of preferred responses over less preferred ones. Given a dataset (D) consisting of input (x) and pairs of responses ((y_w, y_l)), where (y_w) is the preferred response and (y_l) is the less preferred one, the objective function is:
[ \pi^* = \arg\max_{\pi} \mathbb{E}_{(x, y_w, y_l) \sim D} \left[\log \sigma\left( \beta \log \frac{\pi(y_w|x)}{\pi^{\text{SFT}}(y_w|x)} - \beta \log \frac{\pi(y_l|x)}{\pi^{\text{SFT}}(y_l|x)} \right)\right] ]
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.