-
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
π¨βπ¨βπ§βπ§ GRPO #2565
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. |
trl/trainer/grpo_trainer.py
Outdated
advantages = (rewards - mean_grouped_rewards) / (std_grouped_rewards + 1e-4) | ||
|
||
# x - x.detach() allows for preserving gradients from x | ||
advatages = torch.exp(per_token_logps - per_token_logps.detach()) * advantages.unsqueeze(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.
typo advatages
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.
Clean implementation, I had to check the KL term as it if different from PPO. But it appears to match the paper.
@@ -9,7 +9,7 @@ concurrency: | |||
|
|||
jobs: | |||
build: | |||
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main | |||
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@e4fcf608695cf4bddb8c7f4f72aa15fa14110a94 |
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.
temporary pinning to a previous version, the latest one doesn't work
What does this PR do?
Fixes # (issue)
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.