Skip to content

🎀 New default: beta=0.0 for GRPO #3516

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

Merged
merged 3 commits into from
May 30, 2025
Merged

🎀 New default: beta=0.0 for GRPO #3516

merged 3 commits into from
May 30, 2025

Conversation

qgallouedec
Copy link
Member

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

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.

@HuggingFaceDocBuilderDev

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.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes the GRPO KL coefficient default from 0.04 to 0.0 and updates related docs and tests.

  • Sets beta default to 0.0 in code and docstrings
  • Updates test to cover non-zero beta case (removes previous beta=0.0 test)
  • Adds a documentation tip highlighting the new default and rationale

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
trl/trainer/grpo_config.py Changed beta default from 0.04 to 0.0 and updated help text
tests/test_grpo_trainer.py Renamed and updated test to use a non-zero beta value
docs/source/grpo_trainer.md Added a Tip explaining the new default and its motivation
Comments suppressed due to low confidence (3)

tests/test_grpo_trainer.py:812

  • The dedicated test for the beta=0.0 behavior was removed. It would be valuable to add a test that verifies the reference model is not loaded and no KL penalty is applied when beta is zero.
def test_training_beta_non_zero(self):

trl/trainer/grpo_config.py:136

  • [nitpick] The previous warning about numerical instability for long training runs when beta=0.0 was removed. Consider re-adding a brief caution or linking to further guidance so users are aware of potential edge cases.
training speed.

trl/trainer/grpo_config.py:391

  • Changing beta's default from 0.04 to 0.0 is a breaking change for existing users. Please document this change in the changelog or add a deprecation notice to help users migrate.
default=0.0,

@qgallouedec qgallouedec changed the title New default: beta=0.0 for GRPO 🎀 New default: beta=0.0 for GRPO May 30, 2025
@qgallouedec qgallouedec merged commit 7359ddc into main May 30, 2025
11 checks passed
@qgallouedec qgallouedec deleted the beta-0-grpo branch May 30, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants