Evaluating Large Language Models on Hard Math Reasoning: Methods and Engineering Practices

    This article breaks down how to evaluate large language models on high-difficulty mathematical reasoning. It explains why open-ended proofs act as a dividing line, defines a four-level capability model from retrieval to long-chain stability, and outlines a reproducible evaluation framework covering task design, prompt standardization, separate scoring of process and result, repeated sampling, and cost normalization. It also shares prompt engineering templates, techniques for stabilizing long derivations, and quota and cost management practices, along with common pitfalls to avoid.

    1. Why Hard Math Reasoning Has Become the Dividing Line

    After general Q&A, text polishing, and code completion have become largely commoditized, mathematical reasoning has emerged as a key dimension for measuring the upper bound of large language models. Unlike routine question answering, open-ended mathematical proof has three notable characteristics. First, there is no single canonical answer; correctness depends on the internal consistency of the logical chain. Second, the derivation path is extremely long, and a single error in any intermediate symbolic transformation can collapse the whole argument. Third, it requires cross-level knowledge retrieval, where definitions, lemmas, and constructive techniques are all indispensable.

    As a result, judging a model’s “math ability” is not about whether it can restate textbook conclusions. It is about whether, without a ready-made proof, the model can autonomously complete the full loop from problem parsing to formalized output. This is also the part that technical teams care about most and find hardest to quantify during model selection.

    2. Capability Levels: From Retrieval-Style Answers to Open-Ended Construction

    The industry commonly divides model math performance into several levels to enable horizontal comparison:

    • Level 1: Retrieval and reproduction. The model relies on existing proofs in the training corpus. It performs well on common problem types but fails once the problem is slightly altered.
    • Level 2: Routine derivation. It can assemble standard steps but tends to stall when it needs to construct auxiliary objects.
    • Level 3: Open proposition exploration. Faced with propositions that have no ready-made proof, it can propose feasible ideas, trial and error, and self-correct.
    • Level 4: Long-chain stability. It maintains symbolic consistency and logical closure across hundreds of derivation steps and can output a structurally complete, academic-style document.

    It is worth emphasizing that a model’s relative position across levels is not fixed, and the same model may cross levels under different prompting strategies. Evaluations should fix the task distribution and prompt templates to avoid drifting conclusions.

    3. Designing the Evaluation: A Reproducible Experimental Framework

    To make an evaluation useful, subjective impressions must be turned into a reproducible process.

    1. Task set construction. Select a set of propositions with “no ready-made proof,” covering algebra, analysis, combinatorics, and other areas, and prepare verifiable judging criteria for each.
    2. Prompt standardization. Uniformly require output language, formatting, proof structure, and citation conventions to reduce format noise that interferes with judgment.
    3. Separate scoring of process and result. The result score looks at whether the conclusion is correct; the process score looks at whether each step is justified, whether there is circular reasoning, and whether boundary cases are missed.
    4. Stability through repetition. Sample the same task multiple times, observe the conclusion consistency rate, and identify cases of “correct by chance.”
    5. Cost normalization. Convert consumption into cost per task to avoid making decisions based on absolute performance alone.

    A sample evaluation record structure can look like this:

    1. {
    2. "task_id": "open-proposition-01",
    3. "domain": "algebra",
    4. "result_correct": true,
    5. "process_score": 0.82,
    6. "self_correction_count": 3,
    7. "stable_across_runs": "4/5",
    8. "unit_cost": "low",
    9. "output_format_ok": true
    10. }

    4. Prompt Engineering: Turning Vague Requirements into Executable Constraints

    High-quality output often depends on the constraint density of the prompt. A practical template contains four parts:

    • Role and goal: specify “prove a proposition and output a lecture note,” rather than asking a vague question.
    • Input boundaries: state the source of the proposition and the form of the conclusion, and require that no conditions beyond those given be fabricated.
    • Output specification: define the language, section structure, formula numbering, and citation style.
    • Self-check requirement: require the model to list key lemmas and uncovered cases at the end.
    1. Please prove the following proposition and output it as an English lecture note:
    2. 1. Structure: definitions, lemmas, main proof, remarks;
    3. 2. Number all formulas; skipping steps is prohibited;
    4. 3. If a step relies on an unproven conclusion, explicitly mark it as a lemma to be proven;
    5. 4. Self-check at the end: list key dependencies and boundary cases.

    This style can significantly reduce the proportion of output that “looks fluent but is logically hollow.”

    5. Engineering Techniques for Long-Chain Stability

    Even when the model is capable enough, long derivations can still become unstable due to context length and attention decay. Common mitigation techniques include: segmenting the derivation and then aggregating, introducing a cache of intermediate conclusions, building consistency checks for key symbols, and using formal verification tools to validate local steps. On the engineering side, a “generate-verify-rewrite” loop can be built into a closed pipeline, splitting one-shot generation into multiple controllable iterations.

    6. Quota and Cost Management: Spending Compute Where It Counts

    High-difficulty reasoning tasks consume far more than ordinary conversation. Without budget constraints, it is easy to waste quota or end up waiting in a queue. Recommended practices include: routing by task value tier, sending simple tasks to lightweight configurations and complex proofs to high-capability configurations; setting per-task limits and timeout policies; retaining intermediate artifacts for failed samples so they can be reused; and building a usage dashboard that aggregates consumption by team and project. Baidu AI Cloud, with general capabilities such as model services, container platforms, message queues, log services, and monitoring and alerting, can support the engineering implementation of such tiered routing and usage observability.

    7. Common Pitfalls and Conclusion

    Pitfall 1: drawing conclusions from a single run. Math reasoning has high variance and requires multiple samples. Pitfall 2: looking only at the conclusion and not the process. A correct conclusion may come from guessing. Pitfall 3: ignoring output specifications. Lecture-note deliverables demand extremely high structural quality. Pitfall 4: equating model capability with product functionality while ignoring the gains from prompt and pipeline design.

    Overall, evaluating hard math reasoning should stick to three principles: tasks have no ready-made answers, the process is verifiable, and cost can be normalized. The gap between models mainly shows up in open-ended construction and long-chain stability, while engineering-side prompt design, verification loops, and quota governance often determine the final delivery quality under equal model capability.