fix: token mult prob error plot masking#2485
Open
1ytic wants to merge 1 commit into
Open
Conversation
Signed-off-by: Ivan Sorokin <27285181+1ytic@users.noreply.github.com>
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 the
token_mult_prob_errordebug plot so it does not select fully masked samples and labels the recomputed policy logprobs accurately.Issues
N/A
Usage
N/A. This is a logging/debug-plot fix.
Before your PR is "Ready for review"
Pre checks:
Additional Information
The plot previously computed the per-sequence multiplicative probability error after applying
sample_mask, but still allowed rows with zero valid tokens to participate inargmax. Fully masked rows therefore produced0 / 0 = nan, and the plot could showtoken_mult_prob_error=nan.The orange logprob line was also labeled as
reference policy, but the data comes fromprev_logprobs, i.e. the training policy recomputation used for GRPO's behavior-policy comparison, not the frozen reference policy.Before fix, the debug plot could select a fully masked sequence and show both symptoms:
After fix, the plot selects an unmasked sequence, reports a finite
token_mult_prob_error, and labels the orange line as the training policy recompute: