feat(tasks): add GSM-Plus (dataset + 0-shot CoT task) - #69
Open
ethan-scitix wants to merge 1 commit into
Open
Conversation
GSM-Plus (Li et al., ACL 2024) rewrites every GSM8K test problem under 8 adversarial perturbations, so a model's GSM8K score can be compared against its score on the same problems perturbed. 10552 rows; upstream's `testmini` (2400) is reachable via `eval_split`. Ports upstream's zero-shot CoT path (pinned commit 3474129e, `--prompt_type cot`): the system/user turn pair from `cot_prompt_map_func`, gold from `solution` via `extract_gold_ans`, and extraction dispatched on the row's `perturbation_type`, all vendored in `sieval.community.gsm_plus`. That dispatch is the load-bearing part. The `critical thinking` perturbation *deletes* a quantity the question needs, so its gold answer is the literal string "None" and it is scored on refusal phrasing rather than on a number. A GSM8K-style numeric-only scorer would silently zero all 1319 of those rows — one eighth of the benchmark — while still reporting a plausible overall score. `report.json` carries overall accuracy, a per-perturbation breakdown, and `score_wo_critical_thinking` (upstream's `gsmplus_wo_ncr`); the paper leads with both. Fidelity, measured against upstream's own stored predictions: replaying `results/gpt-3.5-turbo.json` (all 10552 items) through the real extraction and grading reproduces upstream's persisted `gold` and `pred` on 10552/10552 and its verdict on 10527/10552 (99.76%). The 25 diffs are upstream's environment, not its logic — all one-directional (upstream False, port True) and all genuinely-equal fraction/decimal pairs (3/1 vs 3, 7/20 vs 0.35). Upstream's requirements.txt pins sympy==1.12 and no antlr4-python3-runtime, so its `parse_latex` raised and `check_sympy_equivalence`'s bare `except:` silently degraded to string equality; sieval's [math] extra pins that runtime, so the same vendored code reaches its symbolic branch. Published 61.19 -> 61.43 overall, and the `integer-decimal-fraction conversion` cell moves most (62.32 -> 63.84, holding 20 of the 25) — that perturbation exists precisely to rewrite integers as decimals and fractions. Kept faithful rather than re-broken to match the published digits; `status="experimental"` until a live run reproduces a published model's full 8-cell table within a stated band. Not ported, deliberately: the other prompting techniques (pot / complex / contrastive / ltm — three of which exec() model-generated Python) and `cot_sc` self-consistency; plus the confusion matrix and decay rate, which need a paired GSM8K run. The `seed_*` columns those need are preserved on every sample. 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
Important
Blocking question for review: upstream's code repo has no license.
qtli/GSM-Plusships noLICENSE/COPYING/NOTICEfile, no SPDX metadata(
gh api repos/qtli/GSM-Plus→"license": null), and no license statement inits README — so by default it is all-rights-reserved, and vendoring it into
Apache-2.0 sieval is not clearly permitted. This is the same class of gate as the
UGMathBench GPL case, where the answer was "reimplement, don't vendor".
Scope, so the call is informed: of the 286 lines in
sieval/community/gsm_plus.py, the bulk carries independent permissiveprovenance —
SUBSTITUTIONS/REMOVED_EXPRESSIONS/normalize_final_answerare Minerva (Lewkowycz et al., per upstream's own attribution comment, and also
shipped in lm-evaluation-harness under Apache-2.0), and
delete_extra_zeroisMetaMath-lineage (MIT). The GSM-Plus-original surface is ~80 lines:
extract_gold_ans,extract_pred_ans's cot branch,check_sympy_equivalence,and
extract_pred_ans_none+ its_NONE_PATTERNSrefusal list (the genuinelycreative part). Reimplementing just that surface is tractable if we want the
UGMathBench treatment. Do not merge until this is decided. Note the dataset
is separately and clearly CC-BY-SA-4.0, and is referenced, not redistributed.
qtli/GSM-Plus@3474129e;
data qintongli/GSM-Plus@3b708db5):
GSM8K's 1319 test problems rewritten under 8 adversarial perturbations, so a
model's GSM8K score can be compared against the same problems perturbed.
10552 rows; upstream's
testmini(2400) viaeval_split.perturbation_type, because thecritical thinkingperturbation deletes aquantity the question needs — its gold answer is the literal string
"None"("unanswerable"), scored on refusal phrasing rather than on a number. A
numeric-only scorer silently zeroes all 1319 of those rows (⅛ of the benchmark)
while still reporting a plausible overall score.
report.jsoncarries overall accuracy, a per-perturbation breakdown, andscore_wo_critical_thinking(upstream'sgsmplus_wo_ncr) — the paper leadswith both.
status="experimental", for two independent reasons: the licensing questionabove, and no live-model run yet (validation is replay-based, see Manual below).
mathextra, whose pinned ANTLRruntime is load-bearing here (see the score table).
Related Issues
None.
Test Plan
Automated
ruff check && ruff format --check)ty check(the project's primary checker) passes.mypy sievalreports 28 unannotated-def findings in the new files, in linewith the precedent it mirrors (
deepseek_math.py52,gsm8k.py1,gsm8k_0shot_gen.py7) against 1347 pre-existing repo-wide.(
tests/unit/tasks/test_gsm_plus_0shot_gen.py,tests/unit/datasets/test_gsm_plus.py).scripts/check_preflight.py --level deepexits 0 (sole WARN is apre-existing Wikipedia 403, unrelated).
sync_meta_index.py --checkandsync_package_stubs.py --checkboth clean.Manual
ships
results/gpt-3.5-turbo.json, which persists its owngold,predand
resultper sample. Replaying all 10552 items through this PR's realextraction + grading reproduces upstream's
goldandpredon10552/10552 and its verdict on 10527/10552 (99.76%).
sieval dataset download gsm_plussucceeds;sieval task show gsm_plus_0shot_genreportsReady: yes.test10552 /testmini2400), 8×1319 type balance, interleaved order confirmed (so a
sliceof amultiple of 8 stays perturbation-balanced); prompts render; a
#### 27rollout and a refusal rollout each score correctly on their row.
the reason
status="experimental"stays until a run reproduces a publishedmodel's full 8-cell table within a stated band.
Score comparison (GPT-3.5-Turbo, 0-shot CoT — replay-derived, not a live run)
Max diff +1.52pp, inside the template's <3% target, and one-directional.
Every diff is upstream's environment, not its logic. All 25 disagreements have
upstream
False/ this portTrue, and all 25 are pairs that are genuinely equal(
3/1vs3,7/20vs0.35,2.45vs2450/1000). Upstream'srequirements.txtpinssympy==1.12and noantlr4-python3-runtime, whichparse_latexrequires — so in the authors' environment everyparse_latexcallraised, and
check_sympy_equivalence's bareexcept:silently degraded it tostring equality. The published table is therefore a string-equality table. sieval's
[math]extra does pin that runtime, so the same vendored code reaches itssymbolic branch. 20 of the 25 land on
integer-decimal-fraction conversion, whichis exactly the perturbation whose purpose is rewriting integers as decimals and
fractions — i.e. where string vs. symbolic equality disagree most.
Reproducing the published digits exactly would mean deliberately breaking
parse_latex— bespoke logic diverging from upstream source, worse on both thefidelity and the correctness axis — so the port stays faithful and the gap is
documented in the module docstring and
reference_impl.notes.Checklist
Required (all PRs)
type(scope): description)AI-Generated Code - <model> (<provider>)in module docstringcore/—core/untouchedIf: New or Modified Benchmark
sieval dataset download gsm_plussucceeds)__init__.py— via the auto-discoveryregistry; generated
__init__.pyistubs andmeta/index.jsonregeneratedand committed.
If: community/ Changes
only the
prompt_type == "cot"branch ported (the other ten multiplexprompting techniques, three of which
exec()model-generated Python);mv == 1only (nocot_sc5-sample majority vote);extract_gold_ansraises
ValueErrorwhere upstream callspdb.set_trace(); regex literalsspelled as raw strings (identical string values, no
SyntaxWarning).The task docstring additionally documents the unported confusion
matrix / decay rate, which need a paired GSM8K run — the
seed_*columnsthey need are preserved on every sample.
license to attribute; see the blocking note at the top of Summary. The
module header does pin the exact source commit and file, and upstream's own
Minerva attribution comment is preserved verbatim.
If: New Dependency
N/A — no new dependencies.