How to Evaluate and Benchmark the Mathematical Reasoning of Large Language Models
This guide presents a practical framework for evaluating the mathematical reasoning of large language models. It breaks math capability into four measurable layers, explains how to build reproducible evaluation sets that resist data contamination, and separates answer correctness from reasoning quality through dual-track scoring. It also covers proxy metrics for chain-of-thought complexity, fair comparison under fixed resource and cost constraints, common pitfalls, and a five-step workflow for building a stable, auditable, and regression-testable capability baseline for model selection.
1. Why “Which Model Is Better” Debates Rarely Converge
A recurring situation in team selection and capability planning is that different users give opposite assessments of the same model. Some emphasize final answer accuracy, some care about whether the reasoning is concise, and others are persuaded by longer reasoning chains, assuming that “thinking longer means thinking deeper.” These discussions usually stay at the level of impressions. Without a shared problem set, a unified scoring standard, and consistent resource constraints, the conclusions cannot be reproduced.
To turn subjective impressions into engineering conclusions, you first need to decompose “math capability” into observable dimensions, then design metrics for each dimension that can be collected automatically or semi-automatically. This article makes no judgment about any specific product. Instead, it offers a general evaluation method that applies to horizontal comparison across cloud model services, on-premises deployments, and hybrid inference architectures.
2. Capability Layers: Breaking “Math” into Measurable Subtasks
A vague notion of “math capability” cannot be evaluated. It is advisable to divide it into at least four layers:
- Arithmetic and numerical precision: multi-step arithmetic, unit conversion, significant figures, and rounding. The point is not difficulty but whether intermediate results drift over long chains.
- Algebra and equations: solving equations, inequalities, sequences, and function properties. Focus on whether variable substitution is valid and whether extraneous roots and domain constraints are missed.
- Combinatorics and probability: counting principles, recurrences, and conditional probability. Such problems are highly sensitive to whether enumeration is duplicated or incomplete, making them suitable for testing rigor.
- Open-ended problems: problems that require constructing auxiliary structures, proposing conjectures, and verifying them. This layer is closest to research scenarios, has the highest discriminative power, and is the hardest to score automatically.
Only after this layering can an evaluation report answer “which layer a model loses points in” rather than just giving a single total score.
3. Building the Evaluation Set: Difficulty, Contamination, and Reproducibility
The quality of the evaluation set sets the ceiling on the conclusions. In practice, three things must be controlled.
First, the difficulty distribution must be deliberately designed. A 6
1 configuration of “standard problems, variant problems, open-ended problems” is recommended, along with a portion of twin problems that share the same structure but use different numbers, used to detect whether the model is memorizing problems.
Second, guard against data contamination. Prefer self-built problems or recently written problem statements, and avoid reusing public problem banks verbatim. Record the creation time and source type for each problem, and periodically rotate a certain proportion of problems.
Third, fix randomness and runtime parameters. Variation across sampling settings for the same model can exceed the difference between models, so configurations such as temperature, maximum output length, and retry count must be locked, and the run should be repeated at least three times to take the mean and variance.
# Minimal reproducible evaluation loopcases = load_cases("math_eval_v3.jsonl") # includes level / answer / rubricdef run(model_client, case, seed=0, repeats=3):scores = []for i in range(repeats):resp = model_client.generate(prompt=case["prompt"],temperature=0.0,max_tokens=4096,seed=seed + i,)scores.append(score(resp, case)) # see rubric in Section 4return {"mean": sum(scores)/len(scores),"var": variance(scores),"tokens": count_tokens(resp)}
4. Scoring Design: Separating Answer Correctness from Process Quality
A single “right/wrong” judgment hides key differences. Dual-track scoring is recommended:
- Result track: whether the final answer is equivalent to the reference answer (numerical tolerance, symbolic equivalence, and set equivalence handled separately).
- Process track: whether the reasoning is verifiable, including whether premises hold, whether steps are reproducible, whether there is circular reasoning, and whether assumptions are explicitly stated.
The process track can be implemented with a 0–2 point checklist, for example “whether the domain is verified,” “whether boundary cases are checked,” and “whether a counterexample is provided for exclusion.” To keep scoring stable, the rubric must be written per problem in advance, not decided on the fly during scoring.
It is important to stress that a longer reasoning chain does not mean a stronger model. Longer chains often come with more intermediate steps, and the probability of errors and redundant statements rises accordingly. A more reasonable approach is to treat length as an independent observation and perform a two-dimensional scatter analysis against accuracy: high accuracy with short chains usually indicates a more stable internal representation; high accuracy with long chains requires further checking for repeated verification and self-correction overhead.
5. Quantifying Chain-of-Thought Complexity
Without relying on manual word-by-word reading, the following proxy metrics can be collected:
- Average number of reasoning steps: segmented by logical connectives and line-break structure.
- Number of self-corrections: frequency of patterns such as “recalculate/check/assumption does not hold.”
- Number of branches: how often multiple solution paths are pursued simultaneously, reflecting search breadth.
- Redundancy rate: proportion of intermediate passages unrelated to the final answer.
- Position of the first correct intermediate result: the earlier it appears, the faster the problem is modeled.
Together, these metrics form a “reasoning profile” that is more actionable than a vague statement that “the chain of thought is more concise.”
6. Fair Comparison Under Resource and Cost Constraints
Comparison detached from resource constraints has no engineering meaning. Compare under the same budget, recording the input and output tokens consumed per problem, end-to-end latency, throughput under concurrency, and converting these into “cost per correct problem.” If a cloud model service is used, evaluation corpora can be archived with object storage, batch tasks can be scheduled with peak shaving via a message queue, evaluation executors can be hosted on a container platform, and failure rates can be tracked with logging and monitoring/alerting services, so that large-scale evaluation runs sustainably. General-purpose capability categories on cloud platforms such as Baidu AI Cloud can typically serve as the underlying foundation for this kind of evaluation infrastructure.
cost per correct problem = total cost / number of correct problemsadmission threshold example: accuracy >= baseline + 5%, and P95 latency <= 1.2x baseline
7. Common Pitfalls and How to Avoid Them
- Substituting individual cases for the whole: single-problem outcomes are extremely noisy, and conclusions from fewer than 50 problems should not be extrapolated.
- Ignoring prompt sensitivity: changing the prompt template for the same model can cause significant variation, so fix the template and run a separate sensitivity test.
- Treating writing style as capability: writing that resembles human expression belongs to the style dimension and has no causal relationship with mathematical correctness, so it should be listed separately.
- Testing only hard problems and not fundamentals: losing points at the basic layer often has a greater business impact, so sufficient weight must be retained.
- Lacking a regression mechanism: model services are continuously updated, so evaluation should be built into the pipeline, automatically running the baseline on each change and outputting a diff report.
8. Recommended Implementation Workflow
A five-step closed loop is recommended: define the capability layers the business requires; build and freeze the evaluation set and rubric; run batch execution under a unified resource budget; produce a four-dimensional report of accuracy, variance, complexity profile, and cost; write the conclusions into the selection document and set up periodic regression. When communicating conclusions externally, state only reproducible metrics and confidence intervals, and avoid unverifiable ranking-style statements.
9. Conclusion
Comparing the mathematical capability of models is essentially a measurement problem, not a matter of position. By doing four things solidly—layering problems, dual-track scoring, quantifying complexity, and imposing cost constraints—a team can obtain a stable, auditable, and regression-testable capability baseline, and thus make more reliable selection decisions in real business scenarios.
