-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Entropy Control to GRPOTrainer #3628
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
base: main
Are you sure you want to change the base?
Conversation
|
Note that there is a parallel PR (#3563) working on entropy based filtering, we're going to need to sync these |
Tgt ent control
Yes, I also think it might be better to use a global scheduler to schedule the update of entropy coef based on global entropy loss gathered from all ranks. I took a look at the original code of skywork and think that it might be using a per rank scheduler to control entropy coef. If you have time, could you please help confirm it? The entropy loss apply entropy coef: https://github.com/SkyworkAI/Skywork-OR1/blob/64e96afa213ae89d0ad21932106d3b8aafe9ace2/verl/workers/actor/dp_actor.py#L234 The entropy controller defined inside trainer |
|
@qgallouedec would appreciate your thoughts on dealing with the stateful entropy coefficient. To recap, Adaptive Entropy Control maintains the entropy coefficient |
I have submitted an initial update My comment: @LeonEricsson what do you think of my suggested approach of only using global entropy loss but keep per rank entropy scheduler? The entropy coef computation could be scattered in each rank but not blocked by main process. Besides, given each rank computes entropy coef based on global entropy loss, the entropy coef in each rank might be updated almost in the same path |
|
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. |
| @@ -185,6 +185,48 @@ def __len__(self) -> int: | |||
| return (self.num_samples // self.batch_size) * self.batch_size * self.mini_repeat_count * self.repeat_count | |||
|
|
|||
|
|
|||
| class EntropyController: | |||
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 don't think this controller is needed. Maybe it's simpler with only attributes in GRPO?
What does this PR do?
Fixes # (3320)
#3320
The initial step is to support static entropy control
Next step is to support adaptive entropy control
Before submitting
Pull Request section?
to it if that's the case.
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.