Repository navigation
fix(math_with_autograder): realign column-shifted imo-bench-algebra-036 row - #4767
Merged
Merged
Conversation
…36 row The pinned answerbench_v2.csv leaves imo-bench-algebra-036's Problem quote unterminated (google-deepmind/superhuman#13). csv.DictReader then appends the answer cell to the problem and shifts every later column left, so the gold became the category label "Algebra", the real answer leaked into the prompt, and Source was null. The README sample (example.jsonl row 2) and the imo_answerbench benchmark both shipped that row. prepare.py now realigns a row of that shape, and raises before writing anything if any row still has a missing or extra cell. example.jsonl row 2 and example_metrics.json are regenerated from the realigned row; the task_data description no longer calls a null source normal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: qiaochuz <qiaochuz@nvidia.com>
Contributor
Author
|
/ok to test f909cdd |
cmunley1
approved these changes
Oct 20, 2026
cmunley1
left a comment
Contributor
There was a problem hiding this comment.
lgtm, @gwarmstrong can you take a look?
gwarmstrong
approved these changes
Oct 20, 2026
gwarmstrong
left a comment
Contributor
There was a problem hiding this comment.
lgtm as well, thanks for the fix
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39457996667 |
This branch was previously 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?
imo-bench-algebra-036is no longer column-shifted. Its gold answer was the category labelAlgebra, the real answer$Y(x)=A+\frac{B}{x}-x$was appended to the problem text the policy sees, andsourcewas null. A correct answer therefore scored 0, and the prompt leaked the answer. The row shipped in both themath_with_autograderREADME sample (data/example.jsonlrow 2) and the 400-rowimo_answerbenchbenchmark thatprepare.pybuilds.Fixes NVBug 6900619.
Closes #4506.
Cause
The pinned upstream file (
google-deepmind/superhuman@326a740a,imobench/answerbench_v2.csv) never closes the quote around this row's Problem field: lines 150–154 end with\], a newline, then,"$Y(x)=A+\frac{B}{x}-x$",Algebra,Functional Equation,Iran 2002. Upstream tracks it as google-deepmind/superhuman#13, still open; the file's last upstream change (2026-02-13) predates the report, so there is no fixed revision to move the pin to.csv.DictReaderends the Problem at the answer's opening quote, appends\n,<answer>"to it, and shifts every later cell one column left, leavingSourceempty.benchmarks/imo_answerbench/prepare.py(added in #1155) copied each parsed row verbatim, andexample.jsonlrow 2 is that output byte for byte. Nothing checked the row shape;task_data.pyeven describedsourceas "null in some rows", which only this broken row was. Only this row is affected: a full parse of the pinned CSV finds one misaligned row out of 400 (99 Algebra + 1 "Functional Equation" before, 100 per category after). NeMo Skills'imo-answerbenchprepare reads the same CSV the same way, so it has the same row.Fix
prepare.py:_realign_unterminated_problem()recognises the shape (Source missing, Problem ending in\n,<answer>") and moves the cells back. The Problem keeps its trailing newline, as its neighbours do. Every row is then checked before anything is written; a row that still has a missing or extra cell raisesValueErrorwith its problem ID instead of shipping a shifted row. The docstring records the one-row divergence from Skills.example.jsonlrow 2 is regenerated from the realigned upstream row: question (top level and inresponses_create_params.input), gold, category, subcategory, source. The other four rows are byte-identical.example_metrics.jsonis regenerated withgym dataset collate ... +mode=example_validation(category unique count 5→4; source now 5 rows / 4 unique). Thesourceentry moves up in the file because the dataset config gained its ownsourcefield (feat(config): unify dataset source via discriminatedsource:block (FEP-1025) #1637) after this file was written; the writer places the column statistic in that slot.task_data.py: thesourcedescription drops "null in some rows".Realigning by shape rather than hard-coding the corrected row keeps the fix tied to the upstream bytes; if superhuman#13 is fixed and the pin moves, the row parses normally and the realignment does nothing. Dropping the row would change the benchmark size, and leaving it would keep a guaranteed false zero.
Test:
tests/unit_tests/test_imo_answerbench_prepare.pyfeedsprepare()a verbatim excerpt of the pinned CSV (header and lines 148–158: algebra-035, -036, -037) through a stubbedurlopen. It checks that algebra-036 comes out realigned and its neighbours unchanged, that another misaligned row raises before the output file is written, and that every shippedexample.jsonlrow has a real category, a non-empty source, a non-category gold, and that row 2 equals the realigned output.Not changed:
example_rollouts.jsonl. Its five committed rows (from #1155) have empty model output and reward 0, so they carry no grading evidence; regenerating them needs a live model and is left out of this data fix.Before the fix
Gym
7ada5311b(main):python -c 'import json; r=[json.loads(l) for l in open("resources_servers/math_with_autograder/data/example.jsonl")][1]; print({k: r[k] for k in ("problem_id","expected_answer","category","subcategory","source")}); print(repr(r["question"][-40:]))'QA answer-key check (
every shipped README sample carries a real answer key):After the fix
This branch, same commands:
prepare()against the real pinned CSV: 400 rows, 100 per category, and onlyimo-bench-algebra-036differs frommain's output.Live run on one H100 (Qwen3-8B policy on vLLM,
openai/gpt-oss-20bjudge on NIM, README'sgym eval run --agent math_with_autograder_simple_agent --input .../example.jsonl --num-repeats 1). The algebra-036 prompt no longer contains the answer. The model's own answer (Y(x) = -x + c) went to the judge against the real gold, and the judge rejected it for missing solutions. Verifier controls on the same row:Before the fix the reference control could only box
Algebra, so a correct answer could never score.Validation
math_with_autograder(internal suite, one H100):main0/2, where the answer-key case fails on this row and the live case fails on a stale QA-sideagent_refexpectation (fixed in the suite, not in Gym); this branch 2/2 with the suite's matching updatetests/unit_tests/test_imo_answerbench_prepare.py: 3 failed before, 3 passed aftertests/unit_tests/test_benchmarks.py,test_task_data.py,test_train_data_utils.py: 520 passed;test_every_repo_benchmark_appears_in_listingfails identically onmainon the test machine (DNS:apex_shortlist/hleopencode/pi configs cannot resolve), unrelatedgym env test +entrypoint=resources_servers/math_with_autograder +should_validate_data=true: 25 passed, example data validatedpre-commit run --all-files: passed, no changes[0, 0, 1, 0, 1]; algebra-036 graded against the real goldCompatibility
Benchmark results change for one of 400 IMO AnswerBench problems: algebra-036 is now gradable (it could only score 0 before) and no longer shows the answer in the prompt. Gym and NeMo Skills now differ on that row until Skills gets the same repair or superhuman#13 is fixed. A future pin to a CSV with any other misaligned row now fails
prepareloudly instead of writing it.🤖 Generated with Claude Code