-
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
Conversational dataset support for DPOTrainer
#2131
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. |
if example["chosen"][idx] != example["rejected"][idx]: | ||
if example["chosen"][idx - 1] == " ": # remove space before the prompt | ||
idx -= 1 |
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.
str1 = "I am Quentin"
str2 = "I am in Lyon"
# What we want:
prompt = "I am"
# What we don't want:
prompt = "I am "
That's why, when the prompt ends with a space, we take idx-1
instead.
…ngface/trl into dpo-conversational-dataset
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.
Really nice clean up of the DPO preprocessing and docs 🔥. Great stuff @qgallouedec !
I know we don't currently have any proper regression tests, but WDYT about running the dpo.py
script on main
and this branch to sanity check the margins / loss look ok before merging?
docs/source/dpo_trainer.mdx
Outdated
|
||
Note that the `beta` is the temperature parameter for the DPO loss, typically something in the range of `0.1` to `0.5`. We ignore the reference model as `beta` -> 0. | ||
To see how the [trained model](https://huggingface.co/trl-lib/dpo-qwen2) performs, use the following code to generate completions: |
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.
WDYT about using trl chat
here as a nice demo to show users it exists?
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.
Co-authored-by: Kashif Rasul <[email protected]>
https://wandb.ai/huggingface/huggingface/runs/b499t4i2 |
What does this PR do?
Part of #2071
It includes:
TrainingArguments
, so that the user can just use it with the default values. (same as [KTO] learning rate recomentations for kto #2070)extract_prompt
to support standard dataset.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.