Skip to content

fix(verifiers): stop lenient parsing from giving full reward to non-answers - #5431

Open
jimmy-holdout wants to merge 4 commits into
NVIDIA-NeMo:mainfrom
jimmy-holdout:fix/standalone-grades-and-blank-answers
Open

jimmy-holdout wants to merge 4 commits into
NVIDIA-NeMo:mainfrom
jimmy-holdout:fix/standalone-grades-and-blank-answers

Conversation

@jimmy-holdout

Copy link
Copy Markdown

What does this PR do?

Fixes #5430. Four verifiers could give reward 1.0 to non-answers. There is one commit per server, so each can be reviewed or reverted on its own:

  • simpleqa and omniscience: parse_judge_grade no longer picks a grade letter out of a word. Before, the A in ATTEMPTED, PARTIAL or Answer made NOT ATTEMPTED, D: NOT_ATTEMPTED, C: PARTIAL_ANSWER and Answer: B grade A. Both now use the approach proposed in fix(abstention): match standalone judge grades #5403 for abstention:

    • a bare grade on the last line wins;
    • otherwise, exactly one distinct standalone grade is accepted;
    • otherwise, the existing fallback applies (C for simpleqa, B for omniscience).

    simpleqa's leading-character rule is replaced by the same logic, because it read Answer: B as A. A reply such as A: CORRECT or B - INCORRECT still parses as before when it contains no other standalone grade.

  • ragtruth: a reply that is not a JSON object with a hallucination list array (empty, plain text, truncated JSON, {}, a string value) now scores 0 and sets parse_fail=1. Before, it counted as a "no hallucination" verdict and scored 1.0 on every clean case. pred_halu is unchanged for these replies (0), so they still count as negative predictions in precision / recall / F1. The README's reward, mean_reward and parse_fail_rate descriptions are updated.

  • imo_proofbench_judge: math_equal returns False when the expected answer is blank or None. Proof-only problems store expected_answer=" " (33 of the 60 IMO-ProofBench problems), and \boxed{ } used to match it, skip the judge and score 1.0. A non-empty boxed answer on those problems now goes to the judge, which is what the existing expected_answer=None test already expects. An empty \boxed{} keeps the existing no-answer path. Non-blank short answers that match still skip the judge, as before.

Validation

All of this is at 0c7ac5119c99, on Ubuntu 24.04.5 with Python 3.13.14. The clean box is a fresh clone with uv sync --extra dev --extra telemetry --extra mlflow --extra wandb and the four patches applied with git am.

  • gym env test --resources-server <server> on the clean box: simpleqa 48 passed, omniscience 50 passed, ragtruth 34 passed, imo_proofbench_judge 80 passed.
  • Fail-before check: each server's tests from this branch run with python -m pytest against the unchanged app.py. 15 simpleqa, 12 omniscience, 6 ragtruth and 3 imo_proofbench_judge tests fail there, and the rest pass. That includes the positive controls: bare grades, A: CORRECT, a valid {"hallucination list": []}, and an accepted proof on a proof-only problem.
  • pre-commit run --all-files: passes with no file changes. The guardwords hook skips because its private catalog is unavailable.
  • Each server's verify() was driven with the inputs from the issue, with only the judge HTTP call mocked. All of them score 0.0 after the change. Bare A and a valid ragtruth answer still score 1.0.

Rollouts

I ran a smoke rollout for each server: gym env start, then gym eval run --no-serve on data/example.jsonl (5 tasks, 1 repeat). The model was a local CPU qwen2.5:1.5b-instruct served locally with Ollama, acting as both policy and judge. These runs check the integration, not accuracy:

  • simpleqa: mean reward 0.8. The judge replied with bare letters (four A, one B), and the verdicts follow them.
  • omniscience: mean reward 0.8. Bare-letter judge replies (four A, one B).
  • ragtruth: mean reward 0.2. One clean case got {"hallucination_list": []} (wrong key). It scored 1.0 before this change and now scores 0.0 with parse_fail=1. I re-scored the saved rollouts with the old verify(), and that is the only reward that differs.
  • imo_proofbench_judge: mean reward 0.6, using the shipped judge prompt and a separate judge_model server pointed at the same endpoint. The proof-only problem (row 2, expected_answer=" ") went to the judge (symbolic_correct 0), which is the path this change affects. No short answer matched, so the other rows were judged too. A 1.5B judge is not a meaningful grader; this only checks the wiring.

Compatibility and benchmark impact

  • simpleqa / omniscience: results change only for judge replies that are not a bare letter. A reply with one standalone grade now uses that grade (Answer: B → B). A reply with no standalone grade, or with conflicting grades, gets the server's fallback.

    • Some zero-reward verdicts change too. In omniscience, a word-only CORRECT used to become C (partial) by substring matching and now becomes B (incorrect). Word-only labels were never mapped to their grade and still are not.
    • A sentence that starts with the article "A" still reads as grade A, as on main and in fix(abstention): match standalone judge grades #5403.
    • A multi-line reply whose last line is A: CORRECT, but which mentions another standalone grade earlier, now gets the fallback instead of A, as in fix(abstention): match standalone judge grades #5403. The judge prompts ask for the letter alone.
    • Rescore results that contain non-bare judge replies if you compare against earlier runs.
  • ragtruth: mean_reward and per-slice accuracy drop by the share of malformed replies on clean cases. parse_fail_rate now also counts JSON objects without a hallucination list array. Corpus and per-slice precision / recall / F1 are unchanged, because pred_halu is unchanged.

  • imo_proofbench_judge: on proof-only problems, a non-empty boxed answer that is blank after normalisation (such as \boxed{ }) is now judged instead of counted correct. pass@k can go down when the judge rejects such a reply.

  • NeMo Skills parity: two of these changes intentionally depart from Skills.

    • Skills' is_correct_judgement_label_matching accepts judgement[0], so it reads Answer: B as A. With this PR, simpleqa no longer does.
    • Skills' prefill_judgement treats " " and " " as identical answers. With this PR, imo_proofbench_judge sends blank-answer problems to the judge.

    On those inputs, results will no longer match Skills reference numbers. If you prefer strict parity for simpleqa, the first commit can keep the leading-character rule and change only the substring fallback, which Skills' SimpleQA matcher does not have. I'm happy to adjust it either way, or to raise the same points in Skills.

  • No config, schema or API signature changes. Verifier outputs and benchmark metrics change as described above.

Proposed labels: bug, area:environment.

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. (ragtruth README; the other READMEs already describe the intended grading.)
  • 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. (No new files.)
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

parse_judge_grade() took the first character of the judge text, then
the first A, B or C found anywhere in it. "Answer: B" and "Answer: C"
start with A, and "NOT ATTEMPTED" / "NOT_ATTEMPTED" contain one, so
all four were graded A and scored 1.0.

Use the same rules as the abstention parser in NVIDIA-NeMo#5403: a bare grade on
the last line wins, otherwise accept exactly one distinct standalone
grade, else keep the NOT_ATTEMPTED fallback.

Signed-off-by: jimmy-holdout <[email protected]>
parse_judge_grade() fell back to the first A, B, C or D found anywhere
in the judge text, so "D: NOT_ATTEMPTED", "C: PARTIAL_ANSWER",
"NOT ATTEMPTED" and "Answer: B" were all graded A (reward 1.0,
omniscience_index 1.0).

Accept exactly one distinct standalone grade and otherwise keep the
INCORRECT fallback, as NVIDIA-NeMo#5403 does for abstention.

Signed-off-by: jimmy-holdout <[email protected]>
An empty, non-JSON or malformed reply was read as a "no hallucination"
verdict and scored 1.0 on every case labelled clean, the same as a
valid {"hallucination list": []} answer.

Score a reply that is not a JSON object with a "hallucination list"
array as 0 and flag it in parse_fail. It still counts as a negative
prediction in the corpus precision / recall / F1.

Signed-off-by: jimmy-holdout <[email protected]>
Proof-only problems store expected_answer=" ". math_equal(" ", " ")
was True, so a reply of just \boxed{ } (or \boxed{\ }) took the "two
answers are identical" path and scored 1.0 without calling the judge.

Return False from math_equal when the expected answer is blank or
None, so these problems go to the judge.

Signed-off-by: jimmy-holdout <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 1, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Nov 1, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added bug Something isn't working area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers needs-review PR is ready for code review and waiting on a reviewer labels Nov 1, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 2, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working community-request Issue reported or requested by someone from the community needs-review PR is ready for code review and waiting on a reviewer sla:triage-overdue Review assignment is over the one-business-day SLA waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

simpleqa, omniscience, ragtruth, imo_proofbench_judge: lenient parsing gives reward 1.0 to non-answers

2 participants