DPO's key identity is that the reward a policy implicitly assigns to a response is beta times its log-ratio against the reference. Looking at this implicit reward explains why DPO needs no separate reward model.
Implement implicit_reward(logp, ref, beta), returning beta * (logp - ref).
Subtract the reference log-probabilities and multiply by beta.
No results yet
Run your code to check it against the examples, or submit to run every test.