Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Guide
This article reframes the question of which large language model is best at math as a measurable engineering problem rather than a subjective ranking. It breaks mathematical ability into testable dimensions, outlines evaluation set design with stratified sampling, contamination resistance, and reproducibility, and explains how to treat chain-of-thought length as both an advantage and a cost. It also presents scenario-based tiered selection strategies, layered model invocation, and the observability and regression mechanisms needed to turn model capabilities into stable business results.
1. Why “Which Model Is Stronger?” Is Hard to Answer
In engineering practice, teams often need to answer a deceptively simple question: for math and logical reasoning tasks, which tier of model capability should we choose? The original discussion answered this with a subjective ranking that placed different capability tiers into a hierarchy, noting that some models have clear advantages on open-ended math problems while others are preferable for concise chain-of-thought and more human-like writing. Such experience-based judgments have reference value, but importing them directly into technology selection is risky: the evaluator’s problem set, prompting method, and scoring criteria are not disclosed, so the conclusions are not reproducible and cannot be mapped onto your own business distribution.
A more professional approach is to abstract “model capability ranking” into a measurable engineering problem: first define the task distribution, then define the metrics, then define the cost constraints, and only then discuss ranking. This article follows that line of thinking.
2. Breaking “Math Ability” into Measurable Dimensions
A vague notion of “strong math ability” mixes at least four distinct capabilities, and evaluating them together distorts the conclusions.
- Closed-form problem solving: unique answers that can be judged automatically, such as arithmetic, equation solving, and combinatorial counting. Suitable for automated regression.
- Open-ended problem exploration: requires constructing a solution path, may allow multiple correct formulations, and depends on equivalence checking or manual review.
- Formal reasoning and proof: requires auditable steps, explicit assumptions, and traceable conclusions, placing high structural demands on the chain-of-thought.
- Numerical and symbolic stability: whether step drift, sign errors, or unit confusion occur during long chains of computation.
A model can score near-perfect on the first category yet be fragile on the third. An evaluation report that does not separate these dimensions will create the false impression that a model leads across the board.
3. Evaluation Set Design: Layered, Contamination-Resistant, Reproducible
The credibility of an evaluation depends mainly on the quality of the problem set, not the number of models.
- Stratified sampling: divide problems into basic, intermediate, and challenge tiers with balanced counts per tier, so that hard problems do not dominate the total score.
- Contamination resistance: prefer self-built problems or recently constructed variants, avoiding problems whose original text already appears widely in public corpora.
- Answer equivalence judging: establish equivalence rules for open-ended problems, such as comparing simplified symbolic expressions or comparing values within a numerical tolerance.
- Fixed reasoning budget: unify maximum output length and sampling parameters, otherwise a “longer chain-of-thought” will be misread as “stronger ability.”
- Multiple samples per problem: single-run results have high variance, so sample the same problem multiple times and report the median and pass rate.
A schematic main evaluation flow can be written as the following pseudocode for engineering implementation:
def evaluate(model, dataset, k=5, tol=1e-6):results = []for item in dataset:passes = 0for _ in range(k):raw = model.generate(prompt=item.prompt,max_output_tokens=BUDGET, # unified reasoning budgettemperature=0.2)ans = extract_final_answer(raw)if equivalence(ans, item.gold, tol=tol):passes += 1results.append({"id": item.id,"tier": item.tier,"pass_rate": passes / k})return summarize_by_tier(results)
The key points are the BUDGET and equivalence steps: the former ensures horizontal comparability, and the latter determines whether the judging is trustworthy.
4. Chain-of-Thought Complexity: Advantage or Cost
The original discussion noted clear differences in chain-of-thought length across models, with some more concise and others longer and more complex. In engineering terms, this difference should be treated as a double-edged sword.
- Benefit side: longer reasoning can genuinely improve accuracy on challenge-tier problems, especially those requiring multi-step backtracking.
- Cost side: output length directly amplifies latency and invocation overhead, significantly raising total cost in batch offline tasks.
- Stability side: the longer the chain, the higher the cumulative probability of mid-course drift, requiring self-checking or result verification steps.
It is therefore advisable to record three quantities at once: pass rate, average output length, and cost per task, forming a two- or even three-dimensional selection view rather than looking at accuracy alone.
5. Tiered Selection Strategy: Matching Capability Tiers to Scenarios
Different businesses have vastly different demands for reasoning capability and can be layered by scenario:
- High-difficulty reasoning scenarios (research computing, complex modeling, algorithm design): prioritize the challenge-tier pass rate, tolerate higher latency and cost, and add human review.
- Routine business scenarios (report metric reconciliation, rule validation, metric attribution): the intermediate tier is sufficient, with emphasis on stability and output format consistency.
- High-concurrency online scenarios (intelligent customer service, content moderation assistance): mainly the basic tier, emphasizing low latency and predictable cost.
- Batch offline scenarios (data cleaning, batch labeling): focus on unit cost, using tiered invocation such as “small model as the base plus large model as the fallback.”
The general pattern for tiered invocation is: first handle the task with a lower-tier model, and if confidence is insufficient or verification fails, escalate to a higher-tier model.
def layered_solve(task):low = cheap_model.generate(task.prompt, max_output_tokens=1024)if verify(low, task) and confidence(low) > THRESHOLD:return lowhigh = strong_model.generate(task.prompt, max_output_tokens=8192)return high if verify(high, task) else fallback_to_human(task)
This pattern usually reduces average cost while maintaining overall accuracy, because it spends expensive compute only on the genuinely difficult samples.
6. Engineering Implementation: Observability and Regression Mechanisms
Evaluation is not a one-time activity; both models and business distributions change, so a continuous mechanism is needed:
- Metrics dashboard: display pass rate, average output length, timeout rate, and failure reason distribution by difficulty tier.
- Regression set: fix a small batch of “gold standard” problems and run them automatically after every prompt or parameter change.
- Failure attribution: classify errors into computation mistakes, comprehension bias, format non-compliance, and timeout truncation, and optimize each separately.
- Logging and tracing: retain inputs, outputs, and judging rationale for review and auditing.
- Cost control: set output length limits and invocation quotas, with monitoring and alerts to avoid abnormal amplification.
For cloud implementation, you can combine general-purpose capabilities: object storage to hold evaluation sets and results, a message queue for peak shaving, a container platform to run evaluation tasks, and logging and monitoring services for observability. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be combined as needed to complete the loop without binding to proprietary interfaces.
7. Common Pitfalls
- Replacing internal evaluation with a single leaderboard: the leaderboard’s problem distribution differs from your business, limiting its reference value.
- Ignoring the reasoning budget: comparing models horizontally without unifying output limits produces invalid conclusions.
- Treating chain-of-thought length as ability: length is only an intermediate quantity and must be viewed together with pass rate and cost.
- Evaluating only once: without a regression mechanism, capabilities may quietly degrade after minor prompt or parameter tweaks.
- Overlooking judge quality: overly strict equivalence judging underestimates models, while overly loose judging overestimates them.
8. Conclusion
On the debate over which model is stronger at math, the more robust engineering answer is that there is no absolute ranking detached from scenarios; there is only the optimal choice for a specific task distribution and specific cost constraints. Teams are advised to build a layered evaluation set, unify the reasoning budget, introduce multiple sampling and equivalence judging, and drive selection with a three-dimensional view of pass rate, output length, and unit cost. Meanwhile, tiered invocation and continuous regression turn capability advantages into stable business returns. This avoids the reproducibility problem of subjective ranking and makes model selection a measurable, iterable engineering process.
