Repository navigation
fix(arena): judge failures are not lost games, and a settled run finishes - #4848
AdamRajfer wants to merge 4 commits into
Conversation
…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]>
|
/ok to test 1a87e59 |
|
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. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
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.
| # 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() |
There was a problem hiding this comment.
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._evaluationUse 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.
There was a problem hiding this comment.
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}) |
There was a problem hiding this comment.
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 resultThis 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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 FalseApply 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.
There was a problem hiding this comment.
Fixed in 406f358 (fix(arena): keep a verified empty v3 answer when removing failed rollouts), with a test that fails without the fix.
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]>
laszkiewiczp
left a comment
There was a problem hiding this comment.
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.
|
@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.
Tests: |
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, sojudge_failsaferecords a retryablejudge_failedrow. Still failing at the attempt cap, the row stays out of the win rate and counts againstmax_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 andfailed_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.pyscores saved rollouts the same way as evaluation: an empty answer is a lost game, and past the gate it printsfailed_rollout_gateand reports no score.remove_failed_rollouts.pykeeps 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_failedrow, 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 bytest_training_keeps_a_failed_judge_call_as_a_skipped_game, which also passes against the server code before this series, andtest_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 itsjudge_failedkind; 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) andresources_servers/arena/tests/test_scripts.py(saved v3 rollouts scored as evaluation; the cleanup keeps a verified empty answer).🤖 Generated with Claude Code