Track preferred and rejected replies in a DPO example
Type every qualifier in the comparison. · 166 words
A museum notice gives the opening hour as ten. For the same visitor question, a reviewer prefers the reply giving ten over a reply giving nine. In a small numerical example, the current language model assigns whole-reply probabilities of 0.40 and 0.20 to these two answers. A fixed reference model assigns them 0.35 and 0.25. Other possible replies take the remaining probability in each distribution. In direct preference optimization, compare how each answer's probability changed relative to the reference on this same prompt.
The preferred answer has a natural log ratio of ln(0.40 / 0.35), about 0.134. The rejected answer has ln(0.20 / 0.25), about -0.223. Subtracting the second from the first gives a margin near 0.357. With a scaling factor of one, the logistic function converts that margin to a predicted probability of preference near 0.588. This is the comparison model's prediction that the preferred reply wins the pair. The language model's probability of generating the exact preferred text is still 0.40 in this example.
Check your recall
Why do the values 0.588 and 0.40 refer to different events in the museum example?
Check your answer
About 0.588 predicts a preference between the two replies. The value 0.40 is the policy probability of generating the exact preferred reply to the prompt.
Sources and credits
Original KeyTouch lesson. Background reading · Nathan Lambert · Reinforcement Learning from Human Feedback.