Mathematical Reasoning: MATH & GSM8K
Master mathematical reasoning benchmarks: MATH dataset, GSM8K evaluation, chain-of-thought prompting, and mathematical problem-solving.
What is a mathematical reasoning benchmark?
A mathematical reasoning benchmark is a versioned set of problems, prompts, answer rules, and scoring procedures used to measure how reliably a model solves mathematical tasks. MATH focuses on competition-style problems across several subjects and difficulty levels. GSM8K focuses on linguistically varied, multi-step grade-school word problems.
In plain language, these benchmarks are controlled exams. They matter because a model can sound mathematically fluent while choosing the wrong operation, losing a constraint, making an arithmetic error, or formatting an equivalent answer in a way that a brittle grader rejects.
The core invariant is same task set, same prompt contract, same decoding budget, and same verifier. A score is evidence about that frozen experiment, not proof that the model understands mathematics generally or that a generated explanation faithfully exposes its internal reasoning.
This lesson builds on evaluation benchmarks. Review that lesson first if holdouts, contamination, slices, or uncertainty are unfamiliar.
12,500
MATH problems
7,500 train and 5,000 test problems in the original release
7,473 + 1,319
GSM8K split
Training and test problems in the original release
7 x 5
MATH slices
Seven subjects crossed with five difficulty levels
1 contract
Comparable score
Freeze prompt, sampling, extraction, verification, and aggregation
Build evidence from tasks to a claim
A benchmark result is the end of a measurement pipeline. Each stage can change the score, so each stage belongs in the run manifest.
1 Dataset
Freeze the task manifest
Record the dataset revision, split, task IDs, subject and difficulty metadata, exclusions, and contamination policy.
2 Inference
Generate under one contract
Pin the prompt template, model revision, decoding settings, candidate count, token budget, tool access, and retry policy.
3 Scoring
Extract and verify
Parse the declared final-answer field, normalize only allowed forms, compare under explicit mathematical assumptions, and retain parse failures.
4 Claim
Aggregate with slices
Report denominators, accuracy, uncertainty, subject and difficulty slices, cost, exclusions, and verifier failures together.
Minimum run manifest
- Task identity: dataset source, immutable revision, split, task IDs, deduplication result, and any excluded examples.
- Generation contract: exact prompt, demonstrations, model build, temperature, top-p, seed policy, candidate count, and maximum output tokens.
- Answer contract: required final-answer delimiter, parser version, allowed notation, units policy, variable assumptions, and timeout behavior.
- Reporting contract: micro or macro aggregation, slice definitions, confidence interval method, cost, latency, and failure taxonomy.
Do not compare two published numbers until their manifests match. Prompt demonstrations, answer extractors, symbolic-equivalence rules, tool access, and sample budgets can move the result without any model change.
Use MATH and GSM8K for different questions
Competition mathematics
MATH
The original MATH release contains 12,500 problems with worked solutions. Its seven subjects and five difficulty levels make it useful for locating failures in concept selection, symbolic manipulation, and longer derivations.
Language to arithmetic
GSM8K
GSM8K contains grade-school word problems whose challenge is often translating natural language into a short sequence of arithmetic operations. The original split contains 7,473 training and 1,319 test items.
What they can reveal
Shared signal
Under a frozen harness, both can expose regressions in final-answer accuracy and show which problem slices fail. Repeated evaluation can also compare prompting, verification, or model changes.
What they do not certify
Shared limit
Neither benchmark alone establishes theorem proving, advanced professional mathematics, visual reasoning, robustness to rewording, product safety, or the faithfulness of a generated explanation.
Read a MATH item as a structured task
Consider an angle-bisector problem where AB = 12, AC = 8, and BC = 15. If the bisector from A meets BC at D, the theorem gives BD / DC = 12 / 8 = 3 / 2. Since BD + DC = 15, the two parts are 9 and 6, so BD = 9.
The final answer tests correctness under the answer contract. The worked solution can support a separate diagnostic rubric, but it is not the only valid derivation.
Read a GSM8K item as a translation task
If 16 eggs are produced, 3 are eaten, 4 are used for baking, and each remaining egg sells for $2, the executable relation is (16 - 3 - 4) x 2 = 18. A useful error taxonomy separates:
- Interpretation error: the response adds consumed eggs instead of subtracting them.
- Planning error: the response multiplies before calculating the remaining inventory.
- Execution error: the selected operations are right, but an intermediate arithmetic step is wrong.
- Answer-contract error: the mathematics is right, but extraction or formatting fails.
Separate answer correctness from trace diagnosis
Final-answer scoring and trace review answer different questions. A symbolic checker can recognize equivalent expressions, but broad simplification can also introduce false positives when domains or variable assumptions are missing. A correct final answer can coexist with a broken visible derivation, while a valid derivation can still end with a transcription mistake.
Use the lab to change the response case and judging policy. Watch the answer verdict, trace verdict, evidence claim, and failure classification change independently.
Judge the answer the contract actually asks for
Change the response and verifier. The final-answer verdict, visible-trace diagnosis, evidence claim, and remediation update independently.
Loading scoring lab...
Define a fail-closed scoring contract
Extract before comparing
Require a machine-readable final field such as FINAL: ... or the dataset's documented delimiter. If extraction fails, record parse_failure; do not search the whole explanation for a convenient number. The response may contain examples, intermediate values, or a correction after an earlier answer.
Normalize only declared syntax
- Remove presentation-only wrappers such as a documented
\boxed{...}marker. - Normalize commas, surrounding whitespace, and an explicitly allowed currency or unit notation.
- Parse integers, decimals, and fractions into an exact numeric representation where possible.
- Use a symbolic parser only with a restricted grammar, explicit variables and assumptions, time limits, and retained parse errors.
- Keep incomplete sets, intervals, units, and multiple roots semantically distinct from a single scalar.
Score the trace separately
If the product needs an explanation, define a human or programmatic rubric for stated assumptions, valid transformations, arithmetic, completeness, and the final link from derivation to answer. Call this a visible trace diagnostic, not a measurement of hidden internal reasoning.
The original benchmark accuracy should remain reproducible under its declared scorer. Add stricter symbolic, trace, robustness, or product-specific diagnostics as separate metrics instead of silently changing the headline score.
Design the benchmark portfolio around the claim
MATH and GSM8K sample different task distributions. A tutoring assistant, a competition solver, and a general-purpose assistant therefore need different mixtures and verification depth. The next lab turns those choices into a visible coverage and release decision.
Change the product claim, task allocation, sample size, contamination estimate, and verification policy. The task counts, uncertainty estimate, evidence quality, blind spots, and release status update together.
Make the task mix match the product claim
Tune the benchmark allocation, clean denominator, and verification depth. Coverage, uncertainty, blind spots, and the release decision move together.
Loading portfolio lab...
Report a result without hiding its limits
Publish the score as a vector
- Overall final-answer accuracy with the exact denominator and an uncertainty interval.
- MATH accuracy by subject and difficulty, including empty or excluded slices.
- GSM8K accuracy plus interpretation, planning, execution, and answer-contract failure rates.
- Parse failures, symbolic-checker timeouts, invalid outputs, refusals, and dropped tasks.
- Prompt tokens, generated tokens, latency, candidate count, verifier cost, and tool usage.
Add robustness checks outside the original headline
- Reword problems without changing their mathematical meaning.
- Change names, units, values, or surface order while preserving the solution structure.
- Add distractors and boundary cases that reveal shortcut behavior.
- Rotate independently authored holdouts and search for train-test or prompt-library overlap.
- Compare answer-only performance with product-specific visible-trace or tool-use requirements.
A narrow confidence interval cannot repair a biased task mix, contaminated holdout, weak parser, or mismatched product claim. More samples reduce sampling uncertainty; they do not make the wrong experiment representative.
Implement the evaluator as an auditable boundary
The example below keeps extraction, parsing, equivalence, and aggregation separate. It uses exact rational arithmetic for supported numeric answers, returns explicit failure classes, and never treats a visible solution trace as proof of hidden reasoning.
Operational checks
- Version the parser and run it against known-equivalent, known-inequivalent, malformed, unit-bearing, set-valued, and adversarial fixtures.
- Retain raw output, extracted final field, normalized value, parser status, task metadata, and scorer version for every item.
- Alert on score changes together with parse-failure rate, slice regressions, output length, verifier timeout rate, contamination findings, and cost.
- Manually audit a bounded sample of passes and failures after any prompt, parser, model, or dataset change.
- Keep benchmark test items and answer keys out of prompt development, fine-tuning, retrieval indexes, and interactive debugging logs.
Ground the claims in the original releases
- The MATH paper introduces 12,500 competition mathematics problems with worked solutions.
- The GSM8K paper introduces the grade-school math word-problem benchmark and studies verifier-based selection.
- Use immutable dataset revisions and preserve each release's license, schema, split, and scoring protocol in the run manifest.
Public benchmarks are useful regression instruments. Release confidence comes from combining them with independent, product-shaped tasks and a verifier whose behavior is itself tested.