-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix logits/chosen
and logits/rejected
metrics in kto_trainer
.
#2077
Conversation
Tagging @MAOJIASONG as the original author and @claralp and asking for a review. 🙏🏼 |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Now I understand: Let's take the following example:
Your proposed fix
Would the following work?
Probably, but too memory intensive, right? |
May I ask what's the difference between the first one, and the proposed second one? why is it better to use |
Because otherwise the result is wrong (5) |
@qgallouedec I am not sure about this to be honest. |
Thx, I misinterpreted the example. Thanks for pointing it out. |
logits/chosen
and logits/rejected
metrics in kto_trainer
.logits/chosen
and logits/rejected
metrics in kto_trainer
.
The calculation of the
logits/chosen
andlogits/rejected
metrics inkto_trainer
seem to be wrong. Anansum()
followed bynanmean()
applied to thepolicy_rejected_logits
is wrong.Our fix is to apply
nansum()
followed by an othernansum()
and then devide the result bycount/chosen
orcount/rejected
.