Repository navigation
Conversation
math-verify scores earlier \boxed{} spans near the final one as a set, so a
correct final box after a different earlier box got reward 0. Pass only the
last complete box to the library, same answer the no-answer guard and the
judge already use.
Fixes NVIDIA-NeMo#4514
Signed-off-by: Ankit Jha <[email protected]>
This branch has not been 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?
Fixes #4514. Also tracked in the NVBugs queue #4482 (NVBug 6899737).
_verify_answeralready pulls out the last complete\boxed{}for the no-answer guard and the judge, but it still passed the whole response to math-verify. math-verify keeps earlier boxes that sit close to the final one and scores them as a set, so\boxed{5}then\boxed{-3}with gold-3came back as{-3, 5}with reward 0. Multi-message agents hit this becauseverify()joins messages with"", and a single message that corrects itself can hit it too.Now the library gets only
\boxed{<last box>}, so math-verify, the guard and the judge all look at the same answer. The unboxed fallback underformat_tolerant_answer_extractionis unchanged; it already passes only the selected span.Other servers that override
_verify_answerstill send the full text to math-verify and likely have the same issue:physics_judge,math_with_autograderandugphysics_judge(ugphysics_judgealso joins messages with""). I left them alone to keep this focused, sincephysics_judgeandugphysics_judgesay they mirror the Skills pipeline. Happy to follow up if you want them aligned.polymathcallssuper().verify()and picks up the fix.Validation
test_verify_grades_only_final_boxed_answer, run throughverify()with the real math-verify (no mocks), gold-3:\boxed{5}then\boxed{-3}in two messages: 1.0 (was 0.0)\boxed{-3}then\boxed{5}: 0.0, extracted5(was{-3, 5})First \boxed{5}. Wait, that is wrong: \boxed{-3}: 1.0 (was 0.0)test_verify_answermock assertion, which now expects the boxed answer instead of the full textpytest resources_servers/math_with_judge/tests: 140 passedpytest resources_servers/polymath/tests: 10 passedpre-commit run --fileson the two changed files: passedRollouts
N/A. Verifier-only change; the tests run the production math-verify path on fixed inputs, so no model is needed to show the reward change.
Compatibility and benchmark impact
Rewards can change both ways for responses with more than one
\boxed{}. A correct final box after a different earlier one now scores 1. A response that puts parts of one answer in separate boxes (for example\boxed{3}, \boxed{4}for gold3,4) is now graded on the last box only and drops to 0. That matches how the judge path already reads the answer. Single-box and no-box responses are unchanged.Suggested labels:
bug,area:environment.Checklist
pre-commit run --all-files) (so CI lint/format checks pass). Ran on the changed files.git commit -s) (so the DCO check passes).