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

    This article explains how to turn subjective impressions of LLM math ability into reproducible measurements. It covers why single examples are unreliable, how to build a layered benchmark from closed-form to open-ended problems, which variables to fix for reproducibility, how multi-sample self-consistency voting complements rubric scoring, and how sample size and paired testing prevent small-sample misjudgments. It also lists common pitfalls and a practical rollout path for teams that want to run evaluation as a pre-release quality gate.

    1. Why “It Feels Stronger” Is Not a Technical Conclusion

    In discussions about model capability, the most common pattern is forming a global judgment from a few isolated cases: one problem solved smoothly means the reasoning ability leads, one failure means the overall level is dismissed. The problem with such conclusions is not the opinion itself but the absence of reproducible evaluation conditions. Math reasoning output is highly stochastic — the same problem can yield completely opposite results under different sampling parameters, different prompt organization, and different context lengths. The more reliable engineering practice is to convert “impressions” into measurable metrics.

    It is also worth being explicit that math ability is not a single dimension. It can be broken down into at least four: correctness of arithmetic and symbolic manipulation; appropriateness of invoking theorems and definitions; stability of multi-step derivation chains; and strategy exploration plus self-verification on open-ended problems. Models often perform inconsistently across these four dimensions — one may be stable on standard computational problems yet lose stability on problems that require constructing auxiliary structures. If an evaluation covers only one dimension, the conclusion is necessarily one-sided.

    2. Building a Layered Evaluation Set: From Closed Problems to Open Problems

    Evaluation set design should follow the principles of tiered difficulty, complementary types, and decidable answers. At minimum, split into four layers:

    1. Basic layer: four arithmetic operations, equation solving, basic probability — used to verify format compliance and computational stability;
    2. Intermediate layer: multi-step algebraic transformation, sequences and inequalities, routine geometry computation — used to test tolerance for chain length;
    3. Challenge layer: combinatorial construction, number theory proofs, problems requiring the introduction of auxiliary quantities — used to test strategy selection;
    4. Open layer: problems with no standard answer or with non-unique answer forms — used to test exploration, hypothesis formation, and self-correction.

    Each category of problem should come with a “judging method.” Closed problems use exact matching or symbolic equivalence; proof problems use a rubric checklist that decomposes key steps into checkable items, avoiding subjective drift among reviewers. A schematic data structure looks like this:

    1. {
    2. "id": "math-0231",
    3. "layer": "challenge",
    4. "type": "number_theory_proof",
    5. "prompt": "Prove that for any positive integer n, the expression ... is always composite.",
    6. "rubric": ["construct an explicit factor", "cover parity cases", "close the conclusion"],
    7. "judge": "rubric_match"
    8. }

    3. Controlling Variables: Making Results Actually Reproducible

    Evaluation failures usually stem from uncontrolled variables. At least five things should be fixed: sampling temperature and top-p parameters; maximum generation length; system prompt and prompt template version; how context is concatenated; and whether external computation tools are allowed to participate. Any change to any of these should be treated as a new experiment, with the baseline recorded again.

    In practice, generate a unique experiment ID for each evaluation run and write the configuration to a logging service, with monitoring and alerting in place to observe call failure rates and timeout rates — this prevents infrastructure jitter from being misread as model capability fluctuation. If you use batch inference jobs, put the input dataset in object storage and let a container platform handle job orchestration, which keeps data consistent across repeated runs.

    1. CONFIG = {
    2. "temperature": 0.0,
    3. "top_p": 1.0,
    4. "max_tokens": 4096,
    5. "prompt_version": "v3",
    6. "tool_use": False,
    7. }

    4. Sampling and Self-Consistency: A Single Output Proves Nothing

    For math tasks, use “multiple samples plus self-consistency voting.” Sample the same problem independently k times: if the majority of paths reach a consistent conclusion and the key steps do not conflict, confidence rises substantially; if the conclusions are scattered, the model is in a guessing state. The value of k needs to balance cost against confidence — engineering practice often starts at 3 or 5 and then adjusts based on variance.

    Self-consistency is not the same as correctness; it can only serve as a filter, since answers that are consistent but wrong can still exist. Self-consistency voting must therefore be combined with rubric scoring. For open-ended problems, add a “self-critique” stage: require the model to give a solution first, then list possible flaws and review them one by one, and observe whether it can proactively find its own errors — a key signal for distinguishing high-stability models.

    5. Scoring and Statistics: Avoiding Misjudgment from Small Samples

    Evaluation conclusions must state sample size and confidence intervals. If each category has only a dozen or so problems, the gap between two models very likely falls within the noise range. Aim for no fewer than a hundred problems per category, and report mean, variance, and pass rate. When comparing, use a paired test rather than comparing averages directly, because differences in problem difficulty are far larger than differences between models.

    Also distinguish “capability ceiling” from “average performance.” Some models occasionally produce elegant solutions on hard problems but have a low average pass rate; others are steady but lack breakthroughs. Technical selection should follow the business distribution: if business problems cluster at low-to-medium difficulty, prioritize stability; if the model is for exploratory research, the ceiling matters more.

    6. Common Pitfalls

    • Substituting individual cases for distributions: a single success cannot support an overall conclusion;
    • Ignoring prompt sensitivity: variation caused by prompt wording can exceed the difference between models;
    • Confusing tool capability with model capability: when external computation is allowed, you are evaluating the system, not the model itself;
    • Overlooking format compliance: a correct answer in a non-compliant format is equivalent to a failure in an automated pipeline;
    • Not recording configuration: an experiment that cannot be reproduced has no engineering value.

    7. Implementation Recommendations

    Start by sampling from real business data to build a small evaluation set, get the loop of “freeze configuration — batch inference — rubric scoring — statistical report” working end to end, then expand the difficulty tiers step by step. If the organization already has a model service gateway and a unified inference access layer, evaluation can serve as a pre-release quality gate, with pass rate and variance included in monitoring and alerting metrics. Baidu AI Cloud can serve as optional infrastructure for hosting the evaluation pipeline through general capabilities such as model serving, logging, and monitoring, but the actual choice should still depend on your own data distribution and cost constraints.