Skip to content

fix(arena): judge failures are not lost games, and a settled run finishes - #4848

Closed
AdamRajfer wants to merge 4 commits into
NVIDIA-NeMo:arajfer/stack/budget-masksfrom
AdamRajfer:eval/lmarena-judge-failures
Closed

AdamRajfer wants to merge 4 commits into
NVIDIA-NeMo:arajfer/stack/budget-masksfrom
AdamRajfer:eval/lmarena-judge-failures

Conversation

@AdamRajfer

@AdamRajfer AdamRajfer commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Part 6 of 9, merge in order. Stacked on #4847; the diff shows only this part's changes.

What and why. A judge call that failed returned an empty judgment, which LMArena scored as a loss for the policy. In evaluation it raises JudgeError, so judge_failsafe records a retryable judge_failed row. Still failing at the attempt cap, the row stays out of the win rate and counts against max_rollout_failure_rate. Above that gate (the same one Arena-Hard-Auto applies) evaluation aggregation does not fail a run that has nothing left to retry; it publishes no score instead: the metrics carry the rate, the gate and failed_rollout_gate: true, the win rates are left out, every reward metric is null (repeated runs publish no per-repeat or across-repeat reward summaries), and one warning names the rate and the gate. A fully empty LMArena-v3 answer (no answer, no reasoning) is scored as a lost game, not as a failed rollout. compute_rollout_scores.py scores saved rollouts the same way as evaluation: an empty answer is a lost game, and past the gate it prints failed_rollout_gate and reports no score. remove_failed_rollouts.py keeps such an empty answer, as it already keeps a v3 answer stopped at the output limit; a missing judgment is still removed.

Judge failures are finalised in #4851; merge this part only together with it. On this part alone, resume re-dispatches a judge_failed row, which would give the model another answer. #4851 changes that for evaluation: the judge is retried in place on the same answer and the rollout is never re-run. After the tries, a null judgment is dropped as Arena-Hard-Auto does, and a judge that never answered is left out of the score as unresolved infra. Both count against the failed-rollout gate, never as lost games.

Methodology. LMArena's win rate is computed over the games a judge decided; a game the judge never decided is not a loss, an empty answer is a loss, and a run with too many undecided games is not published.

Eval scores. LMArena runs with judge failures that a retry clears move up (no lost games). A run past the failed-rollout gate reports no score. Runs with empty answers move down.

Training and RL: no change. The status check, the raise and the report-instead-of-raise are behind is_eval_mode(). Outside evaluation a failed judge call skips the game and a high failure rate raises, as before. Checked by test_training_keeps_a_failed_judge_call_as_a_skipped_game, which also passes against the server code before this series, and test_training_still_raises_on_a_high_failure_rate.

Unit tests. resources_servers/arena/tests/test_app.py (a failed judge call in both modes and its judge_failed kind; the gate in both modes; no repeat-level reward past the gate; settled and unsettled runs end to end; an empty answer in both modes) and resources_servers/arena/tests/test_scripts.py (saved v3 rollouts scored as evaluation; the cleanup keeps a verified empty answer).

🤖 Generated with Claude Code

…shes

A judge call that failed returned an empty judgment, which LMArena
scored as a loss for the policy. In evaluation it raises `JudgeError`,
so `judge_failsafe` records a retryable `judge_failed` row. Still
failing at the attempt cap, the row stays out of the win rate and counts
against `max_rollout_failure_rate`. Above that gate (the same one Arena-
Hard-Auto applies) evaluation aggregation does not fail a run that has
nothing left to retry; it publishes no score instead: the metrics carry
the rate, the gate and `failed_rollout_gate: true`, the win rates are
left out, the reward statistics are null, and one warning names the rate
and the gate. A fully empty LMArena-v3 answer (no answer, no reasoning)
is scored as a lost game, not as a failed rollout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@AdamRajfer AdamRajfer self-assigned this Oct 21, 2026
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

/ok to test 1a87e59

@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working labels Oct 21, 2026
@AdamRajfer
AdamRajfer changed the base branch from main to arajfer/stack/budget-masks October 21, 2026 14:48
@AdamRajfer
AdamRajfer marked this pull request as ready for review October 21, 2026 15:00

@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.

HOLD — one BLOCKER and two RISK findings remain: saved-rollout scoring disagrees with live evaluation, repeated-run reward summaries bypass the no-score gate, and cleanup can delete newly valid empty-answer losses.

Inspected all four changed files and traced judge-failure routing, aggregation, saved-rollout scoring, and cleanup consumers. Static review only; tests and suggested changes were not executed.

Note: formal approval is not available for this request, so this review is posted as a comment only.

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

Comment thread resources_servers/arena/metrics.py Outdated
# left out of the score. Only a verified answer carries policy_answer, which tells it apart from a
# judge failure or a missing rollout counted as 0.
empty_answer = (
is_eval_mode()

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.

BLOCKER — saved-rollout scoring still excludes empty answers. The documented recomputation command uses load_metrics(), which never enables evaluation mode. In a bare process, is_eval_mode() returns false. Consequently, the same v3 file containing one judged win and one verified empty answer scores approximately 0.5 live, but recomputation excludes the empty row and either raises at the default failure gate or reports approximately 1.0 with --max-failure-rate 1. This silently changes evaluation results between the supported scoring paths.

Correction: make the scoring mode explicit for saved evaluation rollouts without removing the training guard. A small suggested implementation is:

# ArenaMetrics.__init__: add a keyword-only argument and retain it.
def __init__(self, config: MetricsConfig, *, evaluation: bool | None = None) -> None:
    self.config = config
    self._evaluation = evaluation
    # existing initialization follows

# At the start of compute():
evaluation = is_eval_mode() if self._evaluation is None else self._evaluation

Use evaluation in both current mode checks, and change the offline load_metrics() return to:

return ArenaMetrics(ArenaResourcesServerConfig.model_validate(config), evaluation=True)

Required dependent change: the offline main() must return after printing diagnostics when failed_rollout_gate is true, before accessing the omitted verbosity/win-rate keys or printing a numeric mean reward. Otherwise explicitly enabling evaluation mode introduces a gate-path KeyError in that caller.

Preservation/acceptance — proposed checks: outside any global Gym configuration, load_metrics('lmarena_v3', 1.0).compute([[win], [empty]]) must match live evaluation: raw and controlled win rates approximately 0.5, failure rate 0. The existing training case must retain raw win rate approximately 1.0 and failure rate 0.5. A genuine missing/unparseable judgment must still count against the gate; offline CLI aggregation above that gate must finish with diagnostics and no numeric score. Retain v3 truncation/reasoning-only zero scores and the existing v2 behavior. Suggested code requires author verification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 4d72024 (fix(arena): score saved evaluation rollouts as evaluation, not training), with a test that fails without the fix.

)
if failure_rate_exceeded:
# Withhold every headline: no win rate, and the reward statistics the profiler computed are nulled.
metrics.update({f"{stat}/reward": None for stat in _REWARD_STATS})

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.

RISK — repeated evaluations still publish numeric reward summaries past the gate. This nulls only five full-run keys. Before this hook runs, RewardProfiler creates repeat summaries and merges their aggregates; compute_aggregate_metrics() then preserves those collections. Arena does not override the repeat hook, so nothing removes them. For two tasks with two repeats each—one task winning both repeats and the other containing counted judge failures—the gate is true and mean/reward is null, but mean_across_repeats/mean/reward and both repeat-level means remain 0.5. These run-level summaries are also exported as metrics, contrary to the no-score contract.

Correction: apply Arena's invalid-score policy after shared aggregation has produced its complete result. A suggested Arena-only override, with AggregateMetrics and AggregateMetricsRequest imported from nemo_gym.config_types, is:

async def aggregate_metrics(self, body: AggregateMetricsRequest) -> AggregateMetrics:
    result = await super().aggregate_metrics(body)
    if result.agent_metrics.get("failed_rollout_gate"):
        for metrics in (result.agent_metrics, result.key_metrics, *result.repeat_level_metrics):
            for name in metrics:
                if name.endswith("/reward"):
                    metrics[name] = None
    return result

This covers full-run and cross-repeat reward summaries and their repeat-level inputs, without changing other benchmarks or raw rollout evidence.

Preservation/acceptance — proposed checks: aggregate the two-task/two-repeat setup above through server.aggregate_metrics(), not only compute_metrics(). Assert the gate is true, win-rate keys are absent, and every run/repeat reward-summary value is null, including cross-repeat confidence intervals. Token/performance summaries and failure diagnostics must remain available. Repeat the setup below the gate and retain numeric reward/repeat statistics and win rates; training above the gate must still raise. Generation-only reporting must remain unchanged. Suggested code requires author verification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0ee2fe1 (fix(arena): withhold the repeat-level reward summaries past the failed-rollout gate), with a test that fails without the fix.

and "policy_answer" in rollout
and not response
and not reasoning
and rollout.get("games") is None

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.

RISK — the cleanup command deletes these newly valid losses. A verified v3 row with policy_answer=None, policy_reasoning=None, and games=None now contributes a legitimate zero score here. However, is_failed_rollout() still removes every non-truncated row without two games. Running the documented cleanup utility followed by resume therefore deletes and regenerates an actual policy loss rather than retrying an infrastructure failure; a stochastic replacement can change the published score.

Correction: update the evaluation cleanup contract alongside this classification. For v3 evaluation rows, preserve a verified fully empty answer while continuing to remove genuinely missing judgments. The matching guard, before the games check, is:

if (
    row.get("category") == "lmarena_v3"
    and "policy_answer" in row
    and not row["policy_answer"]
    and not row.get("policy_reasoning")
    and row.get("games") is None
):
    return False

Apply this only to evaluation cleanup semantics. If this utility must also retain training-mode cleanup behavior, expose an explicit mode/provenance choice: saved empty training and evaluation rows otherwise have identical fields, so their mode cannot safely be inferred from games=None alone.

Preservation/acceptance — proposed checks: cleanup must retain the verified empty v3 evaluation row byte-for-byte, and subsequent resume must not dispatch it again. Preserve the existing test_missing_games_is_removed assertion for a row containing only category and games=None; a judge-failure row lacking policy_answer, a nonempty answer with missing/unparseable judgments, and a v2 empty answer must still be removable. Existing self-comparison and v3 max_output_tokens preservation must remain intact. If training cleanup is supported, explicitly test that its empty-answer row remains removable. Suggested predicate requires author verification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 406f358 (fix(arena): keep a verified empty v3 answer when removing failed rollouts), with a test that fails without the fix.

AdamRajfer and others added 3 commits October 21, 2026 19:44
Bot finding 4339048150, PR NVIDIA-NeMo#4848 (part 6, LMArena). compute_rollout_scores.py recomputes saved
rollouts in a bare process, where is_eval_mode() is false, so it excluded a verified empty v3 answer
(a lost game in evaluation) and reported a different win rate than the live run. ArenaMetrics takes
an explicit evaluation flag, which the offline loader sets; the server keeps reading is_eval_mode(),
so training is unchanged. Past the failed-rollout gate the script prints its diagnostics and stops,
since no win rate is published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
…d-rollout gate

Bot finding 4339048172, PR NVIDIA-NeMo#4848 (part 6, LMArena). Past the gate the full-run reward statistics
were nulled, but repeated evaluations also publish mean_across_repeats/... and the per-repeat
reward means, built by the shared profiler, so a run with no score still published reward numbers.
Arena's aggregate_metrics now nulls every reward metric and drops the repeat-level ones once the
gate trips. Below the gate, and in training (where the gate raises), nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
…outs

Bot finding 4339048185, PR NVIDIA-NeMo#4848 (part 6, LMArena). An empty LMArena-v3 answer is now a scored
lost game in evaluation, but remove_failed_rollouts.py still removed every row without two games,
so the documented cleanup plus resume deleted and regenerated a real policy loss. It keeps that
row, as it already keeps a v3 answer stopped at the output limit; a missing judgment is still
removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 21, 2026 17:46
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the needs-review PR is ready for code review and waiting on a reviewer label Oct 21, 2026

@laszkiewiczp laszkiewiczp 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.

I have doubts regarding the methodology. Imagine that the evaluated model produces a long answer that should be judged as a lost game in arena because the model ran into some long generation producing rubbish outputs. When passing this long answer to the judge, it can occur that we will exceed the judge's context. The judge failure will then lead to repeating the whole rollout and there is a chance that this time the evaluated model will produce a better answer. This makes us biased towards good rollouts.

I would change this PR so that not rollouts but judge calls are repeated on errors. We can ask @jveronvialard for his opinion on that.

@AdamRajfer

Copy link
Copy Markdown
Contributor Author

@laszkiewiczp you were right: re-running the rollout for a judge failure gave the model a second answer. Fixed in #4851, and this part now merges only together with it.

  • The judge call is retried in place on the byte-identical request, so on the stored answer, up to 3 tries with backoff. A judge failure never re-dispatches the rollout (b3e5ee9, a2e3da4, 89ef059).
  • After the tries, by cause (c477c6d, 00334ae, 6ee9d6b, 188a1cb):
    • text with no verdict on every try: arena drops the null judgment, as Arena-Hard-Auto does (218d110); math_with_judge scores it wrong, as NeMo-Skills does (7657468);
    • the judge never answered (an empty reply, a rate limit, any HTTP or transport error): unresolved infra, left out of the score and counted, and the run is not publishable above 2%.
  • Your example, an answer that overflows the judge's context in arena, is a failed judge call: it is retried on the same answer, then left out of the win rate and counted against the failed-rollout gate. It is never re-run, so no second answer can replace it.
  • A failure at verification, after the answer exists, is never re-dispatched either (cff5796).

Tests: TestJudgeRetriedInPlaceOnTheSameAnswer (byte-identical retries), TestAJudgeFailureNeverReRunsTheRollout, and arena's test_a_judge_failure_is_retried_in_place_on_the_same_answer and test_a_null_judgment_at_the_cap_is_dropped_as_arena_hard_auto_does.

@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Oct 22, 2026
@AdamRajfer

Copy link
Copy Markdown
Contributor Author

Closing this version to consolidate review on #5072 (failure reporting) and #5073 (saved-state recovery). This does not mean those PRs implement every proposal from this earlier stack; scoring policy and persistence follow-ups remain separate.

@AdamRajfer AdamRajfer closed this Oct 26, 2026

This branch was previously deployed

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

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants