How to Evaluate the Mathematical Reasoning Ability of Large Language Models: Methods and Practice

    This article presents a practical framework for evaluating the mathematical reasoning ability of large language models. It breaks reasoning capability into five layers, outlines principles for building reproducible evaluation sets, explains why chain-of-thought length is a cost signal rather than a capability signal, and covers statistical rigor, cost and latency constraints, a minimal evaluation pipeline, and common pitfalls. The goal is to replace ranking debates with layered, reproducible, cost-aware engineering evaluation.

    1. Background: Why “Which Model Is Better” Is Hard to Answer

    In technical selection and capability assessment, a recurring debate is how different large language models rank on mathematical problems. Such discussions often list specific models and subjective rankings, which have clear weaknesses from an engineering perspective: conclusions are not reproducible, evaluation samples are not public, prompts and decoding parameters are not unified, and scoring criteria are inconsistent. This article therefore strips away all product-specific attributes and frames the topic as a general technical question: how to scientifically evaluate the mathematical reasoning ability of large language models.

    It is important to note that mathematical ability is not a single dimension. Strong performance on competition problems does not guarantee reliability on open-ended mathematical problems, where a model must construct its own proof strategy, select tools, and perform multiple rounds of self-correction. Treating capability as a multi-dimensional vector is the first step toward a trustworthy evaluation system.

    2. Capability Layers: Building Explainable Evaluation Dimensions

    Mathematical reasoning ability can be decomposed into at least five progressive layers:

    1. Arithmetic and symbolic manipulation: basic operations, algebraic transformation, and unit conversion, testing baseline reliability.
    2. Single-step theorem application: recognizing the problem type and applying a standard method, such as differentiation, integration, or matrix decomposition.
    3. Multi-step compositional reasoning: chaining three to five intermediate conclusions, testing the ability to preserve intermediate states.
    4. Open-ended problem solving: problems with no standard solution path, requiring the model to propose strategies, try and fail, and backtrack.
    5. Rigor of expression: beyond a correct answer, the reasoning must avoid circular arguments and hidden assumptions, and must discuss boundary cases.

    The observation that very few models can handle open-ended mathematical problems essentially describes the scarcity of the fourth layer. In engineering practice, the fourth layer should be modeled separately rather than merged into a single score with the first three.

    3. Evaluation Set Design: Reproducibility Is the Baseline

    Evaluation set design should follow four principles:

    • Traceable sources: problems come from public benchmarks or a self-built, versioned private set, and each evaluation run records the set version.
    • Decidable answers: prefer automatically verifiable numerical solutions, analytical expressions, or structured proof skeletons to reduce subjective human scoring.
    • Difficulty labels by layer: each item is labeled with its layer and expected number of reasoning steps for per-dimension statistics.
    • Contamination protection: regularly introduce new problems, apply equivalent transformations to existing ones, and keep a portion of the holdout set permanently private.

    An illustrative data structure is shown below:

    1. {
    2. "item_id": "math-000137",
    3. "layer": 4,
    4. "expected_steps": 7,
    5. "prompt": "...",
    6. "grader": "symbolic_equivalence",
    7. "reference": "x = 3/2",
    8. "holdout": false
    9. }

    4. Process Metrics: Chain-of-Thought Length Is Not Capability

    Models differ significantly in chain-of-thought length; some are concise while others are extremely long and complex. This suggests that reasoning length is a cost metric, not a capability metric. The following process data should be collected alongside accuracy:

    • Number of reasoning tokens and end-to-end latency;
    • Number of self-corrections (frequency of backtracking behaviors such as “recheck” or “I miscalculated earlier”);
    • Consistency between the final answer and intermediate conclusions;
    • Proportion of invalid branches, meaning reasoning segments later overturned.

    An ideal model should maintain a high first-pass rate on fourth-layer problems while keeping the proportion of invalid branches low. If a model trades extremely long reasoning for accuracy, its engineering cost-effectiveness must be assessed separately.

    1. def evaluate_trace(trace, final_answer, reference):
    2. return {
    3. "correct": symbolic_equal(final_answer, reference),
    4. "trace_tokens": count_tokens(trace),
    5. "self_corrections": count_patterns(trace, ["recheck", "miscalculated", "compute again"]),
    6. "branch_ratio": estimate_invalid_ratio(trace),
    7. }

    5. Statistical Rigor: Confidence Intervals and Paired Comparison

    A single run has no statistical meaning. The recommended practice is:

    • Sample multiple times per item (for example, five runs) and report the mean pass rate with a confidence interval;
    • Use paired comparison rather than absolute score comparison to control variance caused by problem difficulty;
    • Fix and record the sampling temperature, maximum output length, and system prompt;
    • Use stratified sampling to ensure sufficient sample size at each capability layer.

    When the confidence intervals of two models overlap, the correct conclusion is that they cannot be distinguished on the current evaluation set, rather than forcing a ranking. Many subjective judgments in the original discussion, such as one model being “between two generations,” stem precisely from the absence of these statistical constraints.

    6. Cost, Latency, and Engineering Constraints

    Beyond capability, deployment must account for engineering metrics: average reasoning cost per problem, time to first token, throughput ceiling, context length support for long proofs, and structured output stability. It is advisable to build a two-dimensional matrix that presents capability-layer scores and unit cost together, forming a Pareto frontier so that business teams can choose by scenario instead of chasing a single top rank.

    7. A Practical Evaluation Pipeline

    A minimal viable pipeline has five stages: problem management and versioning, batch inference scheduling, automated grading with sampled human review, metric aggregation and visualization, and regression alerting. In implementation, evaluation tasks can run on a container platform, a message queue can handle task distribution, object storage can hold problems and reasoning traces, and logging and monitoring services can track failure-rate drift. If general capabilities from Baidu AI Cloud are used, the same layered decoupling principle applies, avoiding tight coupling between evaluation logic and infrastructure.

    8. Common Pitfalls

    • Using a single aggregate score to mask layer differences;
    • Treating chain-of-thought length as a capability signal;
    • Leaving prompts and decoding parameters unfixed, causing conclusions to drift;
    • Failing to update the evaluation set, leading to data contamination;
    • Ignoring cost and latency, making conclusions impossible to operationalize;
    • Substituting subjective experience for reproducible experiments.

    9. Conclusion

    Evaluating the mathematical ability of large language models should shift from ranking debates to layered, reproducible, cost-constrained engineering evaluation. Defining capability layers, fixing experimental conditions, reporting confidence intervals, and presenting cost alongside capability are what make conclusions genuinely useful for technical selection. This method depends on no specific product and can be transferred directly to different models and business scenarios for continued reuse.