Repository navigation
fix(arena): treat a judge game with no verdict as a judge failure - #5866
Conversation
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
left a comment
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
|
/ok to test e13886e |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42821503280 |
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.verifynow raisesJudgeErrorwhen either game has no verdict, and the message names the game and the judge's stop reason (for examplejudge output incomplete: max_output_tokens).judge_failsafeturns that into the existing typed outcome: a row withfailure_kind: judge_failed,mask_sample: trueand 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_gameis unchanged, so historical rows that carry aNoneverdict 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.JudgeErrorwith the expected reason; throughjudge_failsafethe row isjudge_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 previousapp.py.ruff checkandruff formatclean.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_v3andvision_arena_v1scores 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 finaljudge_failedrow, which the run's health check counts, instead of a silent loss. Only the README line formean/rewardis updated.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).