Skip to content

fix(arena): treat a judge game with no verdict as a judge failure - #5866

Merged
AdamRajfer merged 1 commit into
NVIDIA-NeMo:mainfrom
AdamRajfer:fix-arena-judge-failed
Nov 10, 2026
Merged

AdamRajfer merged 1 commit into
NVIDIA-NeMo:mainfrom
AdamRajfer:fix-arena-judge-failed

Conversation

@AdamRajfer

Copy link
Copy Markdown
Contributor

What does this PR do?

In arena, a judge game that produced no verdict (the judge output was cut at its token cap, filtered by the provider, empty, or held no verdict label) was scored as a policy loss and averaged with the other game. A judge fault therefore became a model result: a row whose other game was a tie or a win came out at 0.5, and a row with no verdict in either game at 0.0.

verify now raises JudgeError when either game has no verdict, and the message names the game and the judge's stop reason (for example judge output incomplete: max_output_tokens). judge_failsafe turns that into the existing typed outcome: a row with failure_kind: judge_failed, mask_sample: true and reward 0.0 that keeps the policy answer, so it is excluded from the metrics, retried within the run's budget, and can be re-judged with the stateless reverification Arena already supports. Genuine verdicts (win, tie, loss, both bad) are scored exactly as before. _run_judge_game is unchanged, so historical rows that carry a None verdict are still read by the metrics as before.

Not changed: arena_judge (Arena-Hard v2) keeps its own invalid-verdict accounting, which follows the upstream Elo script by skipping invalid games.

Validation

  • pytest resources_servers/arena: 191 passed; pytest tests/unit_tests/test_public_api_facades.py: 846 passed.
  • New tests: no label in either game, an output cut at the token cap in one game, and a content-filtered empty reply each raise JudgeError with the expected reason; through judge_failsafe the row is judge_failed, masked, and keeps the policy response; genuine verdict pairs keep their scores (1.0, 0.5, 0.5 for both bad, 0.0, 0.5). The four failure tests fail against the previous app.py.
  • ruff check and ruff format clean.

Rollouts

N/A: unit tests on mocked judge replies; no judge was called.

Compatibility and benchmark impact

Rows that previously scored a no-verdict game as a loss are now masked, retried, and re-judgeable, so lmarena_v2, lmarena_v3 and vision_arena_v1 scores can rise where a judge cut or filtered reply was counted against the policy. A judge that fails on the same input every time ends as a final judge_failed row, which the run's health check counts, instead of a silent loss. Only the README line for mean/reward is updated.

Checklist

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

When a judge game produced no verdict (its output was cut at the token
cap, filtered, empty or held no label), the game was scored as a policy
loss and averaged with the other game. A judge fault was therefore
counted as a model result: a row whose other game was a tie or a win
came out at 0.5, or at 0 when both games lacked a verdict.

verify now raises JudgeError when either game has no verdict, with the
judge's stop reason in the message. judge_failsafe turns that into a
masked row typed judge_failed that keeps the policy answer, so it is
excluded from the metrics, retried, and can be judged again. Genuine
verdicts (win, tie, loss, both bad) are scored as before.

Signed-off-by: Adam Rajfer <[email protected]>

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE

RISK — Add the required rollout and before/after profiling evidence

The new verification branch changes the scored population for LMArena v2/v3 and Vision Arena: a no-verdict game now excludes the whole row instead of contributing a loss. The PR reports only mocked replies and explicitly says no judge was called. The review rubric requires before/after reward-profiling evidence for fixed-benchmark verifier changes, and AGENTS.md requires representative real smoke rollouts. That evidence is missing; this isn't a demonstrated implementation defect.

Correction and acceptance: Please attach representative live model/judge rollout evidence and a base/head comparison using matching prepared inputs and policy/judge settings, preferably reusing saved policy answers. Report the configurations and sample size, mean/reward, win_rate_no_SC, win_rate, no-verdict counts, and masked/final-failure counts. Explain the intended shift separately from judge variance, and inspect the saved policy answer and judge artifacts. No source rewrite is needed for this finding.

Preservation: Confirm that genuine verdict pairs retain their scoring: wins 1.0, ties and [[BB]] 0.5, losses 0.0, and the existing v2 strong-win-plus-tie case 0.875. No-verdict rows should become masked judge_failed outcomes retaining the policy response. Keep the new failure regressions and existing score assertions. These are requested checks, not executed results.

I inspected all three changed files and the affected failure-routing, masking, metric, and reverification contracts. I found no implementation defect in those paths. This was a source-only review; I didn't independently run the reported pytest or Ruff checks.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

assert "game 2 (judge output incomplete: max_output_tokens)" in data["failure_reason"]
assert data["response"] == request.response.model_dump(mode="json") # kept for re-judging

@mark.parametrize(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE — Suggestion: keep only the distinct mixed-ordering preservation case.

Four parameter rows repeat assertions already covered by the existing win test, loss and tie tests, and both-bad test. Those also exercise verify() through parsed mocked replies. Repeating them adds maintenance without a distinct scoring check; the final same-label pair usefully checks opposite policy outcomes across the two positions.

Replace the parameterization and method at lines 857–873 with:

    async def test_verify_opposing_verdicts_keep_their_score(self, server: ArenaResourcesServer):
        self._setup_judge_texts(server, ["[[A>B]]", "[[A>B]]"])

        result = await server.verify(self._make_verify_request("Answer."))

        assert result.reward == approx(0.5)
        assert all(game.verdict is not None for game in result.games)

Preserve the existing win 1.0, loss 0.0, tie 0.5, both-bad 0.5, and strong-win-plus-tie 0.875 assertions, plus the new no-verdict tests. Acceptance is that those remain covered and this mixed-ordering case returns 0.5 with two parsed verdicts. This is a maintenance suggestion, not a correctness failure; verify the replacement before adopting it. I haven't executed it.

@AdamRajfer
AdamRajfer enabled auto-merge November 9, 2026 21:40
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test e13886e

@AdamRajfer
AdamRajfer added this pull request to the merge queue Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Merged via the queue into NVIDIA-NeMo:main with commit c857c45 Nov 10, 2026
101 checks passed
@AdamRajfer
AdamRajfer deleted the fix-arena-judge-failed branch November 10, 2026 13:22

This branch was previously deployed

1 inactive deployment
public — e13886e5 Deployed Nov 9, 2026 by copy-pr-bot[bot] via release / finalize / notify #11083
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.

3 participants