A Math Reward Grader That Pays for Copying the Question
· code
Before a planned reinforcement-learning run on a small ternary model, I audited the math grader that would hand out the reward. An RL policy searches for answers the grader pays for, so a grader that is fine for scoring a benchmark can still be a bad reward. The run was cancelled for unrelated reasons, but the audit found a reward hole I hadn’t seen reported: on MATH-500 prompts of the form “Simplify $expr$”, answering with expr itself is graded correct by symbolic graders.
Short version:
- Hugging Face’s Math-Verify 0.9.0 accepts the copied expression on 19 of 31 such prompts.
- So did our own symbolic grader, on 23 of 31. 18 of the 31 are accepted by both, so using one as a check on the other wouldn’t flag them.
- Older string-matching graders accept 1 of 31. The hole comes with symbolic-equivalence grading, because the grader evaluates both sides.
- A small model produced one of these unprompted, in a real evaluation run.
- A guard that sees the problem text closes the hole in our grader (0 of 31), at a measured cost of 2 vetoes in 1,205 real answers: correct values in unreduced form, one on a problem that asked for simplest radical form and one that relied on the convention that fractions are reduced.
- Math-Verify also accepts a right number with the wrong unit (12 m for 12 cm) on all 6 pairs tested.
I put every case into a small script you can point at your own reward function.
Setup
Four graders were compared:
- v2 and v2.1: our grade of record for MATH, a normaliser derived from the Hendrycks MATH one plus our own fixes. They compare strings after normalising.
- v2.2r: a grader written for the RL run, with symbolic and numeric equivalence on top. It has a default mode, and a reward mode that also takes the problem text (more on that below).
- Math-Verify 0.9.0, the newest release on PyPI as of 2026-11-27, called the way TRL’s accuracy reward calls it. Gold and prediction are each wrapped in
$\boxed{...}$, parsed with LaTeX and expression extraction, then compared withverify(gold, pred). Dependencies werelatex2sympy2_extended1.11.0 and sympy 1.14.0. A second, plainer call style gave the same counts on everything below.
The test data:
- MATH-500;
- real final answers from our own runs (a Qwen3.6-35B-A3B quantization ladder and Ternary Bonsai 1.7B), with hand labels;
- hand-built batteries;
- held-out sets written before each grader fix they tested.
Nothing here comes from an RL run. The run was dropped before it started, so every “a policy would learn this” statement below is a prediction, not a measurement.
Copying the question
The probe takes every MATH-500 problem phrased “Simplify / Compute / Evaluate / Express / Convert / What is the value of $expr$” and answers with expr. A narrow regex finds 31 such problems, so this is a lower bound on how many are exposed.
| grader | copied expressions accepted (of 31) |
|---|---|
| v2 | 1 |
| v2.1 | 1 |
| Math-Verify 0.9.0 | 19 |
| v2.2r, default mode | 23 |
| accepted by both Math-Verify and v2.2r | 18 |
| v2.2r, reward mode (with the problem text) | 0 |
Some of the answers Math-Verify accepts:
| problem asks to evaluate | gold | answer given (the question’s own expression) |
|---|---|---|
99^2+99+1 | 9901 | 99^2+99+1 |
513^2 - 487^2 | 26000 | 513^2 - 487^2 |
\sqrt{242} | 11\sqrt2 | \sqrt{242} |
\dbinom{31}{28} | 4495 | \dbinom{31}{28} |
\log_264 | 6 | \log_264 |
The reason is simple once you see it. A symbolic grader decides equivalence by evaluating both sides, and the question’s expression evaluates to the answer. Math-Verify’s verify(gold, pred) never sees the problem, so it can’t tell “the model computed 9901” from “the model copied the question”. The string-matching graders reject these because 99^2+99+1 doesn’t normalise to 9901. Their one acceptance is \frac{57}{160} against .35625 on a “convert to a decimal” problem.
This isn’t hypothetical. In one of our evaluation runs, Ternary Bonsai 1.7B answered “Simplify $\tan 100^\circ + 4 \sin 100^\circ$” by boxing \tan(100^\circ) + 4 \sin(100^\circ), and v2.2r graded it correct because it evaluates to the gold, $-\sqrt{3}$. That’s one occurrence in 1,500 runs of one small model. But the response is mechanical (copy the expression), and under Math-Verify it pays on at least 19 of MATH-500’s 500 problems. A recent paper argues that leaks like this, which work across many prompts, are the kind GRPO amplifies (arXiv 2611.13218, below).
The 18 accepted by both graders matter for monitoring. Our plan had been to re-grade rollouts with Math-Verify during training and stop if the two disagreed. On this class they mostly don’t disagree.
Our 59-case exploit battery, built before this was found, had no copied-question case. v2.2r passed it with 0 of 59. A clean battery result didn’t mean a safe reward; it meant the battery hadn’t thought of this.
The fix, and what it costs
The fix needs the problem text, which an RL reward function has anyway. v2.2r’s reward mode adds two guards that can only turn an accept into a reject:
- G1, a form guard: for a literal gold (an integer, decimal, fraction, simplified radical and so on), reject a prediction that still contains an operation the gold doesn’t, like
+between numbers,\binom,\log, trig, or an unreduced radical. - G2, an echo guard: reject a prediction whose normalised form appears in the normalised problem text while differing from the gold.
Results in reward mode:
- The 31 copied expressions: 0 accepted, and all 31 golds still accepted.
- A fresh held-out set of 46 cases (25 wrong, 21 right), written before the fix with its hash committed first: 0 of 25 wrong answers accepted and 0 of 21 right ones rejected. Default mode, on the same set, accepted 19 of the 25 wrong answers.
- Cost on real outputs: 2 vetoes in 1,205 real final answers that the core comparison accepted (0.17%). Both were correct values in unreduced form:
\sqrt{117}on a problem that asked for simplest radical form, and\frac{2240}{78125}for\frac{448}{15625}on a probability problem that asked for no form, relying on the convention that fractions are reduced. G2 fired on real answers only on the true echo.
This is a heuristic, and it’s ours. G1 is about 230 lines of form rules and regexes, and G2 is a substring test. Both are fail-closed: an exception in a guard counts as a reject. The result shows that one problem-aware fix works on our test sets. It isn’t a claim about Math-Verify plus a guard, and calling the same grader without the problem text brings the hole back (23 of 31).
Other things Math-Verify accepts
On the same battery and a held-out set, the other false positives in Math-Verify 0.9.0 are mostly known kinds:
- Units: a right number with the wrong unit was accepted on all 6 pairs tested:
12 \text{ m}for12 \text{ cm}, inches for feet, hours for minutes, degrees for radians, cents for\$8, square for cubic units. Math-Verify normalises units away by design. v2 and v2.1 accept all 6 too, and v2.2r rejects all 6 after we fixed the same bug in it. - Hedges in parentheses:
12\text{ (or 13)},12\text{ (not sure)}and12 \text{ (approximately)}all grade as 12. - Tolerance:
0.1500001for 0.15. - Base subscripts:
204_6for204_5.
That’s 5 of the 59 exploit-battery cases, against 28 of 59 for v2 and v2.1. On a held-out set of 36 pairs (21 wrong), Math-Verify accepted 13 of the 21: more trailing and parenthesised hedges, x \approx 7, 0.4999999 for ½, 101_2 for 101_3, and the 6 unit pairs.
In the other direction, Math-Verify’s misses on our real answers were ordinals only. It rejected 12^{\text{th}} and \text{12th grade} for 12: 4 of 470 correct final answers, and 21 of 1,540 correct mid-run probe answers. It accepted none of 171 real wrong final answers. On equivalent forms it is much stronger than our string graders.
How the audit was run
The gate for using a grader as an RL reward had five parts, each checked on CPU before any training:
P1, an exploit battery with zero false positives allowed. No rate threshold applies, because RL will find a single exploitable class. The battery has 59 wrong answers: 14 hedges, 13 text answers, 11 tolerance cases, 10 multiple values and 11 controls. It now also includes the 31 copied expressions.
P2, fresh held-out sets, with 0 false positives and at most 10% false negatives. Each set was written before the fix it tested, kept from the grader’s author, and used once. They kept finding things the in-sample batteries didn’t:
- one set rejected 7 of 36 correct answers (19%) after 0% in-sample;
- another rejected 9 of 62 (14.5%) and failed the bar;
- three later sets accepted 0 of 119 wrong answers between them.
P3, a self-test on the reward pool’s own answers. For each of the 4,000 golds in the RL problem pool, generate equivalent rewrites (which must be accepted) and wrong perturbations (which must be rejected). The idea comes from arXiv 2609.01354, below. In reward mode we also generated unevaluated equivalents, which must be rejected.
- It failed as pre-registered. It passed only after scientific notation was reclassified from “must reject” to neutral (the grader accepts only exact values, so it pays for nothing uncomputed). The generator also dropped 100 rewrites that weren’t true equivalents and 4 perturbations equal to the gold. The grader didn’t change.
- Final run: 8,728 of 8,782 final-form rewrites accepted (99.39%), 0 of 18,387 unevaluated rewrites accepted, and 0 of 46,663 perturbations accepted.
P4, real outputs: at least 300 real wrong answers, each read by hand where the judges disagreed. On 737 true-wrong final answers, the core v2.2r accepted 1 (0.14%), or 2 of 738 (0.27%) if an answer in the wrong requested form counts as wrong. It rejected 0 of 1,204 correct ones (1,203 under the strict reading). v2 and v2.1 accepted 7 wrong ones on the Ternary Bonsai 1.7B runs alone.
P5, a live monitor during training:
- a hedge counter;
- Math-Verify as an independent checker;
- an abort if the share of correct-looking answers vetoed by G1/G2 went above 5% at any check, or above 2% at two checks in a row. Those thresholds were set at about 5× and 12× the guards’ veto rate on Bonsai’s real answers, 3 of 735 (0.41%): one true echo and two form vetoes of correct values.
It was unit-tested but never ran, because the run was cancelled.
The hand labels have one wrinkle. On the Qwen runs and the non-thinking Bonsai run, every distinct answer pair was read. On the thinking-mode Bonsai runs, the 712 pairs where four judges agreed took that verdict, and only the 21 disagreements were read by hand.
Bugs in our own grader
These are specific to the grader we wrote, not to Math-Verify. They’re here because they’re the kind of thing a hand-written reward grader gets wrong.
- Thousands separators read as a list. MATH-500 has a gold written
11,\! 111,\! 111,\! 100. v2.2r splits it into four values. It accepts three wrong list answers like\{11, 111, 111, 100\}and rejects both right forms. Math-Verify 0.9.0 handles it correctly. We excluded the form from the RL pool with an assert (0 of 4,000 golds had it) rather than change a frozen grader. - A missing sympy is a silent False. v2.2r imports sympy inside its symbolic path. Under a Python without sympy, the import fails, the failure is caught, and the comparison returns False with no error. It turned a correct
1+2\sqrt3(gold1+2\sqrt{3}) into a miss in one scoring run. It only adds false negatives, but you’d never see them. Math-Verify declares sympy a hard dependency. Our fix was a known-symbolic positive control that must pass before training starts. - Older bugs in v2 and v2.1, found early in the audit, none new:
12 \text{ or } 13grades as 12, inherited from the Hendrycks normaliser’s_remove_right_units, which cuts everything after the first\text{;- word answers are stripped to nothing, so
\text{south}equals\text{east}, which happened in real runs; - an absolute 1e-6 tolerance floor accepts
0.00006784for.0000672.
Run the battery
reward_grader_battery.py and battery.json hold the 59 exploit cases, the 31 copied expressions with their problem text, the 6 unit pairs and the thousands-separator case. The script also checks that each echo prompt’s own gold is accepted, so a grader that rejects everything doesn’t pass. It needs no other code. Math-Verify is optional.
The script and data are in a gist: gist.
pip install "math-verify[antlr4_13_2]==0.9.0"
python -I reward_grader_battery.py mathverify # Math-Verify, TRL-style call
python -I reward_grader_battery.py py:my_reward.py:grade # your grade(pred, gold)
python -I reward_grader_battery.py pyq:my_reward.py:grade # your grade(pred, gold, problem)A grader passes only if it accepts no wrong case, accepts every gold and raises no error. As of 2026-11-27, nothing I tested passes:
| grader | exploits (of 59) | copied expressions (of 31) | wrong units (of 6) | thousands, wrong lists accepted (of 3) |
|---|---|---|---|---|
| Math-Verify 0.9.0 | 5 | 19 | 6 | 0 |
| v2 / v2.1 | 28 | 1 | 6 | 1 |
| v2.2r, default | 0 | 23 | 0 | 3 |
| v2.2r, reward mode | 0 | 0 | 0 | 3 |
Prior work
Verifier errors in RL with verifiable rewards are well studied, and most of what we found early has prior art:
- arXiv 2609.01354 (“Where the Verifier Fails”) audits math verifiers, Math-Verify included, with 307,420 verdicts on certified-equivalent rewrites. It reports scale-dependent tolerance false positives, which covers our tolerance bug, and its rewrite method is where P3 came from. It counts unreduced forms as correct (its stratum S14, which Math-Verify rejects 0% of), the opposite contract from a reward that must reject unevaluated answers. Its wrong-answer transforms change the gold only, so a copied question is outside its design.
- arXiv 2606.01066 (“Before the Model Learns the Bug: Fuzzing RLVR Verifiers”) fuzzes verifiers before training, including a replay against Math-Verify. It’s the closest method to P1. Its math bug classes are loose extraction, a missing answer marker, contradiction blindness and loose tolerance. It has no copied-question case.
- arXiv 2611.13218 (“Wrong the Same Way”) argues that verifier leaks shared across prompts get amplified by GRPO. We use it only for that prediction; it doesn’t test a math checker.
- arXiv 2505.22203 shows rule-based verifier false negatives grow as the policy gets stronger, and that model-based judges get hacked.
- arXiv 2611.21538 shows optimistic verifiers get hacked by padding, the same mechanism as the hedge bug.
- The hedge truncation is the Hendrycks MATH normaliser’s
_remove_right_units, which is well known. Math-Verify normalises units by design.
I searched the full text of 2606.01066 and 2609.01354 for copied-question cases (echo, restate, copy, unsimplified, unevaluated, problem text, the question) and found none. A separate prior-art review of papers, Math-Verify’s issue tracker and practitioner sources found no earlier report of this class on Math-Verify-style graders.
What this adds:
- a measured copied-question hole in Math-Verify 0.9.0 and in our own symbolic grader, with one real unprompted case;
- the 18 of 31 that both graders accept, which defeats a two-grader disagreement monitor;
- wrong units accepted by Math-Verify;
- a problem-aware guard, checked on a held-out set written before the fix;
- a runnable battery.
Takeaways
- If your RL reward checks math answers symbolically, it probably pays for copying the question on “Simplify / Compute / Evaluate” prompts. The fix needs the problem text, which a plain
verify(gold, pred)doesn’t take. - Two graders agreeing isn’t independent evidence when both evaluate expressions the same way. Math-Verify and our symbolic grader accepted 18 of the same 31 copies.
- A battery with zero false positives tells you what it covers and nothing else. Ours passed at 0 of 59 before this class turned up, and held-out sets written before each fix kept finding things the in-sample tests missed.
The audit and fact-checking were done with Claude Code and Gemini agents; I directed and reviewed the work.