Implement the DPO loss given policy/reference logprobs for chosen/rejected and β\beta

Direct Alignment: DPO, Rejection Sampling & Distillation1 / 5

Chapter 131 / 5

Direct Alignment: DPO, Rejection Sampling & Distillation

Implement the DPO loss given policy/reference logprobs for chosen/rejected and β\beta

Easy
Target interface
dpo_loss(pi_logps_w, pi_logps_l, ref_logps_w, ref_logps_l, beta=0.1)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.