-
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
[DPO] add KTO loss #1075
[DPO] add KTO loss #1075
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super fast addition @kashif ! I've checked the equations and it looks good to me 🔥
Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @kashif! This is blazing fast. Maybe in a follow-up PR you can add a test example using anthropic's hh?
* add KTO loss * fix docs * Update trl/trainer/dpo_trainer.py Co-authored-by: lewtun <lewis.c.tunstall@gmail.com> * formatting * add link to papers --------- Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
add Tahneman-Tversky optimization (KTO) loss function from https://github.com/ContextualAI/HALOs]
fixes #1072