Repository navigation
fix(verifiers): stop lenient parsing from giving full reward to non-answers - #5431
Open
jimmy-holdout wants to merge 4 commits into
Open
jimmy-holdout wants to merge 4 commits into
jimmy-holdout wants to merge 4 commits into
Conversation
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]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_gradeno longer picks a grade letter out of a word. Before, the A inATTEMPTED,PARTIALorAnswermadeNOT ATTEMPTED,D: NOT_ATTEMPTED,C: PARTIAL_ANSWERandAnswer: Bgrade A. Both now use the approach proposed in fix(abstention): match standalone judge grades #5403 for abstention:simpleqa's leading-character rule is replaced by the same logic, because it read
Answer: Bas A. A reply such asA: CORRECTorB - INCORRECTstill parses as before when it contains no other standalone grade.ragtruth: a reply that is not a JSON object with a
hallucination listarray (empty, plain text, truncated JSON,{}, a string value) now scores 0 and setsparse_fail=1. Before, it counted as a "no hallucination" verdict and scored 1.0 on every clean case.pred_haluis unchanged for these replies (0), so they still count as negative predictions in precision / recall / F1. The README's reward,mean_rewardandparse_fail_ratedescriptions are updated.imo_proofbench_judge:
math_equalreturns False when the expected answer is blank orNone. Proof-only problems storeexpected_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 existingexpected_answer=Nonetest 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 withuv sync --extra dev --extra telemetry --extra mlflow --extra wandband the four patches applied withgit 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.python -m pytestagainst the unchangedapp.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.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. BareAand a valid ragtruth answer still score 1.0.Rollouts
I ran a smoke rollout for each server:
gym env start, thengym eval run --no-serveondata/example.jsonl(5 tasks, 1 repeat). The model was a local CPUqwen2.5:1.5b-instructserved locally with Ollama, acting as both policy and judge. These runs check the integration, not accuracy:{"hallucination_list": []}(wrong key). It scored 1.0 before this change and now scores 0.0 withparse_fail=1. I re-scored the saved rollouts with the oldverify(), and that is the only reward that differs.judge_modelserver pointed at the same endpoint. The proof-only problem (row 2,expected_answer=" ") went to the judge (symbolic_correct0), 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.CORRECTused 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: 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.ragtruth:
mean_rewardand per-slice accuracy drop by the share of malformed replies on clean cases.parse_fail_ratenow also counts JSON objects without ahallucination listarray. Corpus and per-slice precision / recall / F1 are unchanged, becausepred_haluis 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.
is_correct_judgement_label_matchingacceptsjudgement[0], so it readsAnswer: Bas A. With this PR, simpleqa no longer does.prefill_judgementtreats" "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
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).