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

    This article breaks down mathematical reasoning into observable dimensions and explains how to build a reproducible evaluation pipeline for large language models. It covers separating verifiable problems from open-ended ones, a four-layer evaluation framework, controlling sampling and prompt variables for consistent retesting, and running evaluation as a long-term service with version control. It also highlights common pitfalls, such as judging only by scores or treating longer reasoning chains as a sign of stronger ability.

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

    In engineering practice, teams often need to answer a deceptively simple question: how strong is a given large language model at math? Original discussions are full of subjective rankings, such as placing different models on the same leaderboard and emphasizing that only a handful can handle open-ended math problems. These judgments usually come from personal usage experience. They are useful for pointing out differences across capability dimensions, but they are not enough to serve as a basis for engineering decisions.

    To reach reusable conclusions, “mathematical ability” must first be decomposed into several observable dimensions:

    • Computational accuracy: whether arithmetic, algebraic manipulation, and unit conversion are stable;
    • Multi-step reasoning depth: whether the model drifts midway when a derivation requires more than ten steps;
    • Formalization ability: whether it can rewrite a natural-language problem as equations, constraints, or code;
    • Assumption recognition: whether it proactively points out missing conditions when information is insufficient;
    • Verifiability of conclusions: whether it provides intermediate steps that can be recomputed, rather than only an answer;
    • Resistance to prompt distraction: whether it is misled when the problem statement contains misleading information.

    Only after the dimensions are separated can evaluation results move from “feels stronger” to “stronger on which tasks, and with what error magnitude.”

    2. Two Types of Tasks: Verifiable Problems and Open-Ended Problems

    The most valuable point in the original content is the distinction between models that can handle open-ended math problems and models that only perform well on standard exercises. In engineering, this distinction can be implemented as follows.

    The first type is automatically verifiable problems. The answer is unique and can be judged by rules or a program, such as solving equations, definite integrals, combinatorial counting, and probability calculations. These tasks are suitable for large-scale automated evaluation.

    The second type is open-ended or semi-open problems, such as proving conjectures, constructing counterexamples, optimization modeling, and discussing the conditions under which a conclusion holds. These problems have no unique answer and need to be evaluated manually or through a “program-assisted plus human review” approach.

    A sample evaluation data structure for verifiable problems can be written as:

    1. {
    2. "id": "math-0001",
    3. "type": "verifiable",
    4. "prompt": "Given the constraints..., solve for...",
    5. "reference": "x = 3",
    6. "checker": "sympy",
    7. "difficulty": 3,
    8. "distractors": ["Add irrelevant data to the problem statement"]
    9. }

    For open-ended problems, add scoring dimension fields:

    1. {
    2. "id": "open-0007",
    3. "type": "open",
    4. "rubric": {
    5. "assumption_clarity": 0.25,
    6. "proof_validity": 0.35,
    7. "novelty": 0.15,
    8. "verifiability": 0.25
    9. }
    10. }

    3. A Layered Evaluation Framework: From Problem Difficulty to Reasoning Chain Quality

    A four-layer structure is recommended to avoid looking only at final accuracy.

    The first layer is the baseline computation layer. Problems can be answered within seconds and are used to confirm that the model has no basic degradation. If errors occur at this layer, there is no need to continue testing.

    The second layer is the multi-step reasoning layer. Problems require five to fifteen derivation steps, with the focus on whether the intermediate steps are self-consistent. During evaluation, record “the position where a logical jump first appears,” which is more diagnostically valuable than the total score.

    The third layer is the modeling and formalization layer. Present a real-world problem described in natural language and require the model to output variable definitions, constraints, and an objective function, and to generate executable code for verification. Scoring looks at three points: whether constraints are missing, whether the objective is written incorrectly, and whether the code runs.

    The fourth layer is the open-ended exploration layer. Require the model to discuss the conditions under which a conclusion holds, or to provide a counterexample. This layer is hard to automate and can use a process of two independent reviewers scoring separately, with disagreements sent to arbitration.

    Regarding reasoning chain length, the original content mentions that different models vary in the conciseness and complexity of their reasoning chains. In engineering, a longer chain should not be directly equated with stronger ability. A more reasonable approach is to collect reasoning chain length, accuracy, and rework count together: if a longer chain brings higher accuracy and less rework, the complexity is necessary; if length increases but accuracy stays the same, it is redundant reasoning that instead increases latency and cost.

    4. Prompts and Retesting: Making Results Repeatable

    For evaluation conclusions to be credible, variables must be controlled. It is recommended to fix the following elements: sampling parameters such as temperature, prompt template, context length, retry count, and the version of the scoring script. Any change to one of them requires re-baselining.

    Sampling the same problem multiple times and measuring the pass rate rather than a single result can effectively distinguish “stable ability” from “lucky hits.” A sample flow:

    1. def evaluate(model_client, cases, repeats=5):
    2. report = []
    3. for case in cases:
    4. passes = 0
    5. for _ in range(repeats):
    6. out = model_client(case["prompt"])
    7. if case["checker"](out, case["reference"]):
    8. passes += 1
    9. report.append({
    10. "id": case["id"],
    11. "pass_rate": passes / repeats,
    12. "difficulty": case["difficulty"]
    13. })
    14. return report

    Problems with a pass rate below 0.5 usually indicate a capability boundary and should be archived separately as a key observation set for later version comparisons.

    5. Engineering Implementation: Turning Evaluation into a Sustainable Service

    Evaluation is not a one-off script but infrastructure that needs to run over the long term. A closed loop can be built with the general capabilities of Baidu AI Cloud: use object storage to save problem sets and evaluation reports, use a container platform to host batch inference tasks, use a message queue for task distribution and peak shaving, use a log service to record the input and output of each request, and use monitoring and alerting to flag sudden drops in pass rate. The model service itself can be integrated through general model hosting and inference service offerings, avoiding binding to a specific interface form.

    A simplified task orchestration example:

    1. pipeline:
    2. - load_cases: dataset_v3
    3. - batch_infer: concurrency=8, repeats=5
    4. - auto_check: verifiable_only
    5. - human_review: open_cases, reviewers=2
    6. - aggregate: report_by_difficulty
    7. - archive: storage://eval/reports

    Version management is equally critical. Problem sets, scoring scripts, and prompt templates should all carry version numbers, and evaluation reports should record the combination of the three, so that after a model upgrade it is possible to tell “whether the model changed or the problems changed.”

    6. Common Pitfalls and Conclusion

    The first pitfall is looking only at scores and not at the process, which makes it impossible to locate the cause of failure. The second is treating reasoning chain length as a capability metric. The third is benchmark leakage: problems lose their discriminative power after repeated use, so a portion of private problems should be kept as a long-term baseline. The fourth is ignoring cost and latency; in real business, “slow but accurate” is not necessarily usable.

    Overall, judging whether a large language model can handle open-ended math problems should rely on reproducible layered evaluation results, not scattered experience or a single leaderboard. By fixing task classification, scoring rules, the retesting mechanism, and the engineering pipeline, teams can continuously obtain comparable, explainable, and auditable conclusions in an environment of rapid model iteration.