Interpret the sign of a policy log ratio
Watch prefixes in words such as preferred and rejected. · 196 words
In preference-based instruction tuning, a policy log ratio often compares a chosen answer y_c with a rejected answer y_r under the same policy pi. Define L = ln[pi(y_c|x) / pi(y_r|x)]. If L is positive, the policy gives the chosen answer more probability; if L is negative, it gives the rejected answer more probability. If L is zero, the probabilities are equal. Because the logarithm is increasing, L is positive when the ratio exceeds one and negative when it lies between zero and one.
Example: for a request to draft a museum email, suppose the policy assigns 0.40 to the chosen answer and 0.20 to the rejected answer. The ratio is 2 and L = ln(2), about +0.693, so the policy already favors the chosen answer. If the probabilities were 0.10 and 0.25, the ratio would be 0.4 and L = ln(0.4), about -0.916, so the policy would favor the rejected answer. Training on that pair should raise the chosen answer relative to the rejected one. Always state the numerator and denominator; reversing them reverses the sign. If comparing pi_new with pi_old for one answer, a positive log ratio means the new policy increased that answer's probability.
Check your recall
A policy assigns probability 0.40 to the chosen answer and 0.20 to the rejected answer. What is the sign and approximate value of their log ratio?
Check your answer
The ratio is 0.40 / 0.20 = 2, so the log ratio is ln(2), approximately +0.693. The positive sign means the policy assigns more probability to the chosen answer than to the rejected answer.
Sources and credits
Original KeyTouch lesson. Background reading · Nathan Lambert · Reinforcement Learning from Human Feedback.