Repository navigation
Merge the LLM-judge implementations into shared judge code - #512
Merged
Merged
Conversation
Add a golden test that records the task hash of every task and single variant, with OLMO_EVAL_JUDGE unset and set. Later changes to judge configuration are checked against it, and an intended hash change shows up as a reviewed diff to task_hashes.json. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JudgeSettings holds the settings that change what an OpenAI-compatible judge replies and fills unset fields from a task config. Judge wraps a judge function with the shared retries and raises JudgeParseError, which now carries the last reply, when no attempt parses. JudgedTask hands its subclasses a Judge instead of a bare function, and Omniscience builds its configured judge from JudgeSettings. Task hashes and scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ScoringContext gains judge_limiter, created on first use and sized by scoring_concurrency. Judged tasks, FrontierScience and the API path of judge scorers all hold it per call, so judge concurrency is one budget for the run. FrontierScience used its own limiter, held it through backoff waits, and kept a private copy of the retry loop; it now uses the shared ones. Judges served from the inference pool stay bounded by their providers. Task hashes and scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Judged tasks applied the environment judge in their constructors with three different rules: JudgedTask only when the configured model equaled the class default, so an explicit -o judge_model=<default> lost to the environment; FrontierScience always, so the environment beat -o; and Omniscience never. get_task now applies it to every task that sets judged = True, after variants and before -o overrides, unless the overrides name a judge model. The spec also takes a token budget, model[:effort[:max_tokens]], so a reasoning judge set from the environment is not cut off by a task's budget for a non-reasoning judge. Default task hashes are unchanged. With OLMO_EVAL_JUDGE set, omniscience and omniscience:judge now take the environment judge. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
FrontierScience kept its own copy of the judged-task orchestration. It now subclasses JudgedTask and keeps only what differs: its prompts and parsers, its warnings about empty outputs, and the paper's rule that an unparseable judge reply scores 0.0 and stays in the denominator, written as an explicit except JudgeParseError. Metric and scorer names are kept, so task hashes are unchanged, and scores are unchanged. Two things follow from sharing the base: each instance also gets a truncation_rate score, and a judge call that fails after its retries is recorded as ScoringIncompleteError, as for other judged tasks. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ExpertQA, AstaBench SQA and ResearchQA read OLMO_EVAL_JUDGE while scoring, so a run with a different judge was stored under the same task hash. They now set judged = True: get_task applies the environment judge to their config, and -o judge_model, judge_reasoning_effort and judge_max_tokens work for them too. A judge field left unset means the task's default (ATTRIBUTED_QA_JUDGE or RESEARCHQA_JUDGE), so default task hashes are unchanged and only runs with another judge get a new hash. Each task now builds its judge once instead of once per scoring call. build_default_judge_fn has no remaining users and is removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Add call_judge, one judge call that retries transient API failures with backoff, holds the limiter per attempt, and raises ScoringIncompleteError when the call still fails. judge_with_retries, judge scorers and the attributed-QA judges all use it. Judge scorers and the attributed-QA tasks had no retries, so a rate limit left the output unscored, and their failures were not marked as infrastructure. A failed call to a judge served from the inference pool is now marked the same way. Scores are unchanged except that fewer outputs are left unscored. AA-Briefcase keeps its error text. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
prepare_task_items built the task with get_task(spec) and applied -o overrides to the config afterwards. That bypassed the judge precedence in get_task, so OLMO_EVAL_JUDGE's effort and budget leaked into a task whose judge model was set with -o. It also meant a task that builds its judge in __init__, such as omniscience, scored with a different judge than its config recorded. configure_task now builds the task with its overrides, and the golden hash test pins the config it returns, which is the one runs store. Default hashes match origin/main's runner for every spec. Omniscience no longer takes OLMO_EVAL_JUDGE: its default judge has a 10-token budget for a letter grade, which a reasoning judge from the environment would exhaust. -o judge_model and related overrides still apply. JudgeSettings and Judge drop fields and a constructor nothing used. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The WildGuard and StrongREJECT judges run as auxiliary providers whose model the harness sets, so the task hash did not record which judge graded a run. The variants that judge with a provider now set judge_model to the model that provider must serve: allenai/wildguard, or for StrongREJECT the qylu4156/strongreject-15k-v1 adapter. Before generating, the runner checks that the harness defines the provider and that it serves that model; -o judge_model records a deliberate change. This changes the task hash of the wg_judge, wg_judge_thinking and base variants of the seven WildGuard-judged tasks and of strongreject's sr_judge variants (21 specs). Scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SimpleQA's judge parser scored any reply that named no grade as INCORRECT, so a judge that rambled or failed to follow the A/B/C format lowered the model's accuracy. A judge scorer's reply that holds no verdict is now asked for again, like a judged task's, and when no attempt parses JudgeParseError leaves the output unscored; it counts against the failure budget instead of as a wrong answer. Task hashes are unchanged. simpleqa:judge scores change only for runs where the judge gave a reply with no grade. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The safety judge scored a reply it could not parse, an answer outside the allowed ones, and a StrongREJECT judge with no grade logprobs as 0.0, which counts as an unsafe answer. These now raise JudgeParseError, so the output is left unscored and counted against the failure budget. The OpenAI judge path asks again first, like other judge scorers; provider judges run at temperature 0 and are not asked again. The parsing_error metric of the judged safety variants is dropped: an output whose reply does not parse is no longer scored, so the metric would always read 0. wmdp:mcq keeps it, since its answer extractor records parse errors without raising. Subset metrics now leave out responses with no score instead of counting them as 0, and an empty subset reports 0.0 instead of -1. This changes the task hash of the openai_judge, wg_judge (or sr_judge), *_thinking and base variants of the seven safety tasks (28 specs), and their scores where the judge gave no verdict. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The safety judge wrote its result and the flags it grades with to the instance, which every sample of the instance shares. With several samples, the predictions kept only the last sample's judge result, and an empty sample's is_empty_response flag, set before the judge call and read after it, could be overwritten by a concurrent sample and change that sample's score. The judge result and is_empty_response, is_truncated_response and is_parsing_error are now recorded on the judged output. Predictions carry judge_result per output, which the upload extractor already reads. Task hashes are unchanged. Single-sample scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
CONTRIBUTING.md now says what a judged task must use and record: the shared judge code, judge settings in TaskConfig with judged = True, judge calls through Judge.ask or call_judge, and judge results on each output. docs/result-compatibility.md records the hash and score changes in this branch. RubricJudgeScorer had no users and is removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JudgeSettings.with_config kept the default reasoning effort when a config named another judge model with no effort, so OLMO_EVAL_JUDGE=gpt-5-mini sent ExpertQA and AstaBench SQA's medium effort to gpt-5-mini while the stored config recorded none. The default effort now belongs to the default model, as it does for judged tasks with class defaults. The runner's error for a missing judge provider now asks for a provider that serves the recorded model, which for StrongREJECT is a LoRA adapter, not a model setting. Task hashes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
simpleqa:judge calls an OpenAI judge but declared no required secrets, so a Beaker launch mounted no OpenAI key and every judge call failed. required_secrets is not part of the task hash. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Saved predictions keep an output's judge_result but no other output metadata, so moving the safety flags onto the output dropped them from the saved files. The safety judge now records is_empty_response, is_truncated_response and is_parsing_error inside each output's judge_result, and judge scorers such as SimpleQA's record the judge's raw reply there, including a reply that never parsed. The judged-task contract and the compatibility entry now say that only API judges are asked again, and describe the saved-prediction layout and the subset metric change for wmdp:mcq. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
gregorybchris
marked this pull request as ready for review
October 27, 2026 03:47
# Conflicts: # src/olmo_eval/common/scorers/llm_judge.py # tests/core/test_llm_judge_scorer.py
Judge.ask was a thin wrapper over judge_with_retries, so there were two public ways to ask for a verdict. Judge.ask now holds the re-ask loop, takes an optional limiter, and is the only one. AA-Briefcase grades with it and catches JudgeParseError and ScoringIncompleteError instead of any exception, with the same verdicts and error text, and uses the shared JUDGE_ATTEMPTS. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ExpertQA, AstaBench SQA and ResearchQA each had a copy of the same build-once judge method and two had a module-level test hook. ExpertQA and AstaBench SQA now hold a cached judge function from JudgeSettings.build_retrying_fn. ResearchQA asks its judge through Judge.ask instead of a private copy of the re-ask loop; its rule that an unparseable rubric batch scores 0.0 is an explicit except JudgeParseError. Tests install judges through judge_stubs.use_judge. Scores and task hashes are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
JudgedTask reached its limiter through three helpers and its own concurrency default. It now holds one limiter: the run's when scoring gets a context, and its own otherwise. score_responses also wrapped any exception from _score_output as a judge failure; call_judge already raises ScoringIncompleteError for a judge that stays unavailable, so a bug in a task's own scoring code now keeps its type instead of being reported as judge infrastructure. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An empty response scores 0.0 under the safety judges whatever the verdict, but a reply the judge could not parse raised first, so an empty response the judge stumbled on was left unscored and dropped from the denominator. It now scores 0.0, with is_parsing_error recorded. A failed provider call no longer marks the output as a parse error; the scoring error says what failed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Docstrings and the compatibility entry said OLMO_EVAL_JUDGE reaches every judged task; they now say it reaches tasks with judged = True and name them. CONTRIBUTING says when a task may leave judged unset and that a score which does not depend on the verdict needs no parity reason. The compatibility entry adds the empty-response rule and FrontierScience's truncation_rate. The llm_judge module docstring describes the shared judge code. ProviderConfig.served_model no longer parses lora_modules given as a bracketed string, a form the provider rejects. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A task hash identifies stored results, and nothing caught a change that moved one. Add a golden test of the hash of every task and single variant, with OLMO_EVAL_JUDGE unset and set, built through the same configure_task the runner uses, so it pins the hash runs store. An intended change shows up as a reviewed diff to task_hashes.json. configure_task is extracted from prepare_task_items without a change in behavior. AGENTS.md says what to do when the test fails. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…isg/unify-judge-base # Conflicts: # src/olmo_eval/runners/asynq/preparation.py # tests/evals/tasks/task_hashes.json
Review of the hash test found that it missed the stacked-variant specs suites run, that CTC_SUITE_DATA_ROOT reached 199 pinned hashes from a developer's environment, and that its failure message asked for a compatibility entry when a spec was only added. The test now also pins every spec a suite expands to, clears the environment variables tasks read into their config, lists added, removed and changed specs apart with old and new hashes, and reads the registry through its public functions. The AGENTS.md rule defers to "Spec meaning is fixed", says a removed spec is a retirement, and says what the test cannot catch; CONTRIBUTING.md points to it. configure_task is exported. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…isg/unify-judge-base
# Conflicts: # src/olmo_eval/runners/asynq/preparation.py # tests/evals/tasks/task_hashes.json
The safety openai_judge variants and simpleqa:judge graded with a gpt-4o-mini judge that their task hash did not record, so a run with another judge shared their hash. Their variants now set judge_model and judge_max_tokens, and grade_with_config_judge, which Omniscience used inline before, builds their judge scorers from those settings, so -o judge_* reaches both the hash and the judge. They do not take OLMO_EVAL_JUDGE: like Omniscience, their judges grade with budgets of 10 and 128 tokens. This changes the task hash of the seven openai_judge variants and simpleqa:judge. Scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ExpertQA and AstaBench SQA scored a judge reply they could not parse: answer precision 1.0, ingredient recall 0.0, and a citation section with no claims as empty. They called the judge once, outside the run's judge limiter, and kept no reply. They now ask through Judge.ask, which asks again for a reply that does not parse, then raises JudgeParseError so the output is left unscored and counted against the failure budget. Judge calls hold the run's judge_limiter, and each output's judge_result keeps every raw reply. A reply that parses to an empty object keeps its previous score. Judge gains an optional default limiter and recording_into for this; with_call_retries and build_retrying_fn have no remaining users and are removed. The citation validation harness wraps its judges in Judge. Task hashes are unchanged. Scores change only where the judge gave a reply that did not parse. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ResearchQA asked its judge without the run's judge limiter, and its predictions kept the parsed rubric labels but not the judge's replies. Judge calls now hold the limiter, and each output's judge_result keeps every raw reply. Task hashes and scores are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Omniscience graded a judge reply that named no single grade PARSING_ERROR: its metrics left it out, but it never counted against the failure budget, and the judge was not asked again. A failed judge call was graded PARSING_ERROR too. An API judge reply with no grade is now asked for again through Judge.ask, then raises JudgeParseError so the output is left unscored and budgeted; a failed call raises its own error. The grade and raw reply are recorded on the output instead of the instance, and the metrics read them there. judge_parsing_errors, which would now always read 0, is dropped from omniscience:judge. This changes the omniscience:judge task hash. Its metrics are unchanged, since they already left unparseable grades out. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Break the entry into short statements, one fact each, with before and after stated separately for each change. The content is unchanged, except that it now names the ResearchQA and wmdp:mcq effects as limited, and says how often a judge reply failed to parse in the validation runs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Fixes #486. Builds on #514 (merged), which added the golden task-hash test. This PR's diff to
task_hashes.jsonis exactly the hashes it moves. All LLM-judged code now builds on one set of shared judge pieces. Judge settings reach the task hash in one way,OLMO_EVAL_JUDGEfollows one rule, and a judge that gives no verdict leaves the output unscored instead of scoring 0.This is one PR by request, which is an exception to "one behavior change per PR". Each commit makes one change and passes the tests on its own, so the PR can be reviewed commit by commit.
Design
The design is composition, not one base class, because the judge users have incompatible shapes:
The shared pieces live in
common/scorers/llm_judge.py:JudgeSettings: the judge settings a task keeps inTaskConfig, and how to build the judge from them.call_judge: one judge call. It retries transient API failures, holds the limiter per attempt, and raisesScoringIncompleteErrorwhen the call still fails.Judge.askadds re-asking for a reply that holds no verdict, then raisesJudgeParseError.ScoringContext.judge_limiter: one judge concurrency budget for the whole run.OLMO_EVAL_JUDGE=model[:effort[:max_tokens]]: applied once, inget_task, to tasks withjudged = True. It applies after variants and before-o, and is skipped when-onames a judge model.JudgedTaskstays as the helper for tasks that judge each output once. FrontierScience now uses it, and its paper's "unparseable reply scores 0" rule is an explicitexcept JudgeParseError. The judged-task contract is written up in CONTRIBUTING.md.Changes to stored results
docs/result-compatibility.mdhas the full entry. The golden test from #514 pins every spec's stored task hash; this PR's diff totask_hashes.jsonlists every hash it moves:judge_model; runner checks the harness serves itwg_judge/sr_judge,*_thinking,basevariants of the 7 safety tasks (21)parsing_errormetric droppedopenai_judgevariants (28)gpt-4o-mini) recorded in config, so-o judge_*reaches the hash and the judgeopenai_judgevariants,simpleqa:judgesimpleqa:judgeJudge.askand the run's limiter; an unparseable reply leaves the output unscored instead of scoring precision 1.0 / ingredients 0.0; raw replies savedexpertqa,expertqa:cite,astabench_scholarqa,astabench_scholarqa:testwmdp:mcqjudge_parsing_errorsdroppedomniscience:judgeresearchqa,researchqa:miniexpertqa,astabench_scholarqa,researchqaOther behavior fixes:
configure_task). Before,-owas patched in after construction. That letOLMO_EVAL_JUDGEoverride an explicit-o judge_model, and Omniscience scored with its default judge while recording the override.judge_result. An empty sample'sis_empty_responseflag could also be overwritten by a concurrent sample.simpleqa:judgedeclaresOPENAI_API_KEY. Before, Beaker launches mounted no judge key.Judge.ask. Before, ResearchQA had its own re-ask loop and AA-Briefcase caught every exception. ResearchQA's parity rule that an unparseable rubric batch scores 0.0 is now an explicitexcept JudgeParseError.JudgedTaskno longer reports a bug in a task's own scoring code as a judge failure.First validation run (safety suite and SimpleQA, before the final changes)
Each job ran
allenai/Olmo-3-7B-Instructonsimpleqa:judge,safety_instructandsafety_openai, on 3× H100 inai2/olmo-eval-debugonai2/ceres, with--no-upload.main@ 63d9d8c: 01M5X228EJTAEP9Z3D3T99HDWGBoth jobs finished cleanly. The provider pre-flight passed, and the hashes changed only for the safety judge specs.
mainThe deltas are sampling noise, not effects of this change. The safety tasks generate at temperature 0.6, and almost no generations match between the two runs: 10 of 4,482 for
bbq:mcqand 4 of 300 fordo_anything_now:wg_judge.bbq:mcq, which this PR doesn't touch, moved by 0.7 points.The change itself mattered for one output per run. In
do_anything_now:wg_judge, WildGuard replied with blank lines and//instead of three answers.mainscored it 0; the branch leaves it unscored, with aJudgeParseErrorand the raw reply saved. On the same outputs, that moves the task by about +0.2 points.The final-review commits after
17c507f1change no score in these runs: the one unscored output wasn't an empty response, so the empty-response rule didn't apply to it.The branch's predictions keep each output's
judge_resultwith the raw reply and theis_empty_response,is_truncated_responseandis_parsing_errorflags.Second validation run (after the final changes)
All four jobs finished cleanly on 1× H100 in
ai2/olmo-eval-debugonai2/ceres, withallenai/Olmo-3-7B-Instructand--no-upload. They usedmain@ 6826e90 and this branch @ 3b97dba.safety_openai,simpleqa:judgeandomniscience:judge:main01M5XYGQJVZYGB3SW13055Z5PW, branch 01M5XXW2XD4DQ6NT44BZ6KK9KJ.expertqa(seeded 500-question sample),astabench_scholarqaandresearchqa:mini:main01M5XYGQPRC0RQM5KG4ZEA10BC, branch 01M5XYGQ7J5E888YTFW5QFGEF5.mainWhat this shows:
No judge reply in either run failed to parse. So no output was left unscored, and the score changes this PR makes for unparseable replies (ExpertQA, AstaBench SQA, Omniscience, SimpleQA, safety) didn't come into play. The unit tests cover those paths.
Every judged output on the branch saved its raw reply. The 10 ExpertQA outputs without one had no parseable report, so they score 0 without a judge call, by design.
The deltas are generation and judge noise. The two tasks whose scoring this PR doesn't touch,
bbq:mcqandwmdp:mcq, moved by about 1.2 points. Only 153 of 600 Omniscience generations and 1 of 450 XSTest generations match between the runs, since those tasks sample at temperature 0.6.Where a generation matched, both revisions usually gave the same score:
The remaining disagreements are mostly on tasks with a reasoning judge, which ignores temperature: 15 of 41 matched ResearchQA outputs and 2 of 3 AstaBench outputs. I'm inferring that these come from the judge, not this PR, because no reply failed to parse and the unit tests show the parsing path unchanged.
The stored task hashes match
task_hashes.jsonon both revisions. The one exception isexpertqa, whoselimit=500override is part of its hash.Limitations:
olmo-eval beaker launchhangs after submitting a job. This happened every time, so I checked submissions in Beaker directly. It's unrelated to this PR.Validation
All pass: 4229 passed, 36 skipped.
Follow-ups not in this PR
LLMJudgeScorersubclass that keeps judge settings on the scorer. It should move toJudgeSettingsandjudged = True. The private_score_with_provider/_score_with_judge_fnit calls still work.build_default_judge_fn, which this PR removes. They should resolveATTRIBUTED_QA_JUDGE.with_config(config)instead.format_scoring_error.lora_modules=[strongreject=…]. The provider receives that as a string and rejects it, so the documented StrongREJECT command doesn't work as written. The runs above use the JSON list form.🤖 Generated with Claude Code