Skip to content

fix: token mult prob error plot masking#2485

Open
1ytic wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
1ytic:codex/fix-token-mult-prob-error-plot
Open

fix: token mult prob error plot masking#2485
1ytic wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
1ytic:codex/fix-token-mult-prob-error-plot

Conversation

@1ytic

@1ytic 1ytic commented May 13, 2026

Copy link
Copy Markdown

What does this PR do ?

Fixes the token_mult_prob_error debug 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:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

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 in argmax. Fully masked rows therefore produced 0 / 0 = nan, and the plot could show token_mult_prob_error=nan.

The orange logprob line was also labeled as reference policy, but the data comes from prev_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:

Before fix: token_mult_prob_error is nan and the mislabeled reference policy line is flat

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:

After fix: token_mult_prob_error is finite and the orange line is labeled training policy recompute

Signed-off-by: Ivan Sorokin <27285181+1ytic@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented May 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@1ytic 1ytic marked this pull request as ready for review May 14, 2026 10:06
@1ytic 1ytic requested review from a team as code owners May 14, 2026 10:06
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.

1 participant