Evaluating Large Language Model Math Reasoning: From Subjective Impressions to a Quantitative Framework
Subjective claims like "model X feels more reliable at math" are common but neither reproducible nor actionable. This article lays out a practical protocol for evaluating large language model (LLM) math reasoning. It covers layering math ability into five levels, building a business-aligned and contamination-resistant question bank, adopting a three-layer grading strategy, fixing the sampling protocol with avg@n, pass@n, and confidence intervals, and factoring in reasoning efficiency. It also explains how to turn subjective preference into credible conclusions and how to run evaluation as a CI pipeline—so that model selection becomes a data-driven tradeoff rather than a debate based on impressions.
1. The Starting Point: Why “Who’s Stronger” Is Always Debated
The most common statement in model capability discussions is “in my use, some model feels more stable at math.” Such impressions are often real, but they are not reproducible, not attributable, and hard to guide engineering decisions. The reasons come down to three points:
- Sample bias: Most people only try a few problems they’re familiar with, or one category of problems, and the difficulty distribution of those problems doesn’t match the distribution of real needs.
- Inconsistent grading criteria: Some look only at whether the final answer is correct, some at whether the derivation is rigorous, some at whether it “reads like a human wrote it.” These three criteria will necessarily produce conflicting conclusions.
- Inconsistent runtime parameters: Decoding temperature, max output length, whether deep-reasoning mode is enabled, whether a code-execution tool is provided—any single difference makes results incomparable.
So discussing a “math ability ranking” without first fixing the evaluation protocol is essentially comparing different experimental conditions, not comparing models. The following section lays out a practical evaluation protocol design.
2. Layer the Abilities First: Math Is Not a Single Skill
Treating “math ability” as a single scalar inevitably produces muddled conclusions. In practice, it should be split into at least five levels, each scored separately:
| Level | Typical Tasks | Main Difficulties |
|---|---|---|
| L1 Numbers & Units | Multi-step arithmetic, unit conversion, percentages | Sign/carry errors in long chains |
| L2 Routine Algebra | Equations, inequalities, function properties | Step completeness and edge cases |
| L3 Structured Derivation | Proofs, case analysis, constructing counterexamples | Logical rigor, implicit premises |
| L4 Competition-Level Problems | Combinatorics, number theory, geometry | Large search space, requiring technique jumps |
| L5 Open-Ended Research Problems | Modeling and conjecturing theorems with no given method | No standard answer; needs human or expert review |
L1–L3 can be graded automatically and are suitable for high-frequency regression; L4 is used to distinguish top-tier models; L5 cannot be graded automatically at scale and can only rely on small-sample human review. Treating L5 results as an “overall math ability ranking” is the most common misuse—performance on open-ended problems depends heavily on the number of samples and the prompting method, and single-run results have very high variance.
3. Building the Question Bank: Difficulty, Distribution, and Contamination Resistance
3.1 Match the Distribution to the Business
If the business scenario is financial statement reconciliation, the weight of L1/L2 should be significantly higher than L4; if it’s research assistance, L4/L5 matters most. It’s best to sample from real business requests, then bucket by difficulty, forming a 200–500 question core set plus a continuously expanding hard set.
3.2 Parameterized Rewriting to Counter Memorization
Static question banks are easily covered by training data. A more robust approach is to templatize the problems and dynamically generate new parameters and new answers on each evaluation:
import randomdef gen_linear_word_problem(seed: int) -> dict:rng = random.Random(seed)unit_price = rng.randint(3, 97)qty_a, qty_b = rng.randint(2, 40), rng.randint(2, 40)discount = rng.choice([0, 5, 10, 15])total = unit_price * (qty_a + qty_b) * (100 - discount) / 100return {"prompt": f"A product priced at {unit_price} per unit is bought in quantities of {qty_a} and {qty_b}; "f"the whole order gets a {discount}% discount, and the payable amount is kept to two decimal places.","answer": round(total, 2),"tolerance": 0.01,}
The value of a parameterized question bank isn’t just anti-cheating; it also lets the same problem appear in different surface forms across multiple regressions, reducing “format overfitting.”
3.3 Contamination Detection
Two things should be done before a question bank goes live. First, use n-gram overlap (e.g. 13-gram) to check the similarity between problems and public corpora, and move high-overlap problems into a “monitor-only, not scored” partition. Second, apply slight semantic perturbations to the same problem (change the numbers, reorder the narration, add irrelevant distractor conditions); if accuracy drops off a cliff after perturbation, that model’s score came from memorization rather than reasoning.
4. Grading Strategy: Final Answer, Process, and Equivalence
Grading is the most underestimated part. A three-layer grader is recommended.
Layer 1: Answer normalization + numerical tolerance
def grade_numeric(pred: str, gold: float, tol: float = 0.01) -> bool:try:return abs(float(pred.strip().replace(",", "")) - gold) <= tolexcept ValueError:return False
Layer 2: Structured extraction + unit and format constraints. Require the model to put its final answer inside fixed markers, so a regex won’t mis-match within long reasoning:
Please first give your reasoning process, then output on a separate final line:Answer: <number or expression>
Layer 3: Process review. For proof and case-analysis problems, comparing only the final answer can’t distinguish a “lucky guess” from real understanding. Deterministic checks should come first (e.g. require the output of executable assertions, or a test-case pass rate), and only then model review. Model review must impose three constraints: give explicit scoring dimensions (correctness / completeness / rigor, each scored 0–2), hide the model’s identity, and randomize the order of candidate answers—to suppress position preference and self-preference.
5. Sampling Protocol: Single-Run Results Have No Statistical Meaning
The output variance of math reasoning is large, so a single scoring run is almost always dominated by noise. Fix the following protocol and record it in the report:
- Fixed decoding parameters: temperature, top_p, max output length, whether deep reasoning is enabled, whether a code-execution tool is allowed—all recorded explicitly;
- Repeated sampling: each problem sampled independently n times (n set to 5–10);
- Dual metrics: report both
avg@n(average accuracy, reflecting stability) andpass@n(at least one correct, reflecting the capability ceiling); - Confidence intervals: use bootstrap to produce 95% confidence intervals; if the intervals overlap, you may not claim “A is stronger than B.”
An unbiased estimate of pass@n can be written as:
$\text{pass@}n = 1 - \frac{\binom{N-c}{n}}{\binom{N}{n}}$
where $N$ is the total number of samples per problem and $c$ is the number of correct ones. In practice, just do Monte Carlo sampling over n.
6. Don’t Look at Accuracy Alone: Reasoning Length and Efficiency
A high-value but often-overlooked dimension in evaluation is reasoning efficiency. When two models get the same answer right but one used 800 tokens and the other 8000, their cost, latency, and stability in production are completely different. It’s best to record the following as well:
- Output tokens per problem (reasoning content + final answer);
- Cost per correct answer:
total consumption / number of correct problems; - Length–accuracy curve: put max output length on the x-axis and observe where accuracy saturates. If a model’s accuracy barely rises after its length doubles, its extra reasoning is redundant;
- Truncation rate: the proportion of cases that failed to output an answer because they exceeded the max length—one of the main sources of production failures.
A practical rule of thumb: a model with an extremely long reasoning chain but a high truncation rate is often unsuitable for latency-sensitive paths, while a model with a short reasoning chain and no drop in accuracy is better suited for engineering deployment. This is an engineering tradeoff, not an absolute measure of superiority.
7. Turning Subjective Impressions into Credible Conclusions
Subjective impressions aren’t useless, but they need to be methodized. If you do want to run a preference evaluation, use pairwise comparison plus statistical modeling:
- Blinding: remove model identifiers and unify the prompt template and rendering format (to avoid layout differences influencing judgment);
- Pairwise randomization: randomize A/B order, and repeat each comparison over multiple rounds;
- Multi-dimensional scoring: score correctness, reasoning rigor, and readability of expression separately, to avoid the halo effect;
- Consistency check: when multiple reviewers are used, measure their agreement with Cohen’s kappa; a kappa below 0.4 means the scoring criteria themselves need to be rewritten;
- Ranking aggregation: use a Bradley-Terry or Elo-style model to aggregate pairwise wins and losses into a ranking with confidence intervals.
If any one of the review criteria, the question set, or the sample count is opaque, the ranking won’t be reproducible.
8. Common Pitfalls Checklist
- Drawing global conclusions from a handful of questions: gaps over a few dozen questions basically fall within the noise interval;
- Mixing difficulties without layered reporting: a high average pulled up by L1 masks an L4 collapse;
- Comparing across different runtime parameters: that amounts to comparing different experiments;
- Testing pass@1 only: can’t distinguish “stable” from “occasionally gets it right”;
- Ignoring truncation and tool differences: a configuration that allows external computation tools can’t be lumped together with a pure-reasoning configuration;
- Using a public question bank directly as the acceptance standard: contamination inflates scores, and the bank becomes invalid as corpora are updated.
9. Implementation: Turn Evaluation into a Pipeline
Evaluation must be able to run in CI to have regression value. A minimum viable pipeline has four stages:
- Data versioning: put the question bank and answer set under version control, fix the parameterized seeds, so any result can be traced back to a specific question bank version and runtime configuration;
- Concurrent task execution: dispatch tasks to the inference API per problem, and record a configuration snapshot and the full output for each request;
- Grading and archiving: the three-layer grader outputs structured results that are persisted as detailed logs, making per-problem attribution easy;
- Regression gate: if core-set accuracy falls below the baseline threshold (e.g. a relative drop of more than 2 percentage points), block the release, and also output trends in length and truncation rate.
On the data and compute side, raw request logs, evaluation details, and grading results are typically stored separately in object storage and a log service, a message queue is used to dispatch tasks and smooth out peaks, a container platform carries the concurrent evaluation tasks, and monitoring alerts track changes in cost, latency, and pass rate. This combination is common industry practice, and specific choices can build on existing infrastructure—there’s no need to introduce heavy components just for evaluation.
10. Conclusion
“Which model is stronger at math” is an answerable question only under a clear evaluation protocol. What really determines the quality of the conclusion isn’t the model itself but four things: whether the ability layering is clear, whether the question bank fits the business and is uncontaminated, whether sampling and grading are statistically meaningful, and whether cost, latency, and truncation rate are included in the decision. Once these four things are solidified into a regression-capable pipeline, model selection turns from “arguing based on impressions” into “weighing based on data,” and the benefits and risks of model upgrades can be tracked quantitatively.
