Repository navigation
Fix math with judge parsing and formatting - #3095
Merged
Merged
Conversation
Signed-off-by: Sadegh Mahdavi <[email protected]>
bxyu-nvidia
approved these changes
Sep 4, 2026
Contributor
|
/ok to test b85239f |
cmunley1
approved these changes
Sep 4, 2026
jkyi-nvidia
pushed a commit
that referenced
this pull request
Sep 11, 2026
<!-- Thanks for contributing to NeMo Gym! Please fill out the sections below. --> ## What does this PR do? * Forces having \boxed values in the response. * Passes the value inside \boxed to the judge instead of the parsed sympy value. ## Checklist - [x] I have read the [contributing guidelines](https://docs.nvidia.com/nemo/gym/latest/contribute/development-setup). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format/copyright pass). - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). Signed-off-by: Sadegh Mahdavi <[email protected]> Signed-off-by: Junkeun Yi <[email protected]>
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]>
6 tasks
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.
What does this PR do?
Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).