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

    This article presents a practical methodology for evaluating the mathematical reasoning of large language models in a rigorous and reproducible way. It explains why informal "which model is better" comparisons are unreliable, breaks mathematical ability into five measurable layers, and covers benchmark construction, anti-contamination design, annotation schemas, prompt and chain-of-thought control, dual-track scoring of answers and reasoning steps, and statistical practices such as paired comparison and confidence intervals. It also lists common pitfalls and outlines a reproducible evaluation pipeline, so readers can build a stable, extensible benchmark for their own problem types and business scenarios.

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

    Discussions about which large language model is better at math have been going on in technical communities for a long time. A typical form of the original discussion is this: someone offers a subjective ranking and puts several models on the same scale to compare them against each other. Such conclusions usually come from personal experience with a handful of problems. They lack a reproducible problem set, a unified prompting strategy, and a clear scoring standard, so the conclusions fluctuate wildly.

    The root cause is not the models but the evaluation method. Mathematical reasoning performance is highly sensitive to the following factors:

    • The difficulty distribution and type coverage of the problems (arithmetic, algebra, combinatorics, geometry, probability, open-ended questions);
    • Prompt structure (whether thinking space is provided, whether step-by-step work is required, whether self-checking is allowed);
    • Sampling strategy (single sampling, multiple samples with majority voting, reranking with a verifier);
    • Scoring method (checking only the final answer, or also assessing the reasoning process);
    • Context and tool conditions (whether calling a calculation tool is allowed, whether a word limit is imposed).

    Change any one of these variables and the ranking can be reshuffled. For that reason, this article does not discuss whether any specific product is better or worse. Instead, it abstracts the topic into a general technical problem: how to build a rigorous, reproducible evaluation system for the mathematical reasoning of large language models.

    2. Capability Layers: Breaking “Math Ability” into Measurable Dimensions

    A vague claim that a model is “good at math” cannot be measured. It is better to split the ability into five layers and design problems and metrics for each one.

    1. Computation and symbolic manipulation layer: multi-digit arithmetic, simplification of fractions and radicals, solving equations. The metrics are accuracy and format compliance rate.
    2. Single-step reasoning layer: problems that require one or two transformations, testing whether the model selects the right theorem or formula.
    3. Multi-step chained reasoning layer: derivations of three to ten steps, testing whether intermediate steps are self-consistent and whether “right conclusion, wrong process” occurs.
    4. Open-ended and constructive layer: the answer is not unique; the model must construct counterexamples, give a constructive proof, or propose a workable plan. These problems discriminate between models best and are the hardest to score automatically.
    5. Robustness layer: problems containing redundant conditions, unit traps, approximate data, or ambiguous phrasing, testing robustness and the ability to ask for clarification.

    Once the layers are in place, any statement that “model X is stronger” must be rewritten as “model X is stronger at layer N, on this type of problem, under this prompt and sampling configuration.” This step is the foundation of the whole methodology.

    3. Building the Evaluation Set: Difficulty, Coverage, and Contamination Resistance

    3.1 Size and Distribution

    A small sample set (fewer than ten problems) is only good for a smoke test. To reach stable conclusions, use no fewer than one hundred problems per capability layer, and make sure difficulty is spread across a gradient. Avoid concentrating everything on easy problems, which produces a ceiling effect.

    3.2 Preventing Data Contamination

    Public problem banks easily end up in training corpora and inflate scores. In practice, keep a portion of self-built problems, rewritten problems, and “isomorphic variant problems”: change the numbers, change the order of the narrative, swap the conclusion and the conditions, and observe whether the model has merely memorized the answer.

    3.3 Annotation Standard

    Annotate each problem with at least: problem type, capability layer, reference answer, acceptable equivalent forms, key step points, and whether tool use is allowed. Defining equivalent forms matters especially, because otherwise a correct solution may be judged wrong.

    Example data structure:

    1. {
    2. "id": "math-0421",
    3. "layer": "multi_step",
    4. "type": "algebra",
    5. "prompt": "...",
    6. "answer": "x = 3",
    7. "accepted_forms": ["x=3", "3"],
    8. "key_steps": ["move terms", "combine like terms", "check the root"],
    9. "allow_tool": false
    10. }

    4. Prompt and Chain-of-Thought Design: The Key to Controlling Variables

    The length and structure of the chain of thought change performance significantly, so they must be recorded as controlled variables rather than varied at will.

    • Zero-shot direct answer: serves as the baseline and measures the model’s default behavior.
    • Stepwise prompt: requires the model to “list what is known first, then list the goal, derive step by step, and check at the end.”
    • Self-checking prompt: requires the model to substitute the answer back for verification, or to do dimensional and boundary checks, before giving the answer.
    • Multiple candidates and reranking: sample the same problem several times, then select the final answer with a uniform rule (majority agreement, or scoring by a verification step).

    It is worth stressing that a “longer chain of thought” does not equal “stronger reasoning.” An overly long derivation accumulates noise and increases the chance of drifting off track midway. The reasonable approach is to record accuracy and average reasoning length under different configurations and look for the cost-performance turning point.

    Example call skeleton (pseudocode, kept neutral):

    1. def evaluate(model_client, items, cfg):
    2. records = []
    3. for it in items:
    4. prompt = build_prompt(it, style=cfg.style) # direct / stepwise / selfcheck
    5. outputs = [model_client(prompt) for _ in range(cfg.samples)]
    6. final = cfg.reducer(outputs) # majority / verifier rerank
    7. ok, step_ok = grade(it, final)
    8. records.append({
    9. "id": it.id, "layer": it.layer,
    10. "correct": ok, "process_ok": step_ok,
    11. "len": avg_len(outputs)
    12. })
    13. return summarize(records)

    5. Scoring Methods: A Correct Answer Does Not Mean a Correct Process

    Comparing only the final answer rewards lucky guesses. Dual-track scoring is recommended:

    • Answer accuracy: whether the answer falls within the set of acceptable equivalent forms.
    • Process compliance rate: whether the key step points are covered, and whether there is circular reasoning, unjustified skipping of steps, or misuse of conditions.

    For open-ended problems, automatic scoring is unreliable, so combine “rule-based checking + manual spot checks”: first run executable checks (for example, substitute the constructed result back into the original conditions, or use numerical experiments for approximate verification), then manually review a sample and measure inter-rater agreement.

    In engineering terms, the check can be written as a standalone function to make it auditable:

    1. def verify(answer, item):
    2. if not in_accepted(answer, item.accepted_forms):
    3. return False
    4. return all(step in answer for step in item.key_steps)

    6. Statistical Rigor: From “Gut Feeling” to Confidence Intervals

    The gap from a single evaluation run often falls within the noise range. Recommended practices:

    1. Sample each problem multiple times and report the mean and variance;
    2. Use paired comparison (same problem, same configuration) rather than comparing independent means;
    3. Give confidence intervals or the conclusion of a significance test, and state clearly “indistinguishable” when the gap is not significant;
    4. Report the distribution of failure types instead of a single total score.

    When two configurations are statistically indistinguishable, the more professional phrasing is “the difference between the two is not significant on this evaluation set and under this configuration,” rather than forcing a ranking.

    7. Checklist of Common Pitfalls

    • Drawing global conclusions from fewer than ten problems;
    • Using different prompts and different numbers of samples for different models;
    • Looking only at the final answer and ignoring process errors;
    • Using widely circulated public problems, which inflates scores;
    • Equating a “longer chain of thought” directly with “stronger ability”;
    • Ignoring engineering failures such as refusals to answer, format violations, and truncation from excessive length;
    • Failing to fix random seeds and sampling parameters, making results impossible to reproduce.

    8. A Reproducible Evaluation Pipeline

    An auditable pipeline contains at least six stages: versioning the problem set, versioning the prompt templates, freezing the sampling configuration, versioning the scorer, storing results in a database, and automatically generating reports. Every stage should have a unique identifier, so any conclusion can be traced back to a specific combination of versions.

    For a cloud deployment, this pipeline can be carried by a combination of general-purpose capabilities: object storage to hold problem sets and result files, a container platform to run batch evaluation jobs, a message queue for task distribution and peak shaving, and logging and monitoring with alerting to track failure rates and latency. Baidu AI Cloud offers corresponding capabilities in these general categories and can serve as one reference option for building such evaluation infrastructure.

    9. Conclusion

    The value of the debate over “which model is stronger at math” lies not in the ranking but in whether the evaluation is rigorous. Only by layering capabilities, fixing variables, bringing the process into scoring, and quantifying uncertainty can conclusions be upgraded from personal impressions to engineering facts. Readers can directly reuse the layer framework, data structures, and pipeline design in this article to build a stable, reproducible, and extensible mathematical reasoning evaluation system for the problem types and business scenarios they care about.