-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Process-supervised RM Trainer #2127
base: main
Are you sure you want to change the base?
Conversation
This is awesome @gaetanlop ! Would you like some early feedback on the PR or would you prefer I wait a bit until it's more polished? |
Hey @lewtun, thank you for the message. Currently, the only files that are more or less ready are Implementing a PRMs seems to be pretty straighforward, it seems to be a token classification task where only prediction for the last token of each step gets assigned a label and other tokens are ignored during loss calculation. If the dataset isn’t pre-tokenized, I assume it should contain the following columns:
Are you aware of an HF dataset to train PRMs for the example file? Also, how can I add a new subset to the Thanks again for your time! |
PR ready for review. I have changed the naming conventions that I used before Tests: I created a dummy_dataset but we should add a subset to trl-internal-testing/zen as done in other scripts. |
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.
Thank you for the very clean PR @gaetanlop - this looks great! I've left some minor suggestions regarding the structure, but aside from that and having a smallish dataset in the right format we can sanity check that the accuracy goes up, loss goes down etc I think this is quite close to being ready
Full training: | ||
python examples/scripts/stepwise_reward_modeling.py \ | ||
--model_name_or_path Qwen/Qwen2-0.5B-Instruct \ | ||
--dataset_name trl-lib/PLACEHOLDER \ |
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.
What do you think about picking a subset from PRM800k to test everything works?
You could create a subset in the expected format and then we can merge it with trl-lib/zen
:)
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.
I made two pull requests to trl-lib/zen
(https://huggingface.co/datasets/trl-lib/zen/discussions/3) to add the subsets to trl-lib.
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.
Thanks for looking at this @lewtun. Seems like |
Thanks a lot @gaetanlop! I left some comments. Feel free to share your thoughts in #2148 btw. |
Thanks for the reviews @qgallouedec. I will wait that #2148 is completed and merged before resolving your comments. Don't hesitate to ping me here when you have done your decisions regarding the new standard dataset format. |
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
What does this PR do?
Adding support for process-supervised reward training to TRL as requested in #2110 .
List of papers using PRMs: [1], [2], [3], [4]...
Fixes # (issue)
#2110
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines.
Who can review?
@lewtun @kashif