Evaluating and Practicing Large Language Model Math Reasoning: A Reproducible Framework
This article presents a reproducible framework for evaluating the mathematical reasoning of large language models (LLMs). Instead of relying on linear leaderboards, it breaks math capability into four measurable layers, quantifies chain-of-thought quality across length, redundancy, self-correction, and self-consistency, and outlines an engineering approach for private test sets, layered scoring, sampling, and cost control. It also covers model selection by scenario and a cloud architecture built from generic services. Readers will learn how to run their own evaluation pipeline and reach conclusions that hold under their own data, budget, and latency constraints.
1. Why the Question “Which Model Is Better” Needs to Be Reframed
In comment-section debates, model capability is often compressed into a linear ranking: one model first, another second. But once you integrate models into a production workflow, this kind of ranking offers almost no decision-making value, for three reasons.
First, math capability is not a scalar. Formal theorem proving, open-ended math problem solving, word-problem modeling, numerical computation, and symbolic derivation place completely different demands on a model. Strong performance on long-chain symbolic derivation does not mean a model is equally reliable on word problems that require “model first, then compute.”
Second, evaluation sets carry contamination risk. Classic problems from public question banks have very likely already entered training corpora, inflating scores. A truly discriminative evaluation must use a self-built, timestamped private question set.
Third, chain-of-thought length and accuracy are not monotonically related. It is widely observed in the industry that overly long reasoning chains accumulate intermediate-step errors while significantly increasing latency and compute cost. So “more thorough reasoning” and “more concise reasoning” are two dimensions that need to be measured separately.
The goal of this article is therefore not a leaderboard, but a reproducible evaluation framework that lets you draw your own conclusions from your own data.
2. Capability Layers: Breaking “Math Ability” into Measurable Dimensions
It is recommended to split evaluation into four layers, score each independently, and then apply weights.
- Basic arithmetic and numerical precision: multi-step arithmetic, unit conversion, percentages, and ratios. This layer looks simple but is the foundation of long-chain tasks; once it fails, errors propagate downstream.
- Single-step reasoning: applying a single knowledge point, such as one differentiation or one probability calculation. Used to gauge how solid a model’s fundamentals are.
- Multi-step composite reasoning: requiring three to ten chained steps, where intermediate results must be passed correctly. This is the most discriminative layer.
- Open-ended problems: problems with no single canonical solution, where the model must choose its own path, define intermediate quantities, and verify the reasonableness of results. This layer is the hardest to score automatically and usually requires human review or a combination of “model-as-judge plus human spot checks.”
For open-ended problems, the prevailing industry consensus is that only a minority of models can handle such problems stably; most models degrade noticeably when they must autonomously construct auxiliary constructions, perform case analysis, or verify via multiple paths. This layer should be listed separately and not averaged with the first three, otherwise real differences get diluted by a large volume of easy problems.
3. Quantifying Chain-of-Thought Quality: Length, Conciseness, and Self-Correction
The original text notes that chain-of-thought length varies significantly across models: some are extremely long and complex, while others are more concise and closer to human writing habits. This phenomenon can be quantified.
- Average reasoning steps: using the count of identifiable “step markers” in reasoning passages as the baseline denominator.
- Redundancy rate: the proportion of steps whose removal leaves the final answer unchanged; a higher value means more redundancy.
- Self-correction count: the number of “recompute / found an error on checking” type statements. Moderate correction is good; frequent correction indicates insufficient stability.
- Conclusion consistency: the proportion of identical final answers across repeated sampling of the same problem, i.e., the self-consistency rate.
Illustrative evaluation script (pseudocode, expressing flow only):
def evaluate(sample, rubric):records = []for _ in range(k): # k repeated samples to measure self-consistencyout = model.generate(sample.prompt)ans = extract_answer(out)records.append({"correct": rubric.check(ans, sample.gold),"steps": count_steps(out),"self_fix": count_self_fix(out),"tokens": out.usage.total_tokens,"latency_ms": out.latency_ms,})return {"accuracy": mean(r["correct"] for r in records),"self_consistency": max_group_ratio(records),"avg_steps": mean(r["steps"] for r in records),"redundancy_hint": mean(r["steps"] for r in records) / rubric.min_steps,"cost": sum(r["tokens"] for r in records),}
The key point is to view accuracy, self-consistency, average steps, and unit cost in the same table. Chasing only accuracy often means accepting extremely long chains of thought and high overhead; chasing only conciseness may sacrifice performance on hard problems.
4. Engineering a Reproducible Evaluation
For conclusions to be credible, the evaluation must be engineered.
Question set management: tag the private question bank by difficulty and knowledge point, retain creation timestamps, and periodically add new questions to counter data contamination. Record the gold answer, acceptable answer range, and scoring key points for each question.
Layered scoring strategy:
- Objective questions use exact match or numerical tolerance comparison;
- Derivation questions use multi-point checks on “key intermediate conclusions” rather than only the final value;
- Open-ended questions use a judge model plus human spot checks, with a recommended spot-check ratio of no less than ten percent.
Sampling and statistics: sample each question multiple times and report the mean and confidence interval. A ranking from a single sample has almost no statistical meaning, a point most easily overlooked in practice.
Cost control: set a credit or quota budget for the evaluation, allocated by “difficulty × repetitions.” A common approach is to first run a small sample (e.g., thirty questions, single sample) for coarse screening to eliminate clearly unqualified configurations, then run full multi-sample evaluation on candidate configurations. This enables horizontal comparison within a limited budget.
Illustrative budget-control logic:
budget = 2000 # available credits/quotaplan = []for tier in ["basic", "single", "multi", "open"]:n, k = coarse[tier] # coarse screening stage: small n, few repetitionsif estimate_cost(n, k) > budget * 0.3:n = shrink(n)plan.append((tier, n, k))# after coarse screening, run full multi-sample evaluation on the top-2 configurations
5. Selection Approach for Typical Scenarios
- High-throughput, low-cost batch tasks (e.g., numerical validation in data cleaning): prioritize accuracy on the basic and single-step layers, plus unit token cost; a concise chain of thought is more economical.
- Complex engineering computation and modeling: prioritize the multi-step composite layer and self-consistency; longer chains of thought and higher latency are acceptable.
- Open-ended research assistance: look only at layer-four performance and require self-checking of results and multi-path verification; scores on other layers have limited reference value.
- User-facing writing and explanation scenarios: chain-of-thought conciseness and human readability carry more weight; verbose derivations actually degrade the experience.
6. Running It in the Cloud: General Architecture Recommendations
A complete evaluation system can be built entirely from generic cloud product categories, with no need to bind to any proprietary interface:
- Object storage: store the private question bank, model outputs, and evaluation reports, partitioned by version.
- Message queue: decouple “question distribution” from “result collection,” smoothing peaks and filling valleys to avoid peak-time queuing that slows overall progress.
- Container platform: run evaluation executors and scoring services in a containerized way, scaling elastically for batch tasks.
- Logging and monitoring/alerting: record latency, failure rate, and quota consumption for each call, set threshold alerts, and prevent the budget from being burned through by abnormal tasks.
- Key and permission management: centrally host model-call credentials, distribute with least privilege, and avoid hardcoding.
On Baidu AI Cloud, all of the above capabilities have corresponding generic product categories that can be combined directly, upgrading evaluation from “manually running a few questions” to a continuously running pipeline.
7. Common Pitfalls Checklist
- Replacing private evaluation with public question-bank rankings: severe contamination, non-transferable conclusions.
- Drawing conclusions from a single sample: noise exceeds the difference.
- Looking only at the final answer: ignoring intermediate-step errors, making it impossible to locate failure causes.
- Equating chain-of-thought length with capability: long chains bring latency and cost, plus error accumulation.
- Averaging across all difficulties: masking a model’s real weaknesses on hard problems.
- Ignoring quota and queuing constraints: no matter how good the evaluation plan, it halts once the budget is exhausted.
8. Conclusion
Rather than asking whether one model can beat another, reframe the question as: under my question distribution, my cost budget, and my latency requirements, which configuration performs best overall. By splitting capability into four layers, quantifying chain-of-thought quality, engineering the batch runs, and carrying the pipeline on generic cloud components, you get a conclusion that is your own, reproducible, and iterable. The value of this method is that when models iterate or quota policies change, you only need to rerun the pipeline rather than rebuild your judgment criteria from scratch.
