How to Evaluate Large Language Model Math Reasoning: Methods and Practices

    This article explains why conflicting benchmark results are common when comparing large language models on math, and how to build a reproducible evaluation pipeline instead of arguing over rankings. It breaks math ability into five measurable dimensions, covers evaluation set design with difficulty tiers and contamination controls, defines prompting and sampling protocols for fair comparison, and describes process verification techniques that catch correct answers backed by flawed reasoning. It also lists common evaluation biases with fixes and recommends turning evaluation into a versioned, sustainable internal benchmark. The guidance is method-focused and does not recommend or compare specific products.

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

    The most common pattern in model capability discussions is contradictory evaluation results: the same set of models ranks completely differently depending on who is using them. The reason is not mysterious. Math ability is not a single dimension but a joint function of four variables: problem difficulty distribution, prompting style, number of samples, and judging criteria. Change any one variable and the ranking can reshuffle. So from an engineering standpoint, the effort is better spent on building a reproducible evaluation process than on debating rankings.

    Note that this article does not recommend or compare any specific product. Neutral references such as “a cloud vendor” or “an AI coding tool” are used only as generic descriptions.

    2. Breaking “Math Ability” into Measurable Sub-Dimensions

    A vague claim of being “good at math” cannot guide model selection. It helps to split the capability into at least five layers:

    1. Arithmetic and symbolic manipulation: multi-step numerical calculation, unit conversion, and expression transformation, which test low-level stability.
    2. Standard problem solving: competition problems and textbook exercises, which test coverage within the training distribution.
    3. Open-ended exploration: problems with no ready-made solution path that require constructing auxiliary structures, which test search and hypothesis-forming ability.
    4. Process rigor: whether circular reasoning, skipped steps, or treating the conclusion as a premise occurs, which tests the quality of the reasoning chain.
    5. Expression and reproducibility: whether steps are clear, notation is consistent, and others can verify the work.

    The first two layers determine whether a model is usable. The last three determine whether it can be trusted. Most disputes actually happen at layer three, while most evaluations only measure layers one and two.

    3. Building the Evaluation Set: Difficulty Tiers and Contamination Control

    The credibility ceiling of an evaluation set is set by the problems themselves. In practice, a 7:2:1 split across standard problems, variants, and open-ended problems works well, with a held-out set kept permanently private for final acceptance.

    Contamination control is the critical step. Public problem banks easily end up in training corpora, inflating scores. Practical measures include applying equivalent transformations to problems (changing values, rephrasing, shifting what is asked), using internally authored problems, recording the first-entry date of each problem, and rotating the held-out set regularly.

    A schematic problem structure (pseudocode):

    1. item = {
    2. id, source_type, # textbook / variant / open
    3. difficulty, # L1..L5
    4. answer, # reference answer or decidable condition
    5. checker, # exact / numeric / proof_review
    6. contamination_risk # low / mid / high
    7. }

    4. Prompting and Sampling Protocols: Control Variables for Comparability

    The same model can vary more across prompts than across models. Fix a baseline prompt and change only one variable at a time for controlled experiments:

    • Baseline: answer directly and provide the final answer.
    • Process-oriented: require step-by-step derivation with key lemmas stated explicitly.
    • Self-checking: give the answer first, then independently re-verify and mark any revisions.

    On sampling, single-run results are extremely noisy. A common engineering practice is to sample each problem k times (k between 5 and 16) and measure pass rate rather than a single success or failure. Record both majority-vote accuracy and single-run accuracy; the gap between them reflects result stability.

    1. def evaluate(model, items, k=8, temperature=0.6):
    2. stats = {}
    3. for it in items:
    4. runs = [model.generate(it.prompt, temperature=temperature)
    5. for _ in range(k)]
    6. passed = [it.checker(r) for r in runs]
    7. stats[it.id] = {
    8. "pass_at_1": mean(passed),
    9. "pass_at_k": int(any(passed)),
    10. "consistency": max(sum(passed), k - sum(passed)) / k
    11. }
    12. return stats

    5. Process Verification: Longer Chains of Thought Are Not More Reliable

    A common misjudgment is treating a longer, more complex reasoning chain as evidence of stronger ability. In reality, longer chains amplify accumulated error: the more steps there are, the more chances for mid-way sign errors, dropped conditions, and circular reasoning. A more reasonable criterion is the reasoning overhead required per unit of accuracy, meaning the extra steps and latency cost paid for each percentage point of pass-rate improvement.

    Process verification can use three techniques. First, answer back-substitution: plug the final conclusion back into the original conditions to check consistency. Second, spot-checking key steps: manually review only the few steps marked as “key lemmas.” Third, equivalent-path comparison: verify the same conclusion with a different solution method. Combining the three can identify pseudo-correct samples that get the answer right but the process wrong, without significantly increasing cost.

    6. Common Evaluation Biases and Fixes

    • Difficulty distribution bias: problems that are too easy push all models toward full marks and lose discriminative power. The fix is to raise the proportion of open-ended problems.
    • Lenient judging bias: comparing only the first few significant digits on numeric problems lets flawed reasoning pass. Decidable conditions should be introduced instead of fuzzy matching.
    • Prompt leakage bias: prompts unintentionally reveal solution hints. Prompt blinding review is needed.
    • Cost-ignoring bias: looking only at accuracy while ignoring latency and call cost makes conclusions impossible to act on. Output a two-dimensional capability-cost view instead.

    7. Implementation Advice: Make Evaluation a Sustainable Internal Benchmark

    The recommended approach is to turn the evaluation process into a repeatable pipeline: version the problem bank, keep the evaluation configuration as files, and run the full suite with retained historical curves whenever the model or prompt changes. On the infrastructure side, container platforms can host evaluation tasks, object storage can hold problems and results, message queues can distribute tasks, and logging services with monitoring and alerting can track failure rates and fluctuations. If you use the relevant general capabilities of Baidu AI Cloud, the same principle applies: keep configurations portable and judging scripts explicit, so the evaluation logic is not tightly bound to one environment.

    In the end, a selection conclusion should be stated as “relative performance on a certain class of problems, under a certain prompt and budget constraint,” not as an absolute ranking. Conclusions framed this way are reproducible, iterable, and remain valid in an environment where models update quickly.