feat(tasks): add AGIEval (21 subsets, 0-shot two-stage) with subset selection - #67
Open
ethan-scitix wants to merge 1 commit into
Open
feat(tasks): add AGIEval (21 subsets, 0-shot two-stage) with subset selection#67ethan-scitix wants to merge 1 commit into
ethan-scitix wants to merge 1 commit into
Conversation
…election
AGIEval v1.1 (Microsoft, arXiv:2304.06364) — 21 human-exam subsets, 19 MCQ +
2 math cloze, 7,272 problems. New `agieval` dataset + `agieval_0shot_gen` task,
with upstream's prompt/parse/score layer vendored in `community/agieval`.
Subset selection is the dataset's main knob, since nobody runs all 21 subsets
by accident:
args: {group: math} # 5 math subsets (1,943 problems)
args: {group: en-mcq | zh-mcq | all} # upstream's leaderboard groups
args: {subsets: [math, sat-math]} # exact names, any combination
Selection always concatenates in canonical subset order, so the same choice
spelled two ways yields the same sample ids.
The task reproduces upstream's zero-shot protocol, which is TWO model calls:
the model answers freely, then re-reads its own answer under an extraction cue
and that short reply is what gets parsed (upstream's parser is "first A-F
character", unusable on a chain of thought). Both ModelOutputs are returned
from infer(), so both are profiled and stage 1's reasoning stays on disk.
`extractor` pins a separate model for stage 2, as upstream did with
gpt-35-turbo; unset, stage 2 runs on the model under test — the one
protocol-level divergence, documented in reference_impl.notes.
report() emits per-subset accuracy, `score` as the macro over the subsets that
ran (upstream's "average for all datasets"), and `macro_en_mcq`/`macro_zh_mcq`/
`macro_math` only when a whole group ran — a partial macro is not the published
number.
status="experimental": faithful to upstream by construction but not yet
validated against a run of our own. Targets are in the notes (GPT-4o zero-shot
62.3 all / 65.2 en / 63.3 zh).
Verified: `sieval dataset download agieval` stages + checksums all 21 files;
end-to-end run over real staged data produces both infer entries per sample,
2 profiled calls/sample, and the expected report keys; 43 new unit tests, full
unit suite (2965) green; preflight all-pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Type
Summary
agievaldataset +agieval_0shot_gentask, all 21 subsets in one class (19 MCQ + 2 math cloze, 7,272 problems — Gaokao, SAT, LSAT, AQuA-RAT, JEC-QA, LogiQA, MATH). The README's "20 tasks" countssat-en/sat-en-without-passageas one; upstream's own driver evaluates and averages all 21 files.args: {group: math}(the 5 math subsets, 1,943 problems) /{group: en-mcq|zh-mcq|all}(upstream's leaderboard groups) /{subsets: [math, sat-math]}(exact names). Selection always concatenates in canonical subset order, so the same choice spelled two ways yields identical sample ids.ModelOutputs come back frominfer()as a list, so both are profiled and stage 1's reasoning stays on disk.extractor(model-config dict orModel) pins stage 2 to a separate model, as upstream did (gpt-35-turbo regardless of the stage-1 model). Unset, stage 2 runs on the model under test — the one protocol-level divergence, and it moves scores; spelled out inreference_impl.notes.url:sources: there is no HF mirror that carries the two cloze subsets (hails/*,dmayhem93/*are MCQ-only;lighteval/agi_eval_enis English-only and omitssat-en-without-passage).report.json: per-subsetscore_<subset>,score= macro over the subsets that ran (upstream's "average for all datasets"), andmacro_math/macro_en_mcq/macro_zh_mcqonly when a whole group ran — a partial macro is not the published number.macro_mathstays distinct fromscore_math, the MATH subset's own accuracy.status="experimental": faithful to upstream line by line, but there is no reproduction run of our own yet (see Manual below). Targets recorded in the notes.Test Plan
Automated
ruff check && ruff format --check)ty check)community21 /datasets9 /tasks13); full unit suite 2965 passedscripts/check_preflight.py— 21 PASS, no FAIL/WARN (incl.check_datasetspinning/checksums,check_meta_index_sync,check_examples)Manual
sieval dataset download agievalstages all 21 files (8.2 MB) and checksum verification passes; re-run is idempotent (already present)group: math, stub chat model,TaskRunner): prompt built from real rows, 2 infer entries persisted per sample, prediction extracted from stage 2 only, judgement +report.jsonkeys as expected (score,score_sat_math)profile.jsonrecordscount: 6inferred calls for 3 samplessieval task show agieval_0shot_gen/sieval dataset show agievalresolve and renderstatus="experimental"rather thanstable. Upstream's v1.1 zero-shot leaderboard targets are inreference_impl.notes(GPT-4o 62.3 all / 65.2 en / 63.3 zh; GPT-3.5-Turbo 46.0 / 54.1 / 45.0). A validating run needs a real model withextractorpinned, since the stage-2 model is score-relevant.Checklist
Required (all PRs)
type(scope): description)AI-Generated Code - <model> (<provider>)in module docstring (community/agieval/__init__.pyis deliberately empty, matchingcommunity/ruler/__init__.py— no code to attribute)core/—core/untouchedIf: New or Modified Benchmark
experimentalandstable.sieval dataset download agievalsucceeds)__init__.py(lazy export map + regenerated__init__.pyiandmeta/index.json)If: community/ Changes
combine_prompt/concat_prompt/convert_few_shot) and theirtiktokenbudget trimming are not vendored, along with thesetting_nameparameter and thefew-shot-CoTextract_last_linebranches it gated.remove_few_shot_prefixstays — upstream calls it unconditionally insideparse_math_answer.ValueErrorinstead of upstream'stry/except NameErrorreturningNone(which surfaces later as aTypeErroron the prompt).None, not""/[], per thePredictionRecordcontract. Verdicts unchanged: neither can equal a gold answer. Same forconvert_to_set(None)returning an empty set where upstream returns an empty dict ({}, a typo) — every comparison it feeds reaches the same verdict."\$(.*)\$"etc. are plain strings whose invalid escapes Python leaves untouched). The one place this could have gone wrong is called out inline: upstream's second percent-strip is written.replace("\%", ""), i.e. a redundant repeat of the first, not a bare-%strip.is_equivis vendored again rather than reusingsieval.community.math, which is a trimmed copy of the same hendrycks/math file. The steps it drops (linebreak/space/degree/percent strip,_remove_right_units, leading"k = ",0.5 -> \frac{1}{2}) change verdicts, so AGIEval scores must come from AGIEval's copy. Pinned bytest_is_equiv_applies_the_normalizations_sieval_community_math_drops.gaokao-mathqarows carry multi-letter gold ('AD', 'ACD', 'A B D', …) while the subset is not on upstream'smulti_choicelist and is scored by exact single-letter compare, so those rows are unwinnable (~2% of that subset). Fixing it would diverge from every published AGIEval number.math_equivalence.pycredits both AGIEval and the hendrycks/math original it vendors.Dataset shape notes (not a template section, but the reviewable bit)
Rows keep upstream's field names and nullability (
passage/question/options/label/answer/other) and gainsubset, which is absent from the raw rows but decides prompt, parsing and scoring. Two normalizations were unavoidable to concatenate 21 files whose per-file inferred schemas disagree, both verdict-neutral and both guarded:jec-qa-kd/jec-qa-cashiplabelas a 1-element list where every other subset ships a string; the list is unwrapped. A longer list raises rather than silently re-scoring — v1.0 had genuine multi-label rows, and set-comparison semantics would change.other.levelis anint64inmath.jsonland absent elsewhere; stringified so the struct has one dtype across subsets. No other column is cast — upstream already ships them as strings.🤖 Generated with Claude Code