Evaluating Mathematical Reasoning in Large Language Models: Methods and Model Selection

    This article explains how to evaluate mathematical reasoning in large language models. It covers how to define the scope of mathematical ability, design benchmarks by difficulty and data contamination risk, judge answers, assess reasoning quality, measure stability with pass@k and majority voting, track cost and latency, classify errors, and select a model through a reproducible process.

    1. Why Mathematical Ability Is Hard to Measure

    Mathematical reasoning is one of the most common ways to test the logical ability of large language models. Answers are usually unique, and grading looks straightforward. In practice, however, evaluation runs into several problems. First, the same final result may come from a flawed derivation, so a correct answer does not guarantee a sound process. Second, difficulty ranges widely, from middle-school algebra to frontier research problems, so the same score can mean very different things. Third, public question banks may already be in training data, which inflates scores. Fourth, many people judge a model by personal experience. These samples are small and easily influenced by how a question is phrased.

    A credible evaluation plan therefore needs to answer three questions: Can the model reach the correct conclusion? Is the reasoning sound? Are the results stable across repeated runs?

    2. Define the Scope of the Capability First

    Before evaluating, clarify what “mathematical ability” means. A common breakdown is:

    • Computation: multi-step algebraic operations, numerical calculation, and symbolic simplification.
    • Proof: building a rigorous logical chain and checking the justification for each step.
    • Modeling: translating an applied problem into mathematical expressions.
    • Exploration: handling problems without standard answers by proposing testable conjectures and revising them.

    Different uses call for different weights. Tutoring emphasizes clear explanations and correct steps. Research assistance emphasizes the quality of conjectures and the handling of boundary conditions. Once the abilities are separated, each one needs its own problem set. Otherwise, the results will mask one another.

    3. Benchmark Design

    3.1 Stratify by Difficulty

    Use at least three tiers:

    1. Basic tier: textbook problems with clear solution methods, used to check fundamental skills.
    2. Competition tier: problems that require specific techniques and multi-step reasoning. These separate models well.
    3. Open tier: problems without accepted answers, such as constructing counterexamples or verifying small unproven conjectures. Experts need to judge these one by one.

    Each tier needs enough problems to support statistical conclusions. If a tier has only five or six questions, the chance result of a single question will dominate the overall score.

    3.2 Reduce the Risk of Data Contamination

    Public question banks easily enter training corpora. A model may then memorize answers instead of deriving them. You can reduce this risk in the following ways:

    • Use recently published problems, or write your own without publishing every detail.
    • Apply equivalent transformations, such as renaming variables, changing numbers, or reordering conditions, and check whether performance stays stable.
    • Keep part of the question bank private and use it only for periodic retesting.

    If a model scores clearly higher on original problems than on rewritten versions, it likely depends more on memory than on reasoning.

    4. Judging Answers

    Judging mathematical answers is harder than it looks. Exact string matching wrongly rejects equivalent forms such as “1/2” and “0.5”, and it can miss correct answers because of formatting differences. A more reliable approach combines the following methods:

    1. Normalize numerical answers, converting fractions, decimals, and scientific notation to a common form.
    2. For symbolic expressions, use a symbolic computation library to check equivalence.
    3. For proof problems, grade with a human reviewer or a clearly defined scoring rubric, and record the reasons for each score.
    4. For open problems, have two people judge independently. If they disagree significantly, a third person arbitrates.

    The following sample shows an evaluation framework. call_model is the function that calls the model, and extract_final_answer extracts the final answer from the output. You need to implement both according to your own interfaces:

    1. from dataclasses import dataclass
    2. @dataclass
    3. class Problem:
    4. pid: str
    5. statement: str
    6. answer: str
    7. level: str # "Basic" / "Competition" / "Open"
    8. def normalize(ans: str) -> str:
    9. # Strip whitespace and unify full-width symbols. In real projects, integrate symbolic equivalence checking.
    10. return ans.strip().replace(" ", "").replace(",", ",")
    11. def run_eval(problems, call_model, samples=3):
    12. results = {}
    13. for p in problems:
    14. answers = []
    15. for _ in range(samples):
    16. raw = call_model(p.statement)
    17. answers.append(normalize(extract_final_answer(raw)))
    18. hits = sum(a == normalize(p.answer) for a in answers)
    19. results[p.pid] = {
    20. "level": p.level,
    21. "accuracy": hits / samples,
    22. "consistent": len(set(answers)) == 1,
    23. }
    24. return results

    The framework outputs the accuracy and consistency for each problem, which makes it easy to summarize results by tier.

    5. Process Quality: Chain-of-Thought Length and Reliability

    Many people treat chain-of-thought length as a sign of ability and assume that longer reasoning is more rigorous. That assumption does not always hold. Chain-of-thought can be assessed from three angles:

    • Correctness: whether each derivation step holds, and whether the reasoning skips steps or swaps conditions.
    • Necessity: whether it contains many repeated checks or unproductive backtracking.
    • Readability: whether the conclusions match their justifications, so a reader can verify them.

    Long reasoning often adds value on hard problems, but on simple problems it may only add cost. A practical metric is “output tokens consumed per correct answer,” analyzed alongside accuracy. If long reasoning only slightly improves accuracy while greatly increasing token use, you need to weigh that trade-off for your scenario.

    Manual spot checks matter just as much. Randomly sample a share of the reasoning traces, label each step as correct, acceptable, or wrong, and calculate the process correctness rate. A low process correctness rate combined with a correct final answer usually means the result contains a chance element.

    6. Stability and Consistency

    Getting one answer right does not mean the model’s ability is stable. Use these metrics:

    • Average accuracy across multiple samples.
    • pass@k: the proportion of problems where at least one of k samples is correct. It reflects whether the model can solve the problem at all.
    • Majority-vote accuracy: accuracy after voting across multiple outputs. It reflects whether the model usually gets the answer right.
    • Answer consistency: whether the final answers to the same problem match across multiple outputs.

    The gap between pass@k and majority-vote accuracy is a useful reference. A large gap suggests the model has some latent capability, but its outputs fluctuate noticeably. Such a model suits pairing with program-based verification or a voting mechanism.

    7. Cost, Latency, and Deployment Constraints

    Evaluation results need to be considered in an engineering context. Two models with the same accuracy can differ widely in inference cost and response time. Record the following:

    • Average input and output tokens per problem.
    • Time to first token and total completion time.
    • Throughput under concurrent load.
    • Cost per correct answer.

    Throughput depends on hardware, batching strategy, and the inference framework, so do not apply other people’s test results directly. For side-by-side comparisons, remeasure under the same environment and load, and document the test conditions.

    8. Error Type Analysis

    Counting error rates alone does not show how to improve. Classify the errors instead. Common categories include:

    • Calculation error: mistakes in intermediate numerical or symbolic operations.
    • Missed condition: ignoring a constraint given in the problem.
    • Logical leap: a conclusion without adequate justification.
    • Definition confusion: a misunderstanding of a concept.
    • Truncated output: an answer that is incomplete.

    Each error type calls for a different response. Program checks can catch calculation errors. Prompting the model to verify each condition can address missed conditions. Logical leaps depend more on human review. Classification also helps determine whether a problem lies in the model’s ability, the prompt design, or the evaluation itself.

    9. A Decision Framework for Model Selection

    When choosing a model for a real business, you can proceed in this order:

    1. Define the scenario. Tolerance for error differs greatly among tutoring, data analysis, research assistance, and engineering calculation.
    2. Run a small pilot on a private question bank, with at least several dozen questions per category.
    3. Record accuracy, process quality, stability, cost, and latency together. Do not rely on a single metric.
    4. Keep human review or program verification for high-risk steps.
    5. Retest regularly with new questions, because model versions and service configurations change.

    Avoid relying on a single leaderboard. A leaderboard’s question distribution, grading method, and test conditions often differ from your own scenario, so use it only as a first-pass reference.

    10. Common Misconceptions

    • Treating personal subjective experience as a conclusion. Small samples are easily affected by question selection.
    • Using a single result to represent stable ability.
    • Looking only at the final answer and ignoring whether the reasoning is sound.
    • Assuming longer reasoning is always better, and ignoring the balance between cost and benefit.
    • Ignoring data contamination and mistaking memorization for reasoning ability.

    A reproducible evaluation process is more valuable than any one-time conclusion.