[fix][train] Fix advantage response masking for step wise training #1506
Closed
[fix][train] Fix advantage response masking for step wise training #1506
Conversation
Add return_raw_scores flag to compute_advantages so raw per-token scores are preserved before masking. Wire through trainer and add unit tests covering step-wise advantage masking behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…o [N, seqlen] - GAE: add return_raw_scores flag; apply response_mask to advantages (skipped when return_raw_scores=True) for consistency with other estimators - GRPO/RLOO/MAXRL: expand [N,1] scores to [N, seqlen] via expand_as when return_raw_scores=True, so the step-wise trainer receives uniform shapes - Parametrize step-wise trainer test over all 5 estimators - Add unit test asserting return_raw_scores=True yields [N, seqlen] for all estimators - Update docstrings with return_raw_scores documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Closing in favour of #1507 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #1492