How to Evaluate the Mathematical Reasoning of Large Language Models: A Practical Guide

    This article presents a practical methodology for evaluating the mathematical reasoning capabilities of large language models. It explains why subjective impressions are unreliable for model selection, breaks mathematical ability into five distinct layers, and outlines how to build reproducible evaluation sets, control prompt and decoding configurations, and combine automated scoring with human review. It also covers common evaluation biases, how to present auditable results, and how to embed evaluation into an engineering pipeline. Readers can apply the framework to any model service without relying on product rankings.

    1. Background: Why “It Feels Stronger” Is Not a Selection Criterion

    In engineering practice, teams often need to decide whether a certain class of AI models is suitable for math-intensive tasks such as symbolic derivation, probability calculation, constraint solving, and numerical estimation. Discussions frequently feature statements like “model X is stronger,” “model Y has a more concise chain of thought,” or “model Z writes more like a human.” These conclusions come from personal usage experience and carry obvious sample bias and scenario limitations.

    Turning such subjective impressions into engineering conclusions requires three levels of abstraction:

    1. Abstract “model strength” into “expected accuracy and cost on a specific task distribution.”
    2. Abstract “concise chain of thought” into “the number of reasoning steps and context consumption required to reach the same accuracy.”
    3. Abstract “writes more like a human” into “output readability score and human review cost.”

    Once this abstraction is done, evaluation shifts from a debate of opinions to a measurable, reproducible experimental design problem. This article does not recommend or rank any specific product. Instead, it provides a general evaluation methodology that readers can use to assess any class of model service, including general-category model services offered on public clouds, open-weight models deployed privately, and self-built inference clusters.

    2. Capability Layers: Mathematical Ability Is Not a Single Dimension

    Treating “mathematical ability” as a scalar is the most common mistake. In engineering, it is advisable to split it into at least five layers, each with its own evaluation set and metrics:

    • Arithmetic and numerical precision layer: multi-digit operations, unit conversion, percentages, and growth rates. The focus is format compliance and calculation stability.
    • Algebra and symbolic transformation layer: equation solving, identity transformation, and inequality manipulation. The focus is whether intermediate steps are verifiable.
    • Combinatorics and probability layer: counting, conditional probability, expectation, and variance. The focus is whether duplicate counting or sample space omissions occur.
    • Geometry and spatial layer: area and volume, coordinate transformation, and projection relationships. The focus is whether a correct formal description can be established.
    • Open-ended problem layer: problems with incomplete statements that require setting assumptions and providing proof ideas. The focus is whether assumptions are explicit and the reasoning chain is self-consistent.

    Strong performance in the first four layers does not mean a model is usable in the fifth; conversely, some models are more robust on open-ended problems but more prone to basic mistakes in fast arithmetic. Therefore, an evaluation report must present conclusions by layer rather than output a single composite score.

    3. Building the Evaluation Set: Reproducibility Over Scale

    Evaluation set design follows three principles:

    1. Traceable sources. Record the source type for each question (public question bank, internal business question, or manually constructed adversarial question) and retain the original wording.
    2. Declarable distribution. Specify the proportion of questions in each layer, for example 20% numerical, 25% symbolic, 20% probability, 15% geometry, and 20% open-ended.
    3. Judgeable answers. Provide a unique ground-truth answer for objective questions; for open-ended questions, provide a rubric of scoring points rather than a single reference answer.

    It is recommended to construct two additional types of special samples:

    • Distractor samples: insert irrelevant conditions into the prompt to test whether the model misuses them.
    • Consistency samples: rewrite the same question in multiple different phrasings to test output stability.

    Consistency samples are critical. Many so-called “model capability differences” are actually differences in sensitivity to prompt wording rather than differences in reasoning ability.

    4. Prompt and Decoding Configuration: Controlling Variables Is the Prerequisite

    The biggest interference in evaluation comes from inconsistent configurations. It is recommended to fix the following variables and explicitly record them in the report:

    1. # Evaluation configuration example (pseudocode, only to express the idea of controlling variables)
    2. config = {
    3. "prompt_template": "same template, only replace the question variable",
    4. "max_output_tokens": 4096, # must be identical across groups to avoid truncating long chains of thought
    5. "temperature": 0.0, # use 0 for objective questions; set a separate group at 0.6 for subjective questions
    6. "top_p": 1.0,
    7. "repetition_penalty": 1.0,
    8. "system_prompt": "require listing knowns first, then goals, and finally the conclusion",
    9. "retry": 3 # used to measure stability, not to improve single-run accuracy
    10. }

    Three notes:

    • The output length limit must be unified. If a group is truncated, its “errors” are a configuration issue rather than a capability issue.
    • The temperature parameter needs to be grouped. Use deterministic decoding for objective questions; run a separate sampling experiment for open-ended questions to assess output diversity.
    • Retries are used to measure variance. Sample the same question multiple times, record the mean and standard deviation of accuracy; excessive variance means the conclusion is unreliable.

    5. Scoring: Combining Automated Judgment and Human Review

    Scoring is recommended in three tiers:

    Tier 1: automated exact matching. Applicable to numerical and expression answers, with normalization performed first:

    1. import re
    2. def normalize(expr: str) -> str:
    3. expr = expr.strip().replace(" ", "")
    4. expr = expr.replace("×", "*").replace("÷", "/")
    5. expr = re.sub(r"^\$", "", expr)
    6. expr = re.sub(r"\$", "", expr)
    7. return expr.lower()
    8. def is_correct(pred: str, gold: str) -> bool:
    9. return normalize(pred) == normalize(gold)

    Tier 2: rule-based key-point matching. For open-ended questions, break the rubric into several searchable points, count the hit ratio, and obtain a continuous score from 0 to 1.

    Tier 3: human sampling review. Draw 10% to 20% of samples via stratified sampling, have two reviewers score independently, and calculate an agreement coefficient; when agreement is low, fix the rubric first rather than drawing conclusions directly.

    6. Common Biases and How to Avoid Them

    • Data contamination: evaluation questions may appear in the training corpus. The mitigation is to retain some self-built and rewritten questions and compare the score gap between public and self-built questions.
    • Truncation bias: long reasoning is cut off by the output limit and misjudged as insufficient capability. The mitigation is to unify the limit and record the truncation rate.
    • Prompt sensitivity: results change with a different phrasing. The mitigation is to run multi-phrasing consistency tests and report the mean and variance.
    • Scorer defects: expressions are equivalent but strings differ, causing misjudgment. The mitigation is to introduce symbolic equivalence checking or numerical substitution verification.
    • Cost neglect: comparing only accuracy without cost. The mitigation is to record input and output context consumption and end-to-end latency at the same time.

    7. Presenting Results: Making Conclusions Auditable

    A qualified evaluation report should include the task distribution description, configuration list, per-layer accuracy, variance, truncation rate, average reasoning length, cost per task unit, human review agreement, and a classification of failure samples. Failure samples are recommended to be archived into five categories: “misreading the question, missing assumptions, calculation errors, format non-compliance, and reasoning interruption.” These five categories correspond to completely different optimization approaches: the first two rely on prompt and process constraints, the third relies on tool calling and external computation, the fourth relies on output constraints, and the fifth relies on context and output budget adjustments.

    8. Engineering Implementation

    In a real system, it is recommended to make evaluation a pipeline: put the question set and rubrics under version control, fix configurations as files, trigger regression evaluation on every model or prompt change, write results to a logging service with monitoring alerts configured; archive model weights and datasets via object storage, and run evaluation tasks on a container platform to ensure environment consistency. If multiple models collaborate, a message queue can decouple scheduling and scoring to avoid long tasks blocking.

    Ultimately, the team should establish a clear standard: capability conclusions must come with the task distribution, configuration, and confidence interval. Only by turning subjective experience into reproducible experiments can technical selection have engineering credibility and make truly reasonable trade-offs among cost, latency, and accuracy.