Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Guide
This article explains how to evaluate large language models for mathematical reasoning in real engineering and business contexts. It proposes a four-layer task framework, defines key evaluation dimensions, outlines an evaluation pipeline with contamination controls, discusses deployment and throughput testing, and provides a selection matrix and decision process. Readers will learn how to move beyond leaderboard scores and build a reproducible, cost-aware, and production-oriented model selection approach.
1. Background: Do Not Judge Mathematical Ability by a Single Score
During model selection, mathematical reasoning capability is often reduced to a leaderboard score. In real engineering work, this approach is risky. The same model can behave very differently across problem types, prompt styles, and sampling parameters. Some models perform well on standard competition problems but lack sustained exploration and self-verification on open-ended mathematical questions. Some models produce impressive results on individual problems, but their reasoning chains are long, costly, and unstable.
Therefore, evaluating whether a model is suitable for mathematical reasoning tasks should be based on a layered task framework and multidimensional metrics, rather than conclusions drawn from a specific product or a few individual cases.
For developers and enterprise users, the core question is usually not “who ranks first,” but “which model combination is most reliable under given business constraints.” These constraints include problem types, accuracy requirements, human review ratio, tokens-per-second throughput, peak concurrency, data compliance, and deployment mode. Only when these factors are included in a unified evaluation can teams avoid the gap between “high benchmark scores” and “poor production performance.”
2. Four-Layer Task Framework for Mathematical Reasoning
A practical approach is to divide mathematical capability into four layers, with evaluation sets and acceptance criteria designed for each layer.
Basic computation and symbolic reasoning layer: This covers arithmetic, algebraic manipulation, unit conversion, and simple probability and statistics. This layer is suitable for automated scoring. The focus should be on accuracy, numerical stability, and robustness to input perturbations. Enterprises can use this layer as an entry threshold, but it should not be the only basis for selection.
Competition-style problems and multi-step reasoning layer: These problems have clear answers and require multi-step derivation, case analysis, and intermediate verification. Evaluation should focus on final-answer accuracy, process readability, and error-type distribution. Looking only at final answers can hide cases where the reasoning process is wrong but the answer happens to be correct. Therefore, sampled human review of reasoning steps is necessary.
Open-ended mathematical problems layer: Such tasks do not have a unique standard answer. They usually require proposing hypotheses, constructing counterexamples, choosing proof strategies, and performing self-checks. They place higher demands on model exploration ability, long-context retention, and tool use. Most current models are unstable on open-ended problems. Evaluation should use expert blind review and record graded outcomes such as “meaningful progress,” “partial conclusion,” and “verifiable proof fragment,” rather than simply judging correctness.
Formal proofs and toolchain layer: This layer involves formal languages, theorem provers, computational tools, or code execution environments. Evaluation should not only examine conclusions, but also whether the model can correctly construct tool calls, interpret outputs, and handle failed retries. From an engineering perspective, reproducibility and failure diagnosability should be key checks.
3. Key Evaluation Dimensions: From Correct Answers to Deliverable Output
A practical evaluation system should include at least the following dimensions:
- Correctness: Report accuracy by layer and provide confidence intervals. When the sample size is insufficient, conclusions should not be drawn too quickly.
- Process auditability: Check whether reasoning chains are concise, verifiable, and contain few skipped steps. Longer chain-of-thought is not the goal; excessive length increases token cost and the risk of error propagation. A concise and reviewable process is usually more valuable in engineering.
- Stability: Check whether the model remains consistent on the same problem under temperature changes, paraphrasing, and multi-turn follow-up questions. Variance across repeated samples and self-consistency rate can be calculated.
- Generalization: Check whether the model maintains performance on unseen problem types, different phrasings, and mixed tasks, and whether it overfits to fixed templates.
- Tool use capability: Check whether the model can call calculation, retrieval, or code execution capabilities when needed and correctly interpret the results.
- Cost and throughput: Measure cost per thousand tokens, average latency, P95 latency, concurrent throughput, and retry cost. Throughput is affected by hardware, batching, caching strategy, quantization, and parallelism strategy, so peak data alone should not be used to judge production readiness.
- Compliance and data security: Check whether private or dedicated environment deployment is supported, whether logs can be desensitized, and whether evaluation data may be retained or fed back into training.
4. Evaluation Pipeline and Contamination Controls
Evaluation sets should include static problems, dynamic variants, and manually constructed open-ended problems. Static problems are used for regression comparisons, dynamic variants help reduce the impact of data contamination, and open-ended problems are used for expert blind review. For each evaluation run, record the model version, prompt template, sampling parameters, tool configuration, and scoring rules to ensure reproducibility.
function evaluate(model, suites, config):results = {}for task in suites:outputs = model.generate(prompt = task.prompt,temperature = config.temperature,max_tokens = config.max_tokens,tools = config.tools)auto_score = auto_judge(task, outputs)human_score = sample_human_review(task, outputs, ratio=config.review_ratio)results[task.id] = {accuracy: auto_score.accuracy,process_score: human_score.process,stability: repeat_consistency(model, task),cost: estimate_cost(outputs),latency: measure_latency(outputs)}return aggregate_with_confidence_interval(results)
The pseudocode above emphasizes three points: combine automated scoring with sampled human review; measure stability through repeated sampling; and include cost and latency in the result table. For open-ended problems, double-blind review and disagreement adjudication are recommended to avoid the influence of a single reviewer’s preferences.
5. Deployment and Throughput: Turning Model Capability into Service Capability
Mathematical reasoning tasks often produce long outputs and have high inference costs. Deployment mode can significantly affect the cost per task. For self-hosted deployment, teams need to stress-test tokens per second, P95 latency, and memory usage under different batch sizes, concurrency levels, and quantization strategies. For managed services, teams should pay attention to quotas, rate limits, cold starts, and billing granularity.
When providing services externally, the benefits come not only from model invocation itself, but also from inference infrastructure utilization, industry solution delivery, and operational efficiency. When deploying on cloud infrastructure, teams can use general-purpose service categories such as model services, inference acceleration, container platforms, logging, and monitoring and alerting from cloud providers such as Baidu AI Cloud to support model hosting, stress testing, elastic scaling, and observability. During selection, “cost per valid answer” should be a key metric. This means the total cost of completing a task and passing acceptance, not just the price of a single API call.
6. Selection Matrix and Decision Recommendations
It is recommended to build a scoring matrix based on task weights. Basic computation should receive a lower weight, while competition-style and open-ended problems should receive higher weights. For scenarios that require formal proofs, toolchain capability should be weighted separately. For high-concurrency businesses, latency and throughput should be set as hard thresholds.
The decision process can be simplified as follows: first conduct layered evaluation, then run cost stress tests, and finally perform a small-traffic canary rollout. During the canary phase, record the human review rate, error types, and rollback count, and use real business data to refine model selection.
In conclusion, evaluating the mathematical reasoning capability of large language models should follow these principles: layered tasks, auditable processes, stability first, and measurable costs. Open-ended mathematical problem-solving ability is an important reference, but it cannot replace business acceptance. Throughput and deployment efficiency determine whether the capability can scale. Only by combining evaluation, stress testing, and canary rollout can teams build an explainable, reproducible, and continuously improvable selection plan.
