Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Judge-response JSON extraction uses a greedy brace regex in both tasks, which can mis-parse valid outputs and incorrectly trigger retries/zero scores in realistic LLM responses.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds the DeepSearchQA benchmark to olmo-eval with two task variants that share the same dataset loading but differ in prompting and grading, plus accompanying documentation and unit tests. The implementation also addresses the dataset quirk where some “empty gold set” rows are represented as None and were previously dropped.
Changes:
- Introduces
deepsearchqa(FINAL ANSWER extraction + index-based item matching judged by an OpenAI model) anddeepsearchqa_official_judge(official Appendix A prompt grading on free-form responses). - Implements shared DeepSearchQA dataset loading with correct handling of empty gold answer sets for
Set Answerrows. - Adds task documentation (
DEEPSEARCHQA.md) and comprehensive unit tests for parsing/scoring and task registration (including:minivariants).
File summaries
| File | Description |
|---|---|
src/olmo_eval/evals/tasks/deepsearchqa.py |
Core DeepSearchQA task + shared loader + index-matching judge/parsing/scoring. |
src/olmo_eval/evals/tasks/deepsearchqa_official_judge.py |
Official-prompt variant with official-schema parsing and scoring. |
src/olmo_eval/evals/tasks/DEEPSEARCHQA.md |
Usage + methodology write-up and explanation of deviations vs. official leaderboard. |
tests/evals/tasks/test_deepsearchqa.py |
Unit tests for registration, doc processing, extraction, judge parsing, and scoring behavior. |
tests/evals/tasks/test_deepsearchqa_official_judge.py |
Unit tests for official-judge variant registration, prompt behavior, parsing, and scoring. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gregorybchris
left a comment
There was a problem hiding this comment.
This review was generated by an agent following
REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.
Looks good overall! The data-loading fix for the four None rows is right (I confirmed 900/900 instances load with unique ids), the two-implementation split is clearly documented, and the tests cover the scoring arithmetic well. A few things we should address before merging.
I found three issues that affect task identity or persisted-result correctness, so they should be fixed before merge. The rest are non-blocking structure and diagnostics questions, plus nits. Verification: ruff, ruff format, and the PR's 55 tests pass locally; ty reports one diagnostic that is also present on main and is unrelated to this PR.
Blocking
-
src/olmo_eval/evals/tasks/deepsearchqa.py:159(anddeepsearchqa_official_judge.py:138)
The judge model and reasoning effort are read fromOLMO_EVAL_JUDGEat scoring time and never reachTaskConfig. I reproduced this:get_task("deepsearchqa").config.to_dict()is byte-identical withOLMO_EVAL_JUDGEunset and withOLMO_EVAL_JUDGE=gpt-4.1-mini, and nojudge_*key appears in the serialized config. Two runs judged by different models therefore collide on the same task hash and artifact name, and neither the defaultgpt-5.5:mediumnor an override is recoverable from a stored result.TaskConfigalready has serializedjudge_model,judge_reasoning_effort, andjudge_max_tokensfields for exactly this, andfrontierscience.pyshows the pattern: resolve the env override in__init__viadataclasses.replace(config, ...), then build the judge fromself.config.judge_*in scoring.researchqa.pyhas the same defect as this PR; that is a pre-existing fault, not a reason to repeat it. Please move the judge spec into the config onDeepSearchQABase(both tasks share it) and add a test asserting that changing the judge model changesto_dict().class DeepSearchQABase(Task): judge_model = "gpt-5.5" judge_reasoning_effort = "medium" judge_max_tokens = 1024 def __init__(self, config: TaskConfig) -> None: if spec := os.getenv("OLMO_EVAL_JUDGE"): model, _, effort = spec.partition(":") config = replace(config, judge_model=model, judge_reasoning_effort=effort or None) super().__init__(config)
-
src/olmo_eval/evals/tasks/deepsearchqa.py:321(sharedprocess_doc; consumed atdeepsearchqa_official_judge.py:338)
Splitting the goldansweron commas produces wrong gold sets on the real data. I checked the HF dataset: 22 of the 316Single Answerrows contain commas ("Lincoln, NE", "Hasbro, Inc.", "July 3, 2001", "209,550,294"), so each becomes a two- or three-item gold set and a fully correct one-item answer can score at most recall 0.5 (or 0.33). Set rows are worse: "Wild Water Buffalo, 1965; Komodo Dragon, 1986; ..." is semicolon-delimited, and "Rebecca West (1969, 1970), Antonia Fraser (1970, 1971), ..." splits into 28 items for a 14-item set, halving the attainable recall. Sincelen(gold_items)is the recall denominator in both tasks, these persisted per-instance and aggregate numbers are wrong, not just noisy. The paper scores single-answer questions as binary exact match, so at minimum aSingle Answerrow must be a one-item gold set regardless of punctuation. For the official-judge task, the Appendix A prompt is designed to take the raw answer string, and rejoininggold_itemswith ", " also changes the text the "verbatim" prompt sees (newlines and semicolons become commas). Please passanswerthrough unchanged there and derivenum_goldfrom the judge'sCorrectness Detailslength rather than a client-side split. For the index-matching task, could we either split on the delimiter the row actually uses or document that set rows with nested commas are mis-scored and list how many there are? -
src/olmo_eval/evals/tasks/deepsearchqa.py:423(anddeepsearchqa_official_judge.py:352)
When the judge returns three unparseable replies, the instance is scored 0.0 across all four metrics and the only record is an aggregate log line. Nothing inoutput.metadatamarks the instance as a judge failure, and the raw judge text is not stored, so in saved predictions a parse failure is indistinguishable from a genuine zero. Note thatbuild_openai_judge_fnreturns""when a reasoning model spends its wholemax_completion_tokensbudget before emitting content, so with a 1024-token budget atmediumeffort this path may fire often (see non-blocking 3). Please write an explicit flag (for exampledeepsearchqa_judge_parse_failed: True) and the last raw judge response intooutput.metadataon this path, and record the raw response on success too;build_predictionsalready forwards ajudge_resultkey so this survives to disk. A regression test that inspects the persisted metadata after exhausted retries would lock it in.
Non-blocking
-
src/olmo_eval/evals/tasks/deepsearchqa_official_judge.py:267
The implementation that matches the paper's grader is registered under the qualified name, and the independently designed mechanic ownsdeepsearchqa. The guide's parity rule is that the reference-matching port gets the plain name and divergences are named. Could we swap them, sodeepsearchqais the official-prompt grader and the FINAL ANSWER variant becomesdeepsearchqa_final_answer(or similar)? This is much cheaper to change before the first stored results exist than after. -
src/olmo_eval/evals/tasks/deepsearchqa.py:243(anddeepsearchqa_official_judge.py:225)
All fourDeepSearchQAScorerinstances sharename="deepsearchqa_f1"and differ only inscore_key. I confirmedtask._get_scorers()returns a single entry, andScorer.score()readsoutput.metadata["deepsearchqa_f1"]whilescore_responseswritesscore:deepsearchqa_f1, so the scorer returns 0.0 whenever anything invokes it. Nothing on the scoring path does today, butanalysis/pairwise.pyresolves a metric profile by matchingmetric.scorer().nameagainst the storedmetric:scorerkey, so precision, recall, and exact-match will fail to resolve their display format. Derivingnamefromscore_key(or passingname=namein_metric) fixes both. -
src/olmo_eval/evals/tasks/deepsearchqa.py:164and:363(mirrored in the official-judge module)
Two related judge-construction concerns. First, the runner callsscore_responseswith one response at a time (runners/asynq/results.py:224), so building the judge insidescore_responsescreates a fresh client and a fresh copy of the adaptive request-shape cache per instance; each of 900 instances rediscovers thatgpt-5.5rejectsmax_tokensandtemperature.frontierscience.pycaches the judge on the task for this reason. Second,max_tokens=1024withreasoning_effort=mediumis a shared budget for reasoning and output on chat completions; frontierscience uses 8192 and notes truncation as its parse-failure cause. From the five-instance smoke test, how many judge calls needed a retry? If any did, please raise the budget. -
src/olmo_eval/evals/tasks/deepsearchqa.py:393
Onlyoutputs[0]is judged; other samples get noscore:metadata andoutput_score_aggregationis ignored. That is fine for a temperature-0 task, but please say so in a comment or raise onlen(outputs) > 1so a future:n8variant does not silently score one sample. -
src/olmo_eval/evals/tasks/deepsearchqa.py:114
When the marker is absent, the whole response is split on commas and sent to the judge as the "submitted set", which will usually produce dozens of items and a near-zero precision. That is a reasonable penalty, but nothing records that it happened. Could we write adeepsearchqa_format_correctboolean tooutput.metadataso format failures can be separated from wrong answers after the run? -
Both modules duplicate the placeholder scorer and metric classes, the judge builder, the JSON-object scan loop, the
score_responsesloop, and the retry loop nearly verbatim. Since the PR already introducesDeepSearchQABase, could the shared pieces move there so a future fix lands once? The JSON scan helper also looks generally useful next tocommon/scorers/citation.py::extract_json_from_response, which it improves on.
Nits
- Nit:
_JSON_OBJECTatdeepsearchqa.py:152anddeepsearchqa_official_judge.py:131is unused after theraw_decodechange. - Nit:
DEEPSEARCHQA.md:38("No other files were modified") is PR-description content that will be false after the next commit; the "Files" section as a whole reads as a changelog rather than documentation. This is also the first task doc undersrc/olmo_eval/evals/tasks/; consider whether it belongs beside the module or in the README's task docs. - Nit:
extract_final_answerdoes not strip a leading<think>...</think>block, so a marker inside the trace is matched (I checked:"<think>FINAL ANSWER: x</think> ... y"returns"x</think> ... y").researchqa.pystrips the block first.
Before merge
Please address the three blocking items (judge config in the hash, gold-answer splitting on real rows, and per-instance judge-failure metadata), each with the regression test described. If the naming swap in non-blocking 1 is declined, that is fine, but please say so in the thread so the decision is on record. After that you may merge once CI is green and the branch is rebased on main.
| """Build the task's judge from ``$OLMO_EVAL_JUDGE`` or its own default.""" | ||
| import os | ||
|
|
||
| spec = os.getenv("OLMO_EVAL_JUDGE", DEEPSEARCHQA_DEFAULT_JUDGE_SPEC) |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Blocking. This judge spec never reaches TaskConfig, so to_dict() (and the task hash) is identical with and without OLMO_EVAL_JUDGE set; I reproduced that with gpt-4.1-mini vs the default. TaskConfig already has judge_model / judge_reasoning_effort / judge_max_tokens, and frontierscience.py resolves the env override in __init__ via dataclasses.replace so it is hashed. Please do the same on DeepSearchQABase and add a test that changing the judge changes to_dict().
| return None | ||
| gold_items: list[str] = [] | ||
| else: | ||
| gold_items = split_answer_set(answer) |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Blocking. On the real dataset 22 of 316 Single Answer rows contain commas ("Lincoln, NE", "Hasbro, Inc.", "July 3, 2001"), so this produces 2-3 gold items and caps recall for a correct answer at 0.5 or 0.33. Set rows use semicolons and parenthetical commas too ("Rebecca West (1969, 1970), Antonia Fraser (1970, 1971), ..." becomes 28 items for a 14-item set). The paper scores single-answer questions as binary exact match, so a Single Answer row should be a one-item gold set regardless of punctuation.
| scores = compute_deepsearchqa_official_scores(len(gold_items), 0, 0) | ||
| return scores, base_metadata, 0 | ||
|
|
||
| answer_text = ", ".join(gold_items) if gold_items else "None" |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Blocking (same root cause). Rejoining the comma-split items changes the text the "verbatim" Appendix A prompt sees (semicolons and newlines in the source become commas), and len(gold_items) becomes a wrong recall denominator on the rows noted in the summary. The official grader takes the raw answer string; please pass answer through unchanged and derive num_gold from the judge's Correctness Details length instead of a client-side split.
| if attempt < DEEPSEARCHQA_JUDGE_ATTEMPTS - 1: | ||
| await asyncio.sleep(2**attempt) | ||
|
|
||
| matched_gold, matched_pred = parsed if parsed is not None else (set(), set()) |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Blocking. After three unparseable replies this scores 0.0 on all four metrics with no per-instance record: no flag in output.metadata, no raw judge text. In saved predictions that is indistinguishable from a genuine zero. Please write an explicit parse-failed flag and the last raw response into output.metadata (and the raw response on success); build_predictions already forwards a judge_result key.
| if attempt < DEEPSEARCHQA_JUDGE_ATTEMPTS - 1: | ||
| await asyncio.sleep(2**attempt) | ||
|
|
||
| num_matched, num_excessive = parsed if parsed is not None else (0, 0) |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Blocking (mirror of the same finding in deepsearchqa.py). Exhausted retries score 0.0 with no per-instance parse-failure flag or raw judge response in output.metadata.
| class DeepSearchQAScorer(Scorer): | ||
| """Placeholder scorer; DeepSearchQA scores are computed in ``score_responses``.""" | ||
|
|
||
| name: str = "deepsearchqa_f1" |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
All four scorer instances share this name and differ only in score_key; task._get_scorers() returns one entry, and score() reads the unprefixed key while score_responses writes score:..., so it returns 0.0 whenever called. analysis/pairwise.py matches metric.scorer().name against the stored metric:scorer key, so precision/recall/exact-match will not resolve their display profile. Deriving name from score_key fixes both.
| ) -> Sequence[Response]: | ||
| """Judge each response's answer set against the gold answer set.""" | ||
| self._extract_answers(responses) | ||
| judge_fn = build_deepsearchqa_judge_fn() |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
The runner calls score_responses with a single response (runners/asynq/results.py:224), so this builds a fresh OpenAI client and a fresh adaptive request-shape cache per instance; every instance re-learns that gpt-5.5 rejects max_tokens and temperature. frontierscience.py caches the judge on the task for this reason. Also, max_tokens=1024 at medium effort is a shared reasoning+output budget on chat completions; how many judge calls needed a retry in the smoke test?
| DEEPSEARCHQA_OFFICIAL_METRICS = (F1_METRIC, PRECISION_METRIC, RECALL_METRIC, EXACT_MATCH_METRIC) | ||
|
|
||
|
|
||
| @register("deepsearchqa_official_judge") |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Question: the implementation that matches the paper's grader lives under the qualified name, while the independently designed mechanic owns deepsearchqa. The guide's parity rule gives the plain name to the reference-matching port and names the divergence. Could we swap (e.g. deepsearchqa = official prompt, deepsearchqa_final_answer = index matching) before the first stored results exist?
| Both lists hold the 0-based indices (into the lists above) of the items \ | ||
| that were matched.""" | ||
|
|
||
| _JSON_OBJECT = re.compile(r"\{.*\}", re.DOTALL) |
There was a problem hiding this comment.
Agent review per
REVIEW_GUIDE.md.
Nit: unused after the raw_decode change (same in deepsearchqa_official_judge.py:131).
wu-ming233
left a comment
There was a problem hiding this comment.
I went through the automated reviews, and I agree with the major blocking items:
- the comma-based splitting does not work for the set-based answers, and instead should be giving the raw string to LLM to judge
- judge information should be included in TaskConfig for hashing purposes
- the failed judgements should explicitly warn
The other automated reviews are non-blocking to me.
I implemented these fixes here, for your reference.
Additionally, I changed our own judge to also use the official judge prompt (with a small tweak) to try to follow original eval as much as possible, so both deepsearchqa.py and deepsearchqa_official_judge.py use official prompt, except we extract FINAL ANSWER: in deepsearchqa.py.
@wu-ming233 The fix looks great and clean. Thanks! |
7aac1e8 to
b579819
Compare
fa96643 to
4bd92e8
Compare
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
4bd92e8 to
f3ada59
Compare
The fixes from the last round landed well. The judge settings are now in the task hash, the gold answer is passed through unsplit, and exhausted judge retries leave a record. A few things we should address before merging. I found two issues that affect persisted results, so they should be fixed before merge. The rest are non-blocking items (several carried over from the previous review) and nits. Verification: Blocking
Non-blocking
Nits
Before mergePlease fix the two blocking items (judge API errors become zeros, and judge diagnostics are not persisted), each with the test described. Non-blocking items 1 and 5 change stored metric keys and task names, so they are much cheaper now than after the first results exist. If you decline them, please say so in the thread so the decision is on record. The existing "Changes requested" review will also need a re-review or dismissal. After that, you may merge once CI is green. |
Summary
DeepSearchQABase), differing only in generation prompt and grading mechanic:deepsearchqa— model ends with a discreteFINAL ANSWER: ...line, judged by index-matching two extracted item lists.deepsearchqa_official_judge— mirrors the official paper prompt (Appendix A) verbatim: the judge grades the model's raw free-form response directly, no special output format required.build_openai_judge_fn(the official grader is Gemini 2.5 Flash, which olmo-eval's judge infra doesn't support), so absolute numbers from either task aren't directly comparable to the public Kaggle leaderboard — seeDEEPSEARCHQA.mdfor the full writeup of what each deviates from and why.Nonein the source CSV, which the HF CSV loader silently coerces to a null; these were being dropped as malformed instead of scored as an empty gold-answer set. Both tasks now handle this correctly (900/900 instances load, not 896/900).:minivariants (50-instance subset) registered for both tasks for quick iteration.DEEPSEARCHQA.mddocuments both tasks, the data quirk above, and the secrets each requires (OPENAI_API_KEYalways;S2_API_KEY/SERPER_API_KEYadditionally for--harness dr_tulu).Test plan
uv run ruff check src/ tests/— passesuv run ruff format --check src/ tests/— passesuv run ty check src/ alembic/— passes (no new diagnostics)uv run pytest tests/ --ignore=tests/integration— 2247 passedgoogle/deepsearchqadataset end-to-end: all 900 rows load (including the 4 previously-dropped empty-answer-set rows),task inspectprompts render correctly for both tasksQwen/Qwen2.5-7B-Instructend-to-end (generation + judge scoring withOPENAI_API_KEYset)--harness dr_tulusetup