Evaluating the Mathematical Reasoning Ability of Large Language Models: A Practical Framework and Methodology
Choosing a large language model often comes down to the question "which one is better at math," yet answers based on a few ad-hoc trials or third-party leaderboards are frequently contradictory. This article presents a practical methodology for evaluating mathematical reasoning ability across seven dimensions: capability layering, a metrics system, question-set construction, answer verification, sampling consistency, an automation pipeline, and result interpretation. It explains how to move beyond single-pass accuracy (pass@1) toward capability ceilings (pass@k) and cost, how to calibrate difficulty and guard against data contamination, and how to evolve verification from string matching to process-level checks. Readers will learn how to turn "a gut feeling about which model is stronger" into reproducible, decision-ready evidence for model selection and ongoing optimization.
When selecting a large language model, “which model is stronger at math” is both the most frequently asked question and the hardest to answer by intuition. Try a few problems on an application platform, or consult a third-party leaderboard, and the conclusions often contradict each other. There are three reasons: problem difficulty is not calibrated, there is no repeated sampling, and answer verification relies on string matching.
Math problems have definite inputs, decomposable steps, and verifiable results, which makes them an ideal “ruler” for testing a model’s reasoning ability. But to make this ruler truly trustworthy, you need a systematic evaluation design spanning the questions, the metrics, the verification, and the process. This article lays out a practical methodology for evaluating mathematical reasoning ability around the following seven aspects:
- Capability layering
- Metrics system
- Question construction
- Answer verification
- Sampling consistency
- Automation pipeline
- Result interpretation
1. First, Clarify: What Counts as “Mathematical Reasoning Ability”
Before debating “who is stronger,” you first need to define what you are measuring. By problem type, common math tasks fall into three categories:
- Closed-ended problems: They have a unique or finite set of definite answers, such as solving an equation or evaluating a definite integral. This is the closest thing to “answer checking,” but a model can still make mistakes at some step.
- Semi-open problems: The form of the answer is not unique, or the solver must choose an approach. A proof problem, for example, may have multiple proof paths, and a word problem can be expressed as equivalent algebraic expressions. Judging these requires looking at both the final result and whether the reasoning holds.
- Open-ended problems: The problem statement is incomplete, or the solver must propose conjectures, construct counterexamples, or decide whether a proposition is true—essentially approaching research-level mathematical work. These problems often have no widely accepted standard answer, and it can even be hard to define what “getting it right” means. They are key to distinguishing the upper limit of a model’s reasoning ability, and the hardest category to evaluate.
Each type demands different capabilities:
- Closed-ended problems mainly test accurate execution;
- Semi-open problems test the coherence of multi-step reasoning and the ability to self-correct;
- Open-ended problems test the ability to form hypotheses, explore paths, and verify conclusions when information is incomplete.
The first principle of evaluation design, therefore, is layering. If you simply pool a mixed set of difficulties into a single total score, a high-scoring model may come close to full marks on easy problems yet fail outright on hard ones, and the average masks its true capability boundary. The sound approach is to group questions by the types and capability levels above, measure each group separately, and then plot a “difficulty vs. pass rate” curve. The point where the curve bends is the model’s real usable ceiling.
You should also distinguish two kinds of “reasoning”:
- Mathematical computation ability;
- Everyday reasoning ability.
Some people infer a model’s overall reasoning level from its math scores. This inference has some merit, because mathematical reasoning relies heavily on the integrity of the logical chain. But it does not always hold: a model good at numerical computation and applying formulas is not necessarily good at higher-order, more open-ended reasoning such as causal analysis or compliance review. A more rigorous approach is to treat math evaluation as a “verifiable slice” of reasoning ability, then combine it with evaluation results from the actual business context to reach a holistic judgment.
2. Core Metrics: From “Single-Pass Accuracy” to “Capability Ceiling and Cost”
Many teams record only “how many questions were answered correctly,” which is far from enough. It is recommended to cover at least the following five categories of metrics.
1. Pass rate (pass@1): reflects the reality of single-shot use
pass@1 is the probability of answering correctly in a single request. With a small number of questions, the single-pass pass rate fluctuates widely and must be interpreted alongside a confidence interval. For example, if a level contains 100 questions and a model answers 50 correctly, the surface pass rate is 50%, but by the Wilson confidence interval for a binomial proportion, the 95% confidence interval of the true pass rate is roughly 40.4%–59.6%. If another model answers 54 correctly, the difference between the two is far from statistically significant and is not enough to conclude that one is “stronger.”
2. pass@k: measures the capability ceiling
Sample the same question independently k times, and count it as passed if any attempt succeeds. The unbiased estimator is:
pass@k = 1 - C(n - c, k) / C(n, k)
where n is the total number of samples, c is the number that passed, and C is the binomial coefficient.
Assume the probability of answering correctly on two independent attempts is p; then the probability of at least one correct answer in k attempts is 1 − (1 − p)^k. For example, when p = 0.5 and k = 5, the value is approximately 96.9%. These numbers reveal a common misconception:
- A high pass@k only shows that the model “is capable of getting it right,” not that it is reliable in actual use;
- Model selection should focus more on pass@1, because online users typically accept only a single answer.
3. Multi-sample pass rate and stability
Fix the questions and sampling parameters, run multiple rounds, and observe the range over which the pass rate fluctuates. The larger the fluctuation, the more the result depends on sampling luck, and the less trustworthy any single evaluation conclusion. It is recommended to make “the mean and standard deviation of the multi-round pass rate” a fixed reporting field.
4. Process quality
A correct final answer does not mean the process was correct. Especially in proofs and derivations, a model may “guess the conclusion but err in the steps”—which is invalid mathematically but can plant risks in engineering, such as performing further computation based on an incorrect intermediate result. Process quality can be assessed along these dimensions:
- Step completeness: are there skipped steps;
- Verifiability: can each step be derived from prior conditions and known rules;
- Conciseness: is there a large amount of redundant or repetitive reasoning.
5. Economics and latency
In math evaluation, “the average cost per correctly answered question” is often more meaningful than the token consumption of a single call. For example:
- Model A: 60% pass rate, average output of about 800 tokens, giving an expected output of about 1,333 tokens per correct answer;
- Model B: 55% pass rate, average output of about 2,500 tokens, giving an expected output of about 4,545 tokens per correct answer.
The two differ by roughly 3.4x. Long chain-of-thought models are often “more verbose but more accurate,” and only by plotting pass rate and cost on the same cost-vs-effectiveness curve do model-selection conclusions become convincing. At the same time, record time-to-first-token and total latency, because in interactive applications, waiting time directly affects the experience.
3. Building the Question Set: Difficulty Calibration, Contamination Control, and Layered Mix
The quality of the question set determines the ceiling of the evaluation, and four areas deserve particular attention.
(1) Multi-source composition
- Public foundational questions: classic word problems from primary to secondary school, and common algebra and calculus exercises. These are mainly for regression testing, to prevent capability degradation after upgrades.
- Public advanced questions: such as subject-competition problems. These are hard, but their public nature also means they are easily covered by training data.
- Private expert questions: original or adapted by mathematically trained members of the team, close to real business needs, and the core of the evaluation.
- Real business questions: actual problems extracted and de-identified from production environments, such as financial reconciliation, usage estimation, and scheduling calculations. These best reflect online performance.
(2) Objective difficulty calibration
Avoid dividing difficulty by subjective impression alone. A workable method is to have several baseline models of varying ability each sample a few times, then label each question by overall pass rate. For example:
- Strong baseline pass rate above 90% → easy
- 60%–90% → medium
- 30%–60% → hard
- Below 30% → challenge
It must be emphasized that difficulty is relative to the “group of models under test” and drifts as models improve overall, so it should be recalibrated periodically.
(3) Preventing data contamination
Once public questions enter the training corpus, a model may have memorized the answers rather than learned to reason, which shows up as “instantly correct on simple questions, wrong after a slight variation.” The following techniques can help detect this:
- n-gram overlap detection: split questions into contiguous n-gram sequences and measure the overlap ratio with the model’s training data;
- Semantic similarity clustering: identify different phrasings of the same question;
- Perturbation testing: keep the mathematical structure unchanged and only change the values, units, context, or phrasing, then compare the pass-rate difference before and after. The larger the difference, the more the model relies on memorization of the original question.
(4) Scenario layering and weighting
Different businesses emphasize different aspects of math ability:
- E-commerce and marketing emphasize usage, discount, and settlement calculations;
- Financial scenarios emphasize reconciliation and rule validation;
- Education scenarios emphasize the rigor of solution steps.
The question mix should therefore be weighted by business call volume. For example, if 80% of a business’s requests are numerical calculations of two steps or fewer, such questions should occupy a comparable share of the evaluation set, rather than simply piling on competition-level problems.
4. Answer Verification: From String Matching to “Verifiable Process”
The verifier determines whether the evaluation conclusions are trustworthy, and it is the most easily overlooked yet most labor-intensive part of the whole system. It is recommended to design it by problem type.
(1) Numerical answers: normalize first, then compare
Do not compare text directly. A model might output “1/2,” “0.5,” “50%,” or “one half”—semantically identical but string-different. The correct approach is:
- Parse using a high-precision decimal or rational representation;
- Unify units and formatting;
- Compare within a given error tolerance.
(2) Symbolic answers: symbolic simplification + random-substitution verification
Algebraic expressions and integral results often have equivalent but differently formed answers. You can first perform symbolic simplification and compare canonical forms; then, on that basis, substitute several groups of random values into both the original expression and the model’s answer, and treat numerical agreement as supporting evidence. It should be noted that finite-point verification can only raise confidence and cannot replace rigorous judgment at the symbolic level.
(3) Proofs and open-ended problems: define “core elements” and judge in layers
These problems cannot be “answer-checked,” but you can define scoring points in advance, such as:
- Required auxiliary constructions that must appear;
- The correct direction of key inequalities;
- Whether boundary conditions and special cases are discussed;
- Whether the base case and inductive step of an induction are complete.
They are then judged as follows:
- Rule checks verify necessary conditions;
- Cross-review by a model, where another model checks each scoring point one by one;
- Manual spot-checking as a safety net.
The illustrative pseudocode below shows a typical evaluation main loop:
# params: unified sampling parameters (temperature, max output length, random seed, etc.)# dataset: question set grouped by problem type and capability levelfor q in dataset:for _ in range(N): # independently sample the same question N timesresp = call_model(q, params) # call the unified model access layerverdict = verifier.check(q, resp) # verifier: normalized comparison + element checksstore.write(q.id, resp, verdict) # fully persist the question and answer for traceabilityreport = aggregate(store) # aggregate pass rates, confidence intervals, token consumption, error distributioncompare(report, baseline) # compare against baseline; alert on significant regression
5. Unified Sampling Conditions: Making Cross-Model Comparison Meaningful
Comparisons between models often produce inconsistent conclusions—not because of model differences, but because test conditions differ. The following variables must be fixed and recorded:
- Sampling temperature and number of samples: evaluations should sample multiple times. A low temperature yields relatively stable output but may still fluctuate; also use a compatible parameter form, to avoid fallbacks caused by certain invocation methods not supporting some parameters.
- Random seed: fix it as much as possible, and record the identifier of each request so results can be reproduced.
- Maximum output length: open-ended problems and long chain-of-thought models need a larger output budget; otherwise the conclusion may not be given before the output is truncated, and the verifier will misjudge it as “no answer.”
- Prompts and answer-extraction rules: including the system prompt and the agreed marker for the “final answer.” If a model reasons first and gives the answer afterward but has no clear answer marker, the parser can easily capture the wrong content.
- Interface differences: different access methods do not support exactly the same features. For example, whether web retrieval, structured output, or parallel sampling is supported can all change the premises for comparison.
The above is essentially “controlling variables” in an experiment. It is recommended to list them fixedly in the evaluation report, so that any comparison can be reproduced by a third party.
6. An Automated Evaluation Pipeline: Making Evaluation Everyday Engineering
Manual evaluation suits the exploration phase, but to support continuous iteration, the evaluation must be pipelined. A typical pipeline can be divided into five layers:
- Data layer: questions, standard answers, and scoring points are stored in a structured format in object storage or a database, and each evaluation run records the question-set version number.
- Scheduling layer: a message queue distributes evaluation tasks, supporting parallel execution across multiple models, retry on failure, and timeout control.
- Service layer: candidate models are accessed through a uniformly wrapped model-calling interface. This layer determines whether the evaluation code needs to change when switching models, and is key to pipeline extensibility.
- Verification layer: packaged as an independent service, containing rule checks, symbolic simplification, cross-review, and an entry point for manual review, so it can be iterated and audited independently.
- Results layer: metrics are automatically written to a time-series database, run logs are collected centrally via a logging service, monitoring and alerting notify promptly when metrics regress, and dashboards display trends.
Building on these general cloud-product categories, cloud platforms such as Baidu AI Cloud can combine these capabilities to support such a repeatable, traceable evaluation pipeline.
Once the pipeline is built, two design points are worth emphasizing:
- Evaluation as regression testing: any change to the model version, prompts, or verifier should trigger a full evaluation round. A fixed question set acts as a “unit test,” ensuring capability only goes up, not down.
- A tiered strategy to save budget: first run a small “smoke test set” to quickly screen candidates, then run the full question set once candidates meet the bar, avoiding spending large amounts of call resources on every iteration.
7. Interpreting Results: From Scores to Decisions
The ultimate goal of evaluation is not ranking, but supporting decisions. It is recommended to interpret results from four angles.
(1) Look at the distribution, not the average
Draw a heatmap of pass rates across each level and problem type to identify where the weaknesses lie. A model might approach full marks on basic computation but have a very low pass rate on proofs, which means it is suited to computation-intensive tasks and not to work that requires rigorous argumentation.
(2) Error attribution
Classify errors into the following categories and measure their proportions:
- Reading-comprehension errors: misunderstanding the problem or ignoring conditions;
- Calculation errors: mistakes in operations or simplification;
- Reasoning skips: missing intermediate steps or incoherent logic;
- Hallucinated steps: citing nonexistent theorems or conditions;
- Formatting errors: correct answers not output as required;
- No answer: output truncation or avoidance of the question.
Different error types point to different optimization directions:
- Formatting errors can be improved quickly through prompts and structured-output constraints;
- Hallucinated steps are often trickier and need to be mitigated through retrieval augmentation, tool calls, or verification mechanisms.
(3) Business-weighted composite score
Composite score = Σ(pass rate per scenario × that scenario’s share of call volume)
It reflects “overall business performance” rather than “strongest capability.” If a business is mostly simple calculations, a model with an average reasoning ceiling but stable and low-cost performance may actually score better overall.
(4) Continuous monitoring after launch
Passing offline evaluation does not mean good online performance. The distribution, phrasing, and context length of real user questions differ from the evaluation set. After launch, you can continuously calibrate with the following approaches:
- Sampling and reviewing online Q&A;
- Setting quality metrics such as the answer-format anomaly rate and the human-dissatisfaction rate;
- Periodically supplementing the evaluation set with newly discovered failure cases.
This forms a closed loop of “evaluate → find problems → optimize prompts or switch models → re-evaluate.”
8. Common Pitfalls
- Using leaderboards or word of mouth instead of self-testing: the questions, prompts, and sampling parameters of a leaderboard are often not disclosed, and training-data contamination is hard to rule out, so the conclusions cannot be directly transferred to your own business.
- Looking only at the average: the average easily masks capability boundaries and weaknesses, so judge with layered pass rates and confidence intervals.
- Treating pass@k as actual usability: the multi-sample pass rate reflects the capability ceiling, while the experience of a single online request depends on pass@1.
- Assuming a temperature of 0 yields a unique result: implementation details can differ across access methods and runtime environments, so output may still fluctuate, making multiple sampling and repeated experiments indispensable.
- Replacing verification with model self-scoring: having a model score a model’s answers is easily influenced by how fluent the phrasing is, and there is a bias where “the more it sounds right, the higher it scores.” For key questions, keep rule checks and manual review.
- Drawing conclusions from a single evaluation: both models and prompts iterate continuously, so evaluation must be routine; otherwise the conclusions quickly go stale.
- Ignoring cost and latency: focusing only on accuracy may reveal unacceptable call costs or response times only after launch.
Conclusion
The core of evaluating mathematical reasoning ability is to turn “a feeling about which model is stronger” into “under what conditions, for what type of problem, with what probability of getting it right, at what cost.” By layering the design of questions and metrics, building a reliable verifier, unifying sampling conditions, and making evaluation pipelined and routine, every model-selection and optimization decision can rest on solid evidence. For developers and enterprises whose core capabilities include intelligent Q&A, data analysis, and intelligent programming, a rigorous mathematical reasoning evaluation system is the foundational engineering that turns model capability into reliable business value.
