Repository navigation
fix(omniscience): treat a judge reply without a grade as a judge failure - #6541
Conversation
… the metric formulas The shipped tests only exercise the Responses judge path, while resources_servers/omniscience/configs/omniscience.yaml selects Chat Completions. They also leave the metric formulas and two failure paths unpinned. These tests add: - the Chat Completions judge request: endpoint, max_tokens, temperature and top_p come from the config, and the prompt carries the question; - an empty judge reply raises JudgeError instead of being graded; - an unclosed <thinking> block is an empty answer, as <think> already is; - compute_metrics() and the key metrics against the AA-Omniscience formulas: index = 100 * (correct - incorrect) / n, hallucination = 100 * incorrect / (n - correct). Test only. No production code changes. Signed-off-by: Mahan Fathi <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
A judge reply with no unambiguous grade was counted as INCORRECT (index -1) and never graded again, because omniscience does not take part in the end-of-run re-judge pass. It now raises JudgeError, so the row is masked and graded again from its saved answer, like an empty judge reply. The parser follow-ups from the NVIDIA-NeMo#5783 review: - an explicit verdict counts only when the rest of its line is empty, closing punctuation or a short reason (because, since, based on, -, (); - Grade and Verdict need a separator, as Answer already does; - leftover think tags are checked before the last-line rule; - ':' is no longer a wrapper of the last line (a lone "B:" is not a grade); - the Chat Completions judge path strips think blocks like the Responses path. Tests: the reply shapes listed in the NVIDIA-NeMo#5783 review, the two surviving mutants (upper-case think tag, label without separator), a Chat Completions judge reply with a think block, a judge reply without a grade, and the TaskData/OmniscienceRunRequest field agreement asked for in NVIDIA-NeMo#5891. The Chat Completions judge request, the unclosed <thinking> block and the index and hallucination formulas are covered by the previous commit. The score-triage note now describes the parser as it is. Co-Authored-By: Claude Opus 5.5 <[email protected]> Co-Authored-By: Claude Sonnet 5.5 <[email protected]> (cherry picked from commit 56e1b2f24aacf6928239d59454ed1aabc3e89e5b) Signed-off-by: plaszkiewicz <[email protected]>
|
/ok to test cfe9cb1 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
RISK: Add live smoke validation for the changed judge path. The PR reports no new rollouts. Replaying 9,000 saved replies is useful before/after parser evidence, but it does not exercise the changed Chat Completions preprocessing or verification failure handling through a running environment. The trusted quality bar requires representative real smoke rollouts for behavior-changing environment work, so that integration is still unvalidated.
Could you run a small representative smoke evaluation on the final code and record the policy model, judge configuration, scored and failed row counts, and inspected verifier results? Keep the saved-reply comparison and deterministic malformed-reply tests. Acceptance is a completed live run where inspected ordinary letter verdicts map to the expected scores, with any judge failures reported separately rather than counted as incorrect. No production-code rewrite is requested for this evidence gap.
The inline findings cover incomplete schema-drift enforcement and an inaccurate parser note. I found no additional correctness defect in the judge-failure recovery path.
This was static inspection; I did not execute tests. One delegated parser report was unavailable, so I inspected that topic directly.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
mahanfathi
left a comment
There was a problem hiding this comment.
Approving. This implements the follow-up list from my #5783 review as asked, and the first commit is my test patch unchanged (same patch-id). Please take request 1 before merging. The other requests are small, and none of them needs another look from me.
What I ran (GitHub main 2b21a40c merged with this head cfe9cb12, on a compute node)
| Check | Result |
|---|---|
pytest resources_servers/omniscience/tests |
137 passed |
pytest tests/unit_tests/benchmarks/test_omniscience_prepare.py |
6 passed |
| ruff check, ruff format, pre-commit on the three files | clean |
441 judge replies through verify() on main and on this branch |
6 get a verdict the judge did not give (request 1 and the cut-off item at the end) |
gym eval run against a local stub judge, 15 questions x 2 |
a row with no grade is judged again once (below) |
gym eval run, 12 questions, Nemotron 3.5 Lightning, GPT-5.6 Luna (medium) judge |
12 of 12 graded, 0 judge failures |
| 45,024 saved judge replies from 20 runs | 45,018 are bare letters; 3 replies change, from incorrect to a judge failure |
The 441 replies are my #5783 tables plus new ones aimed at the new rules.
- 171 keep their verdict.
- 159 were an unparsed B on
main, counted as incorrect, and are judge failures now. - 93 had a recorded verdict on
mainand are judge failures now. These are the shapes the four parser rules target. - 8 were an unparsed B on
mainand are now graded from the text after the think block. - 3 are empty and fail on both.
- 5 were an unparsed B on
mainand get a recorded verdict here because another line was skipped. In 4 of them it is the opposite of what the judge wrote (request 1). - 2 were a recorded B on
mainand are a recorded A here (the cut-off item at the end).
The stub run. The stub judge answers by class: a bare letter; Grade: A. The answer matches the reference. and then A; prose and then D; prose every time.
- On
main: 30 judge calls for 30 rollouts. A prose reply counts as incorrect and is never asked again. - On this branch: 18 rollouts fail on the first pass and are judged again once, from their saved answers, at the end of the run (48 judge calls). 12 get a grade and are scored. The 6 that get prose again are left out of every metric:
24 completed, 6 failed (6 masked, not scored as zero). - So "masked and graded again from its saved answer" holds end to end.
Requests
-
A verdict line with a tail that is not accepted is skipped, so another line can decide the grade. That is the one place where this branch accepts more than
main.mainleft these replies as an unparsed B. This branch records the opposite of what the judge wrote:Judge reply (two lines) mainThis branch CORRECT (A) requires a full match./Grade: B. The predicted answer differs.unparsed B A, recorded Grade: B — the year differs./CORRECT (gold): 1989unparsed B A, recorded INCORRECT. The predicted answer gives 1990./CORRECT (gold target) is 1989.unparsed B A, recorded A small change closes all three: the skipped line still does not count, but its letters must agree with the grade the other lines give. With it the three replies are judge failures,
INCORRECT. The predicted answer names another county.followed byGrade: Bstays B, and the 137 tests pass, with ruff and pre-commit clean. The cost is thatCORRECT answer would be 1989, but the model said 1990.followed byGrade: Bbecomes a judge failure.maindid not accept that reply either. The fourth reply,CORRECTfollowed byVerdict INCORRECT, stays a recorded A: without a separator the second line is no longer a verdict line.The change, as a patch for this head (
git apply)diff --git a/resources_servers/omniscience/app.py b/resources_servers/omniscience/app.py index 6dae9e3..0089c1a 100644 --- a/resources_servers/omniscience/app.py +++ b/resources_servers/omniscience/app.py @@ -168,6 +168,7 @@ def parse_judge_grade(judge_text: str) -> str | None: return last_line candidates: set[str] = set() + suspects: set[str] = set() for line in cleaned.splitlines(): clauses = line.split(";") first = _EXPLICIT_GRADE_RE.match(clauses[0]) @@ -183,17 +184,20 @@ def parse_judge_grade(judge_text: str) -> str | None: # A malformed alternative must not turn a matching prefix into a completed grade. if any(_UNPARSED_ALTERNATIVE_RE.match(rest) for rest in rests): return None - if not _VERDICT_TAIL_RE.match(rests[0]): - continue # Prose that starts like a verdict ("CORRECT answer would be ...") is not one. - if not all(_VERDICT_TAIL_RE.match(rest) for rest in rests[1:]): - return None + letters: set[str] = set() for match in matches: if letter := match.group("letter"): - candidates.add(letter) - candidates.update( + letters.add(letter) + letters.update( _GRADE_KEYWORDS.get(token, token) for token in _GRADE_TOKEN_RE.findall(match.group("grades")) ) - if len(candidates) == 1: + if not _VERDICT_TAIL_RE.match(rests[0]): + suspects |= letters # Not a verdict on its own, but it may contradict one. + continue + if not all(_VERDICT_TAIL_RE.match(rest) for rest in rests[1:]): + return None + candidates |= letters + if len(candidates) == 1 and suspects <= candidates: record_parsed_judge_verdict() return candidates.pop()
-
Tests for the tail rules. Removing the check for later verdicts on a line passes all 137 tests:
if not all(_VERDICT_TAIL_RE.match(rest) for rest in rests[1:]): return None
The rows below pass with the change of request 1. Rows 4 to 6 fail on this head; they are its regression tests. With these rows and the
match=below, 11 one-line mutants that pass the 137 tests fail a test.@pytest.mark.parametrize( "text, expected", [ ("Grade: B; Verdict: B would be too harsh", None), ("Grade: B; Verdict: B; Grade: B is too harsh", None), ("Grade: B; Verdict: B would be too harsh\nGrade: A", None), ("CORRECT (A) requires a full match.\nGrade: B. The predicted answer differs.", None), ("Grade: B — the year differs.\nCORRECT (gold): 1989", None), ("CORRECT answer would be 1989, but the model said 1990.\nGrade: B", None), ("INCORRECT. The predicted answer names another county.\n\nGrade: B", "B"), ("Grade: A Because the year matches", "A"), ("Grade: A becauseof", None), ], ) def test_verdict_tail_on_later_clauses_and_lines(text: str, expected: str | None) -> None: assert parse_judge_grade(text) == expected
Please also add
match="matches the gold target"topytest.raises(JudgeError)intest_verify_without_a_grade_raises_judge_error. The message is the only place the rejected reply is kept, and no test reads it. -
test_run_request_fields_agree_with_task_datachecks one direction. The bot's comment is right, and its replacement passes on the current models. I ran it: it fails whenquestionis removed fromOmniscienceRunRequestand whenextrabecomesignore. The current test passes in both cases. -
benchmark-notes.md, three corrections to the new sentence.- "or two different grades" is not accurate. A bare letter on the last line wins over earlier lines:
Grade: Bfollowed byAis A, as onmain. The bot's wording covers this. - "read a sample of
judge_output": ajudge_failedrow has nojudge_output. The reply is infailure_reasonin<output>_failures.jsonl, cut to its first 200 characters. - Say what happens after the second ask (next section).
- "or two different grades" is not accurate. A bare letter on the last line wins over earlier lines:
For the description, no commit needed
- Rollout evidence.
AGENTS.mdasks for a live smoke when verifier behaviour changes. Please add one, or cite the two runs above. - Benchmark-result impact. Two things are missing.
- A row that has no grade twice is left out of every metric. A plain
gym eval runthen exits 0, withcomplete: falsein the coverage file. A strict run ends with exit status 76 and no aggregate:Evaluation incomplete: 24/30 samples completed after the saved-answer re-verification.gym eval submitis strict by default. Onmainthe same run completes, with those rows at -1. I ran both. - The paragraph names only the unparsed B. Replies that
maingraded from an explicit verdict are judge failures too: a verdict followed by a sentence, a label with no separator,B:. If the judge repeats such a reply, a row thatmainscored leaves the score.
- A row that has no grade twice is left out of every metric. A plain
- "The ten reply shapes" is nine plus
B:.The grade is notfollowed byAis still a recorded A through the last-line rule, and has no test. - 46 existing expectations moved from
"B"toNone, and two tests were renamed. "No existing test needed a new assertion" reads otherwise.
Not this PR
- The default judge is gone.
openai/gpt-oss-20binbenchmarks/omniscience/judge_gptoss20b.yamlwas retired onintegrate.api.nvidia.comon 2026-11-18 (HTTP 410, "has reached its end of life"). With the default config every row isjudge_failedand the run reports no score. This PR does not touch that path.benchmark-notes.mdnames it as the default one line above your change. Five other configs name the same model on that endpoint:simpleqa,ugphysics,math_with_autograder,frontierscience_judgeandphysics_judge. - Cut-off replies.
A: CORRECTfollowed by a last lineB:was a recorded B onmainand is a recorded A here. Neither is right. Treating a judge reply that stopped at the token limit as a judge failure would remove this whole class, including the unclosed think block. - Shapes that still parse, as on
main:Grade: A - INCORRECTandGrade: A (INCORRECT)are A. A hyphen starts a reason and an en or em dash does not:Grade: A — matchesis a judge failure.
…ts the grade A verdict line with a tail the parser does not accept still does not count, but its letters must agree with the grade the other lines give. Patch by Mahan Fathi from the NVIDIA-NeMo#6541 review (request 1). Co-authored-by: Mahan Fathi <[email protected]> Signed-off-by: FrontierJam Agent <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
…eck TaskData both ways Review of NVIDIA-NeMo#6541, requests 2 and 3: the tail-rule rows and the JudgeError message match from Mahan Fathi, and the two-way TaskData agreement test from the review bot. Signed-off-by: FrontierJam Agent <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
Review of NVIDIA-NeMo#6541, request 4: last-line precedence, where the rejected reply is kept, and what happens after the second ask. Signed-off-by: FrontierJam Agent <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
openai/gpt-oss-20b, the default judge, was retired on integrate.api.nvidia.com on 2026-11-18 (HTTP 410), so the default config failed on every row. The default is now the judge request EFB uses: Chat Completions, reasoning_effort medium and a 32,768-token judge output cap, on inference-api.nvidia.com with JUDGE_API_KEY. omniscience_judge_base_url, omniscience_judge_api_key and omniscience_judge_model_name select another endpoint, key or model, as in nemotron_recipes/super-3.5. The Nemotron 3.5 Super eval container keeps its Gemini judge request unchanged. Requested by Mahan Fathi in the NVIDIA-NeMo#6541 review. Signed-off-by: FrontierJam Agent <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
|
/ok to test 52338e8 |
|
Thanks for the review, Mahan. Requests 1 to 4 are in. The description now has the rollout evidence and the result impact, with the corrected test counts. The Luna default is in this PR as its own commit (the Super 3.5 eval container keeps its Gemini judge request). |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
|
/ok to test 83dd710 |
The core batch config also loads the omniscience benchmark config with its Gemini judge. Drop the Luna default's extra_body there and keep the 2048-token cap, as the eval container config does. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: plaszkiewicz <[email protected]>
|
/ok to test 7e4b8e4 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/45149338815 |
Follow-up to #5783 and #5891 for AA-Omniscience, as agreed with @mahanfathi in the review of #5783. The first commit is Mahan's test patch for the older code paths, unchanged.
What changed and why:
A judge reply with no unambiguous grade was counted as INCORRECT (index -1), and nothing graded it again, because omniscience does not take part in the end-of-run re-judge pass. It now raises JudgeError, so the row is masked and graded again from its saved answer, the same way an empty judge reply is handled.
Parser items from the #5783 approval review:
an explicit verdict counts only when the rest of its line is empty, closing punctuation or a short reason (because, since, based on, -, ();
a line that starts like a verdict but has a tail that is not accepted does not count, and its letters must agree with the grade the other lines give (Mahan's patch from the #6541 review), so CORRECT (A) requires a full match. followed by Grade: B. ... is a judge failure, not an A;
Grade and Verdict need a separator, as Answer already does;
leftover think tags are checked before the last-line rule;
: is no longer a last-line wrapper, so B: on its own is not a grade.
The Chat Completions judge path now strips think blocks, as the Responses path does.
The default judge is now GPT-5.6 Luna at medium reasoning effort (benchmarks/omniscience/judge_luna.yaml). openai/gpt-oss-20b, the old default, was retired on integrate.api.nvidia.com on 2026-11-18 (HTTP 410), so the default config failed on every row. The default uses EFB's judge request: Chat Completions, reasoning_effort: medium and a 32,768-token judge output cap on the benchmark's resources server, on inference-api.nvidia.com with JUDGE_API_KEY. omniscience_judge_base_url, omniscience_judge_api_key and omniscience_judge_model_name select another endpoint, key or model, the names nemotron_recipes/super-3.5/omniscience.yaml already uses. The README says so in one paragraph.
benchmarks/nemotron_3.5_super/eval_container_config.yaml loads this benchmark config with its own Gemini judge. It now drops the Luna default's extra_body (_delete_key) and keeps the 2048-token cap, so its judge request is unchanged.
Tests:
Mahan's four tests: Chat Completions judge request, empty judge reply, unclosed block, index and hallucination formulas;
the nine reply shapes listed in the #5783 review plus B:, and the two surviving mutants (an upper-case think tag, a label with no separator);
Mahan's rows for verdict tails on later clauses and lines, and a match= on the JudgeError message, which is the only place the rejected reply is kept;
the TaskData/OmniscienceRunRequest field agreement requested in #5891, checked in both directions and with the extra="allow" policy.
The score-triage note in .agents/skills/nemo-gym-score-triage/references/benchmark-notes.md described the old substring parser. It now describes the current one, including last-line precedence and where a rejected reply is kept.
Tests changed or removed while combining the commits: 46 existing expectations moved from "B" to None (an unparsed reply is now a judge failure), and two tests were renamed. Three tests of the parser commit repeated Mahan's and were removed: the unclosed block, the index and hallucination formulas, and the empty judge reply (the "" case of the no-grade test). Its Chat Completions judge test was cut down to the one thing Mahan's does not cover, a judge reply with a think block, and renamed test_chat_completions_judge_strips_think_blocks.
Issue: none; the follow-up was agreed in the #5783 review.
Validation:
pytest resources_servers/omniscience/tests: 146 passed.
pytest tests/unit_tests/benchmarks/test_omniscience_prepare.py: 6 passed.
ruff check, ruff format --check and pre-commit on the changed files: passed.
Reverting each of the behaviour changes on its own fails at least one test. Three of the new tail rows fail without the contradiction check and pass with it.
pytest tests/unit_tests/environment/test_benchmarks.py: 85 passed.
Resolved the configs before and after: the omniscience benchmark config gives Luna on inference-api.nvidia.com with reasoning_effort: medium, 32 judge calls in flight and a 32,768-token cap, and the three omniscience_judge_* keys replace endpoint, key and model. The Nemotron 3.5 Super eval container resolves to the same Gemini judge request as on main: no extra_body, a 2048-token cap and 16 calls in flight.
Rollout evidence (from @mahanfathi's review of this PR):
gym eval run, 12 questions, Nemotron 3.5 Lightning with the GPT-5.6 Luna (medium) judge: 12 of 12 graded, 0 judge failures.
gym eval run against a stub judge, 15 questions x 2: rows without a grade are judged again once from their saved answers at the end of the run; 12 get a grade, and the 6 that get prose again are masked, not scored as zero.
45,024 saved judge replies from 20 runs: 45,018 are bare letters, and 3 replies change, from incorrect to a judge failure. The 9,000 replies of our three full v1.1 runs of Nemotron 4 Nano SFT are all bare letters, and 0 grades change.
Benchmark-result impact:
Parser: none for judges that reply with a bare letter.
A reply that main graded as an unparsed B (index -1) is now a judge_failed row that is graded again. So are some replies main graded from an explicit verdict: a verdict followed by a sentence, a label with no separator, B:. If the judge repeats such a reply, a row that main scored leaves the score.
A row that has no grade twice is left out of every metric. A plain gym eval run then exits 0 with complete: false in the coverage file; a strict run (gym eval submit by default) ends with exit status 76 and no aggregate. On main the same run completes, with those rows at -1.
Default judge: it changes scores against runs graded by openai/gpt-oss-20b; compare only runs with the same judge. EFB sets the same judge settings in its binding, so its resolved judge request does not change. benchmarks/nemotron_3.5_super/core_text.yaml takes its judge from the caller; a caller that overrides only the endpoint, key and model now also sends reasoning_effort: medium and the 32,768-token cap.
Not in this PR: cut-off judge replies (for example A: CORRECT then B:). Five other configs still name openai/gpt-oss-20b on integrate.api.nvidia.com: simpleqa, ugphysics, math_with_autograder, frontierscience_judge and physics_judge.