Skip to content

fix(math-with-judge): select the last explicit verdict - #4155

Merged
ananthsub merged 2 commits into
mainfrom
codex/math-judge-last-verdict
Oct 8, 2026
Merged

ananthsub merged 2 commits into
mainfrom
codex/math-judge-last-verdict

Conversation

@Kipok

@Kipok Kipok commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

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 #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 (#3095) and its discussion were reviewed; answer extraction and formatting rules remain unchanged.

@Kipok Kipok added bug Something isn't working area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers labels Oct 7, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 7, 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.

@Kipok
Kipok marked this pull request as ready for review October 7, 2026 00:57
@yaoyu-33 yaoyu-33 added complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer labels Oct 7, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 8, 2026
bxyu-nvidia
bxyu-nvidia previously approved these changes Oct 8, 2026
@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 48bb6c3

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

/ok to test 48bb6c3

@bxyu-nvidia, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 48bb6c3

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

/ok to test 48bb6c3

@bxyu-nvidia, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 48bb6c3

@bxyu-nvidia
bxyu-nvidia enabled auto-merge October 8, 2026 16:45
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 8, 2026 16:45
@bxyu-nvidia
bxyu-nvidia added this pull request to the merge queue Oct 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 8, 2026
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 8, 2026
@bxyu-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 9907944

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37828103207

Merged via the queue into main with commit abd6f4b Oct 8, 2026
41 of 44 checks passed
@ananthsub
ananthsub deleted the codex/math-judge-last-verdict branch October 8, 2026 19:09

This branch was previously deployed

1 inactive deployment
public — 9907944b Deployed Oct 8, 2026 by copy-pr-bot[bot] via release / finalize / notify #4770
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working complexity:low Localized change in one scope with a small, straightforward review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants