Evaluating LLM Mathematical Reasoning: Reproducible Assessment and Engineering Practice
How to evaluate large language models on mathematical proof tasks beyond one-off impressions or public leaderboards. This article covers layered test sets, fixed prompt templates, scoring that mixes hard checks with human review, budget circuit breakers, tiered routing, and capability bands for production use.
1. The real problem: from one-off impressions to reproducible evaluation
Discussions of large language model (LLM) math ability often fall into two extremes. One side draws conclusions from a single impressive or failed run. The other relies only on public leaderboards or subjective rankings. The first approach uses too little evidence. The second often ignores the task mix, prompt design, budget limits, and the cost of human review. For developers and enterprise users, the useful question is not whether one model is “the strongest.” It is how to choose an appropriate capability tier—and keep evaluation and governance sustainable—given the task type, quality bar, latency target, and budget cap.
Generating mathematical proofs is a typical high-difficulty task. It combines natural-language understanding, symbolic reasoning, long chains of logic, awareness of counterexamples, document structure, and verifiable results. Compared with ordinary Q&A, proofs are harder to judge with automatic metrics. The final answer may be only a conclusion, while the real value is whether the derivation is rigorous, whether boundary conditions were missed, and whether inapplicable theorems were cited. Evaluation therefore has to move from “does the result look right?” to “can the process be checked, can the conclusion be reproduced, and can errors be located?”
A practical evaluation framework should cover at least these dimensions:
- Correctness: Is the conclusion right? Are there logical jumps? Are boundary conditions complete?
- Verifiability: Can a person or a tool check the output step by step? Are lemmas, definitions, and assumptions traceable?
- Stability: Do results stay consistent across repeated runs and slight prompt rewrites?
- Structure: Can the model follow required sections, notation rules, and document formats so later typesetting and review stay manageable?
- Cost and latency: How much quota, time, and retry risk does one high-quality task consume?
- Maintainability: Can outputs be archived, compared, regression-tested, and shared across a team?
Only when these dimensions are quantified can teams avoid conclusions such as “this model looks pretty good,” which cannot be reused.
2. Designing evaluation for mathematical proof tasks
2.1 Layer the test set instead of collecting only hard problems
A useful test set has four layers:
- Foundational items: Standard definitions and simple theorem proofs, used to check symbol understanding and basic reasoning.
- Composite items: Multi-step derivations and intermediate lemmas, used to check long-chain organization.
- Literature claims without proofs: A stated result that the model must prove itself, used to check real reasoning rather than retrieval and paraphrase.
- Open exploration items: Problems without a standard answer, or tasks that require a counterexample. These probe exploration, but they require expert review.
Claims taken from the literature without an attached proof are especially valuable, because the model cannot lean on a ready-made answer. The evaluation design must still be explicit: do not cite an external finished proof; provide a complete derivation; if a known theorem is used, state its conditions and scope. Otherwise the model may hide gaps with phrases such as “it is obvious” or “this follows from a standard result.”
2.2 Fix the prompt template to reduce chance variation
A prompt should not be only “prove this statement.” A more reproducible template includes role, input, constraints, output format, and a self-check. For example:
Task: Prove the following mathematical statement.Input: Statement, given definitions, and the range of theorems that may be used.Constraints:1. Do not cite external proofs that were not provided;2. State the basis for each derivation step;3. If the conditions are insufficient, say so and give a counterexample or a corrected condition;4. Output a structured English document with title, assumptions, proof, conclusion, and citation notes.Self-check: At the end, list steps that may be doubtful and mark where human review is needed.
A fixed template does not mean a more complex prompt is better. It means different models are compared under the same input conditions. Engineering teams should version prompts and record the template, parameters, budget, and human scores for each run so the setup becomes a regression asset.
2.3 Combine automatic checks with human review
Scoring for mathematical proofs can mix hard checks and softer ratings:
- Hard checks: Is the structure complete? Is notation consistent? Are assumptions, proof, and conclusion present? Are there obvious compile or typesetting errors? Were problem conditions omitted?
- Automatic assists: Numerically check computable parts; test boundary examples for sets, mappings, and inequalities; check lemma dependencies for keywords and direction.
- Human review: Domain reviewers score logical rigor, step completeness, readability, and error severity.
A five-level scale works well: 0 means the conclusion is wrong or unreadable; 1 means the direction is roughly right but a critical gap remains; 2 means the main steps are correct but boundary conditions or citations are loose; 3 means the proof is basically complete and needs only light repair; 4 means the proof is complete, clearly structured, and ready for the document workflow. For high-risk tasks, only scores of 3 or above should enter automatic typesetting or knowledge-base archival.
3. Cost, quota, and queues: engineering governance is not optional
Many teams evaluate models on quality alone and ignore quota use and queue wait. In practice, remaining quota before expiry, peak queueing, failed retries, and long outputs all change total cost. Proofs and long documents use many output tokens, long reasoning traces, and a high retry rate. Without budget control, a single task can burn a large share of quota.
3.1 Budget circuit breakers and tiered routing
Put a single router in the call path. Estimate difficulty and output length first, then choose a capability tier. Open, high-difficulty items go to a high-capability pool and require human review. Standard solutions and document cleanup go to a lower-cost pool. When the budget is tight, defer non-critical work instead of retrying blindly.
function route(task, budget):estimated = task.estimate_cost()if budget.remaining < estimated * 1.2:return "defer_or_human_review"if task.verifiable and task.difficulty <= 2:return "low_cost_pool"if task.difficulty >= 4:return "high_capability_pool_with_review"return "standard_pool"
This pseudocode states three principles: trip a circuit breaker when the budget is insufficient; push simple, verifiable tasks down to cheaper capacity; bind hard tasks to review. It is a general governance pattern, not a product API.
3.2 Cut waste with cache, batching, and failure caps
Reuse cache and templates for repeated definition explanations, formatting, and section reordering. For batch evaluation, process in batches and record consumption per run. Cap retries and define an escalation path: after two consecutive failures on the same prompt, do not keep retrying blindly. Split the problem, add conditions, or hand it to a person. For long documents, emit an outline and key lemmas first, then generate section by section, so a mid-run failure does not force a full restart.
At the infrastructure layer, teams can use general cloud product categories to host evaluation and governance: object storage for test sets and output archives, a container platform to schedule batch jobs, and logging and monitoring to track latency, failure rate, and quota use. Baidu AI Cloud’s object storage, container platform, and logging and monitoring categories are examples of general-purpose services that can support this practice. The actual choice still depends on team constraints and compliance requirements.
4. Capability bands and selection strategy
Absolute rankings are less useful than selecting by capability band. Math-related work roughly splits as follows:
- Band A: open-problem exploration. Proposing conjectures, building counterexamples, or searching for a proof route is still high risk. Experts should lead; the model is only an aid.
- Band B: reconstructing complex proofs. Given a literature result, the model can draft and organize steps, but every line needs review.
- Band C: standard solutions and derivations. Clear problem types and verification paths fit an automated pipeline plus sampling.
- Band D: document cleanup and structured writing. Logic demands are lower. Format, terminology, and readability matter more, so a lower-cost option can work.
Practitioners sometimes discuss relative math performance: some mid-to-high-end models approach a higher band on specific tasks, while others produce longer reasoning traces or more natural writing. Those observations are hypotheses, not procurement decisions. Put them on one test set, run regressions with the same prompt, budget, and scoring rules, and keep failure cases. For open mathematical problems, the safer consensus is that models can speed exploration but cannot replace expert verification. For standard proofs and document generation, the engineering payoff is clearer.
5. Implementation checklist
- Build a golden set of about 50 to 200 items covering foundations, composites, claims without proofs, and document writing. Prefer reproducibility over size.
- Fix prompt templates and parameters. Record version, budget, output length, and human scores.
- Use tiered routing. Bind hard tasks to human review and push easier tasks down to control cost.
- Set a budget circuit breaker and a failure cap so retries do not exhaust quota.
- Archive outputs as searchable assets. Keep failure cases and revision history for later regression.
- For proofs, use structure checks, sampled human review, and review of critical steps. Do not select a model from a single result.
- Separate exploration from production. Exploration may tolerate a higher failure rate. Production needs a quality bar and a fallback.
6. Conclusion
LLMs have real value for mathematical proofs, structured documents, and engineering workflows, but evaluation has to move from subjective experience to reproducible engineering. Teams should measure correctness, verifiability, stability, cost, and latency; use layered test sets and fixed templates to reduce chance variation; and control risk with budget circuit breakers, tiered routing, and human review. Treat models as aids for open mathematical problems, not as substitutes for experts. For standard proofs, document cleanup, and batch work, engineering governance can deliver steadier returns. Final selection should not revolve around a single product. It should return to three basics: task distribution, quality bar, and cost constraints.
