Repository navigation
fix(math-with-judge): accept whitespace in verdict markers - #4151
Merged
Merged
Conversation
Signed-off-by: Igor Gitman <[email protected]>
Kipok
marked this pull request as ready for review
October 7, 2026 00:57
bxyu-nvidia
approved these changes
Oct 8, 2026
Contributor
|
/ok to test cc99e97 |
@bxyu-nvidia, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
bxyu-nvidia
enabled auto-merge
October 8, 2026 16:43
Contributor
|
/ok to test cc99e97 |
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37813276672 |
ananthsub
pushed a commit
to jiwasawa/Gym
that referenced
this pull request
Oct 8, 2026
) ## Summary Use the last recognized `[[A=B]]` / `[[A!=B]]` marker in the existing final `output_text` block instead of the first. This allows explicit judge self-corrections such as `different [[A!=B]] ... Final: [[A=B]]` to determine the per-call verdict. This is an intentional scoring-policy change, separate from whitespace normalization in NVIDIA-NeMo#4151. It targets current main independently; it does not include that patch or change the accepted marker syntax. Both changes can compose: normalize the selected text, then select the last marker. ## Preserved behavior - Only the existing last message / last output-text block is parsed. Reasoning items are not scanned; this does not concatenate earlier messages or content blocks. - No recognized marker still means unequal. Single-marker and repeated-identical-marker answers keep their meaning. - The two-order agreement rule is unchanged. If the first-order verdict becomes positive, Gym must perform the reverse-order call; a negative or missing reverse verdict still yields zero. - Stored judge responses remain unchanged. No saved profiles or historical scores are rewritten. Conflicting-marker responses can now change the reward or the number of judge calls. In particular, a saved negative-first response cannot simply be rescored positive offline if its reverse-order evaluation is missing. Pin the Gym revision when comparing benchmark results. ## Validation - 36 math environment tests passed on Python 3.13.14, using the existing math environment venv and explicitly binding the resources-server namespace to this worktree (verified implementation path). - Updated the two existing first-marker expectations and added tests for both correction directions, both reverse-check outcomes, corrections in the reverse response, repeated identical markers, missing markers, ignored reasoning summaries, raw-text preservation and swapped answer order. - Replayed two saved real-model self-corrections through the changed parser: both per-call decisions change from negative to positive, with unchanged response objects. No model calls or final two-order reward claims were made in that replay. Private prompts and records are not included in this PR. - `pre-commit run --all-files`: passed after formatting. - `git diff --check`: passed. Draft for author review. A fresh real-model smoke on this revision remains outstanding before marking ready; offline replay and unit tests are not a substitute. This focused PR serves as the change proposal, so no separate issue is needed. Prior math parsing work (NVIDIA-NeMo#3095) and its discussion were reviewed; answer extraction and formatting rules remain unchanged. Signed-off-by: Igor Gitman <[email protected]>
This was referenced Oct 12, 2026
This branch was previously deployed
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.
Summary
Accept whitespace inside the existing
[[A=B]]and[[A!=B]]math-judge markers. Normalize only a temporary parsing string, leaving stored judge responses unchanged. Keep the existing first-marker rule and two-direction agreement requirement.This is a focused parser bug fix; no separate issue is needed. Well-formed markers retain their behavior. Spaced equal markers can now trigger the reverse check, so affected scores can change. This does not add fuzzy verdict matching or normalize other environments' verdict formats.
Validation
tests/unit_tests/test_judge.pyandresources_servers/math_with_judge/tests/test_app.pyon Python 3.13.14.pre-commit run --all-files: passed.git diff --check: passed.Draft for author review. The change originated from offline profiling; no fresh real-model smoke was launched against this rebased revision. That validation remains required before marking ready. No private data or deployment paths are included.