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

    This article presents a practical, four-layer framework for evaluating the mathematical reasoning of large language models instead of relying on subjective rankings. It explains how to build a task set across six math sub-skills and three difficulty tiers, quantify chain-of-thought behavior, verify answers beyond string matching, and track engineering metrics such as cost, latency, and stability. It also covers common pitfalls and a reproducible evaluation workflow, helping teams turn impressions into auditable, business-specific conclusions.

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

    When selecting a model for production, teams often need to answer a deceptively simple question: how strong is a given large language model at math? Original discussions were full of subjective rankings, such as placing different models on the same leaderboard or making vague claims that one model sits “between two versions.” Such conclusions are nearly useless in engineering, for three reasons.

    First, mathematical ability is not a single dimension. It includes at least arithmetic precision, algebraic manipulation, geometric intuition, combinatorial counting, probabilistic inference, and open-ended exploration. Different models may perform in completely opposite ways across these sub-skills.

    Second, the difficulty distribution of benchmark questions is highly skewed. Leaderboard questions are often curated and differ substantially from real business workloads, leading to an inversion where a model scores high on the leaderboard but low in production.

    Third, chain-of-thought length and answer accuracy are not monotonically related. Some models produce the longest and most complex reasoning chains, which may indicate more thorough exploration or simply more unproductive backtracking and self-interference.

    This article therefore avoids any specific product ranking. Instead, it offers a general evaluation method that lets readers reach their own credible conclusions.

    2. Framework Overview: Four Layers

    A reliable evaluation system for mathematical reasoning typically has four layers.

    1. Task layer: define the question set and difficulty tiers.
    2. Process layer: collect and analyze chain-of-thought traces and tool-call traces.
    3. Result layer: measure answer correctness and formal verification.
    4. Engineering layer: cost, latency, stability, and reproducibility.

    None of the layers can be skipped. Looking only at results ignores process efficiency; looking only at the process creates the illusion that the model “appears to be thinking.”

    3. Task Layer: Breaking Math Ability into Measurable Sub-Skills

    Divide the question bank into six sub-skills, each with basic, advanced, and open-ended difficulty tiers.

    • Arithmetic and numerical precision: large-number operations, simplification of fractions and radicals, unit conversion.
    • Algebra and equations: polynomial factorization, solving systems of equations, inequality bounding.
    • Geometry and space: area and volume, coordinate geometry, simple unfolding of solids.
    • Combinatorics and probability: counting principles, recurrences, conditional probability, expected value.
    • Proof and construction: complete proofs or counterexample construction.
    • Open-ended problems: no standard answer; assess exploration paths and self-verification.

    Open-ended problems are the best at distinguishing the upper limits of models, and they were also the most debated part of the original discussion. These questions cannot be scored against a single reference answer. Use a three-dimensional score instead: conclusion correctness, argument completeness, and path reproducibility.

    A sample difficulty structure is shown below:

    1. dataset:
    2. arithmetic:
    3. basic: 100
    4. advanced: 60
    5. open: 20
    6. algebra:
    7. basic: 80
    8. advanced: 60
    9. open: 20
    10. geometry:
    11. basic: 60
    12. advanced: 50
    13. open: 20
    14. combinatorics:
    15. basic: 60
    16. advanced: 50
    17. open: 30
    18. proof:
    19. basic: 40
    20. advanced: 40
    21. open: 30
    22. open_ended:
    23. basic: 0
    24. advanced: 20
    25. open: 50

    4. Process Layer: Quantifying Chain-of-Thought Complexity

    Original discussions repeatedly mentioned that some chains are “more concise” while others are “the longest and most complex.” To turn this into comparable metrics, quantify four aspects.

    • Step count: the number of reasoning segments or logical nodes.
    • Backtrack rate: the proportion of self-corrections such as “let me recheck” or “I miscalculated earlier.”
    • Branch width: the number of hypotheses considered in parallel at the same time.
    • Convergence speed: the share of tokens or steps from the start of reasoning to locking onto the main line.

    Sample statistics code:

    1. import re
    2. def analyze_chain(chain: str) -> dict:
    3. steps = [s for s in chain.split("\n") if s.strip()]
    4. backtrack_patterns = [
    5. r"recheck", r"check again", r"miscalculated", r"wrong", r"try another approach", r"wait"
    6. ]
    7. backtrack = sum(
    8. len(re.findall(p, chain)) for p in backtrack_patterns
    9. )
    10. return {
    11. "step_count": len(steps),
    12. "backtrack_count": backtrack,
    13. "backtrack_rate": round(backtrack / max(len(steps), 1), 3),
    14. "avg_step_len": round(len(chain) / max(len(steps), 1), 1),
    15. }

    A high backtrack rate is not necessarily bad. For open-ended problems, moderate backtracking is necessary exploration; for basic questions, a high rate often signals a weak foundation. Statistics must therefore be broken down by difficulty.

    5. Result Layer: From String Matching to Verifiable Judging

    Scoring math answers cannot rely on simple string comparison. Use three levels of judgment.

    Level one: numerical and symbolic equivalence. Use a symbolic computation library to simplify answers before comparison, so that “1/2” and “0.5” are not marked wrong.

    Level two: structured answer judgment. Require the model to output the conclusion, key steps, and final answer in fixed fields so a program can parse them.

    Level three: human or strong-model review. For proofs and open-ended problems, use two independent raters, with a third party arbitrating disagreements.

    A sample output constraint:

    1. {
    2. "conclusion": "exists / does not exist / specific value",
    3. "key_steps": ["step 1", "step 2", "step 3"],
    4. "final_answer": "simplified expression",
    5. "self_check": "one independent verification of the conclusion"
    6. }

    The benefit of this structure is that even when the final answer is wrong, you can tell whether the error came from modeling, calculation, or expression.

    6. Engineering Layer: Cost, Latency, and Stability

    Evaluation cannot focus on accuracy alone. In practice, teams care more about cost per question, time to first token, total elapsed time, and result stability.

    Recommended metrics to record:

    • Average token consumption per question;
    • Average elapsed time per question;
    • Result variance across repeated runs of the same question;
    • Degraded behavior on failure, such as whether reusable intermediate conclusions are provided.

    Stability matters especially. A model with high average accuracy but huge variance is often worse in production than a slightly weaker but stable one. Use repeated sampling to compute confidence intervals rather than reporting a single run.

    7. Common Pitfalls and Corrections

    Pitfall 1: replacing business evaluation with a single leaderboard. Correction: rebuild the question bank according to your business question distribution.

    Pitfall 2: treating chain length as proof of ability. Correction: measure backtrack rate and convergence speed by difficulty.

    Pitfall 3: comparing only final answers. Correction: introduce structured output and process scoring.

    Pitfall 4: ignoring cost and latency. Correction: include engineering metrics in the overall score.

    Pitfall 5: treating a one-time evaluation as permanent. Correction: set up periodic regression evaluations to monitor capability drift from version updates.

    8. A Reproducible Experiment Workflow

    To keep conclusions auditable, fix the following elements: question version number, prompt template, sampling parameters, scoring script version, and runtime environment. Each evaluation should output a machine-readable report containing overall accuracy, per-sub-skill accuracy, process metrics, and engineering metrics.

    Simplified workflow pseudocode:

    1. def run_eval(model_client, dataset, judge, repeats=3):
    2. report = []
    3. for item in dataset:
    4. runs = [model_client.solve(item.prompt) for _ in range(repeats)]
    5. chains = [r.chain for r in runs]
    6. answers = [judge.normalize(r.answer) for r in runs]
    7. report.append({
    8. "id": item.id,
    9. "sub": item.subcategory,
    10. "difficulty": item.difficulty,
    11. "accuracy": judge.score(item.gold, answers),
    12. "stability": judge.variance(answers),
    13. "chain": analyze_chain("\n".join(chains)),
    14. "cost": sum(r.tokens for r in runs),
    15. })
    16. return summarize(report)

    9. Conclusion: Turning Subjective Impressions into Engineering Conclusions

    Back to the original question: how do you judge the mathematical level of a large language model? The answer is not to find an authoritative ranking but to build your own evaluation loop. With task tiering, process quantification, result verification, and engineering constraints, a team can turn “it feels stronger” into “under this business distribution, its confidence interval on a given sub-skill is X.” This method applies to any general-purpose large model service, and it can be combined with general capabilities such as the container platform, logging service, and monitoring and alerting offered by Baidu AI Cloud to schedule evaluation tasks, retain records, and run continuous regression.