GSM8K › Accuracy Metrics for GSM8K

Michael BrenndoerferMarch 1, 20266 min read
Language AI HandbookAll chapters
Part 54 of 67Benchmark Evaluation
Chapter 417GSM8K › Accuracy Metrics for GSM8K
Reading section 5 of 13 · Accuracy Metrics for GSM8K · 6 minSection 5 of 13 · 6 min

Book contents

Section 5 of 13 · 6 min read

GSM8K › Accuracy Metrics for GSM8KOne section · Sections in this chapter5 / 13 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Evaluating solutions to GSM8K problems requires precise answer extraction and comparison. Unlike open-ended generation tasks where BLEU or ROUGE scores might apply, mathematical problems demand exact correctness. There is no partial credit for being close to the right answer; the binary nature of mathematical truth requires binary evaluation criteria.

The evaluation protocol must handle the tension between the richness of natural language generation and the precision required for mathematical verification. Models may produce verbose explanations, include units, or format numbers differently, yet the underlying mathematical claim must be extracted and verified against the ground truth with perfect accuracy.

Exact Match Evaluation

The primary metric for GSM8K is exact match on the final numeric answer. An answer is considered correct only if it matches the ground truth exactly, with no tolerance for rounding errors or alternative representations. If the correct answer is 18, then "18 dollars," "18.0," or "eighteen" would typically be marked incorrect unless the evaluation script specifically normalizes these variations.

Let NN denote the number of test problems, let yiy_i be the ground truth answer for problem ii, and let y^i\hat{y}_i be the model's predicted answer after extraction and normalization. The GSM8K accuracy metric is:

Accuracy=1N∑i=1N1[y^i=yi]\text{Accuracy} = \frac{1}{N} \sum_{i=1}^{N} \mathbf{1}[\hat{y}_i = y_i]

where 1[y^i=yi]\mathbf{1}[\hat{y}_i = y_i] equals 1 when the predicted answer exactly matches the ground truth and 0 otherwise.

This strict criterion shows the binary nature of mathematical truth. A reasoning chain that arrives at "17" instead of "18" for the duck egg problem contains an error somewhere, whether in arithmetic or problem understanding, and fails to solve the problem correctly. While this strictness may seem harsh compared to human grading where partial credit is common, it gives an unambiguous signal for model capability assessment and avoids the subjective judgment calls required for partial credit assignment.

Answer Extraction

Robust evaluation requires parsing model outputs to extract numeric answers. Models may generate verbose responses including explanations, units, and commentary. The extraction system must handle this complexity to isolate the mathematical claim from its linguistic packaging.

Standard extraction strategies include:

  • Regular expression matching for numbers following the #### delimiter (when models are prompted to use this format)
  • Extracting the final number appearing in the text, based on the heuristic that models typically state their final answer last
  • Pattern matching for phrases like "The answer is [number]" or "Therefore, the result is [number]"

The extraction process materially impacts reported accuracy. If a model correctly calculates an answer but expresses it as "18 dollars" while the evaluator expects "18," the model receives no credit despite possessing the correct understanding. This sensitivity necessitates careful normalization routines that strip units, handle decimal representations, and account for common formatting variations while remaining reliable to adversarial cases where numbers in the explanation might be mistaken for the final answer.

Normalization typically applies a standardized pipeline: remove currency symbols, strip units, replace commas in large numbers (e.g., "1,024" becomes "1024"), and convert decimal representations to standard form. The challenge is that overly aggressive normalization can introduce false positives. If a problem asks for the answer in cents and the model answers in dollars, stripping units might make an incorrect answer appear correct.

Per-Step Accuracy and Error Taxonomy

Beyond final answer correctness, researchers sometimes analyze per-step accuracy by comparing generated reasoning chains against reference solutions. This finer-grained metric identifies where reasoning breaks down and gives diagnostic insight into model limitations.

Four distinct error types characterize reasoning failures on GSM8K:

Conceptual errors stand for misunderstandings of the problem structure itself: adding instead of subtracting, using a multiplication rate where a division is required, or misidentifying which quantities are needed to the solution. These errors occur regardless of arithmetic accuracy; the model understands all the numbers but connects them with the wrong operation.

Arithmetic errors occur when the model correctly identifies the required operations but computes them incorrectly. The model understands that it needs to multiply 9 eggs by $2 per egg, but arrives at $17 instead of $18 due to a calculation mistake. These errors are purely computational rather than conceptual.

Truncation errors involve stopping before reaching the final answer, perhaps after calculating an intermediate value. The model correctly computes that Janet has 9 eggs remaining, but fails to multiply by the price to obtain the final dollar amount.

Hallucination errors involve introducing quantities not present in the problem or inventing calculations without basis in the problem text. A model might fabricate a "processing fee" or introduce a fictional discount that changes the problem structure entirely.

Analyzing error patterns reveals that larger models primarily reduce arithmetic errors while maintaining similar rates of conceptual misunderstanding, suggesting that scale improves execution more than comprehension. This decomposition is important for guiding model improvement: if errors are primarily arithmetic, integrating calculators or improving numerical precision may help; if errors are conceptual, better training on problem understanding or logical reasoning may be required.

Out[7]:
Visualization
Horizontal bar chart: Arithmetic 45%, Conceptual 35%, Truncation 12%, Hallucination 8%.
Distribution of error types in GSM8K chain-of-thought reasoning. Arithmetic errors dominate at 45%, showing that calculation mistakes are more common than structural misunderstandings of problem setup. Conceptual errors (35%) form the second-largest category, while truncation and hallucination errors together account for 20% of failures.
Out[8]:
Visualization
Line chart with shaded area: accuracy declines from 85% at 2 steps to 40% at 8 steps, steepest decline at steps 4-6.
GSM8K accuracy as a function of reasoning chain length (number of required steps). Short 2-step problems reach 85% accuracy while 8-step problems reach only 40%, showing the compounding effect of sequential reasoning errors. The steepest decline occurs between steps 4 and 6, where accumulated errors reach a necessary threshold.