How to Evaluate and Choose LLMs for Mathematical Reasoning: A Practical Framework
This article presents a practical framework for evaluating and selecting large language models for open-ended mathematical reasoning. Instead of relying on brand comparisons or static rankings, it breaks "math ability" into measurable dimensions—answer correctness, process validity, readability, and stability—and builds a three-layer evaluation funnel combining automated grading, self-consistency sampling, and human review. It also covers reproducible prompt and decoding configurations, statistical rigor for small samples, and selection under engineering constraints such as cost, tail latency, and quotas. Readers will find scoring tables, sample code, common pitfalls, and a deployment checklist they can apply to their own data and budget.
1. Background: Why “Which Model Is Better” Is Hard to Answer
In real projects, teams often need to answer a deceptively simple question: for open-ended math problems, which class of large language model should we choose? Many discussions degrade into verbal comparisons between brands, producing conclusions that are neither reproducible nor useful for engineering decisions. A more reliable approach is to break the problem apart: first define what “math ability” actually means, then define the constraints under which you evaluate (latency, concurrency, context length, budget), and finally use repeatable samples and statistical methods to reach a conclusion.
It is worth stressing that model capability is a moving target that changes with every version release, so any static ranking becomes outdated quickly. For this reason, this article does not give specific rankings. Instead, it offers an evaluation and selection method that lets readers get answers for their own scenarios, on their own data and budget, at any time.
2. Breaking “Math Ability” into Measurable Dimensions
Open-ended math problems can be split into at least four dimensions, each requiring different samples and scoring methods:
- Answer correctness: whether the final answer is correct. This can be checked automatically and is suitable for large-scale benchmarking.
- Process validity: whether every step in the reasoning chain holds. This requires step-level annotation or manual spot checks.
- Expression and readability: whether the solution is clearly structured and uses consistent notation, which affects the cost of human reading and further editing.
- Stability: how consistent the model is across repeated samples of the same problem, which directly determines whether it can go into production.
Many arguments come from confusing these dimensions: one model gets the right answer with a jumpy process, another has a rigorous process but the wrong answer, and the two cannot be compared on a single “who is better” axis. A more practical engineering approach is to assign a weight to each dimension—for example, 0.5 for answer correctness, 0.3 for process validity, 0.1 for readability, and 0.1 for stability—and then adjust according to the business scenario.
3. A Layered Evaluation Framework: From Automated Grading to Human Review
A three-layer funnel is recommended to balance scale and trustworthiness.
The first layer is automated grading. Build a set of 300–1000 problems with reference answers, covering categories such as arithmetic and algebra, geometry, combinatorics, probability, and number theory, and use final-answer comparison to produce a pass rate. Sample code:
def grade(pred: str, gold: str, tol: float = 1e-6) -> bool:# Normalize: strip spaces, unify symbols, extract the final answer fragmentp = normalize(extract_final(pred))g = normalize(extract_final(gold))return numeric_close(p, g, tol) or p == g
The second layer is self-consistency sampling. Sample the same problem k times (k = 5 or 8) and measure the proportion of consistent answers as a stability metric. A low consistency rate means the model is unreliable on that problem type, and it should not go live even if it answers correctly once.
The third layer is human review. Review step by step the samples that are “correct but with a suspicious process” and “wrong but close to correct,” record error types (calculation mistakes, missing conditions, circular reasoning, hallucinated formulas), and build an error distribution chart to guide prompt and post-processing improvements.
4. Prompt and Decoding Configuration: Making Evaluation Reproducible
When evaluation is not reproducible, it is usually because the configuration was not written down. Fix the following variables and record them in your experiment log: system prompt, temperature, maximum output length, whether tools are enabled, number of samples, and random seed (if available). A minimal configuration example:
{"temperature": 0.2,"top_p": 0.9,"max_tokens": 4096,"samples_per_item": 5,"system_prompt": "Reason step by step, and give the final answer on a separate line at the end"}
For prompt design, open-ended math problems are better served by a three-part structure of “model first, solve next, verify last,” and the model should be asked to run a dimensional or extreme-value check in the final step. Such constraints significantly reduce the proportion of “answers that look plausible but are wrong” and make process validity easier to evaluate automatically or semi-automatically.
5. Statistical Rigor: Small-Sample Rankings Are Not Trustworthy
The most common pitfall in evaluation is drawing conclusions from a few dozen problems. If a model has a 70% pass rate on a sample of 50, its confidence interval spans roughly ±13 percentage points, so two models can easily “look different but actually be the same.” Recommendations:
- Use at least 300 samples, and more than 1000 for key conclusions;
- Report confidence intervals rather than single point values;
- Use paired tests to compare performance on the same problems, reducing the variance caused by problem difficulty;
- Run stratified statistics by error type, so overall averages do not hide structural defects.
6. Selection Under Engineering Constraints: Cost, Queuing, and Quotas
In a real system, capability is only one constraint. You also need to evaluate the cost per problem, tail latency from queuing and rate limiting, whether the context length can hold long derivations, and how fast quotas or credits are consumed. A practical scoring table:
| Dimension | Weight | Description |
|---|---|---|
| Answer correctness | 0.35 | Automated grading pass rate |
| Process validity | 0.25 | Step-level error rate |
| Stability | 0.15 | Consistency rate across repeated samples |
| Tail latency | 0.15 | P95 response time |
| Cost per unit | 0.10 | Cost per thousand calls |
When quotas are limited or queuing is severe, you can use “tiered routing”: send simple problems to a low-cost general model and escalate hard problems to a strong reasoning model; also cache long derivations in segments and reuse verified intermediate conclusions to reduce repeated consumption. Sample logic:
def route(item, budget):if item.difficulty <= 2 and budget.remaining > 0.2:return cheap_modelreturn strong_reasoning_model
7. Common Pitfalls and How to Avoid Them
- Replacing measurement with brand impression: conclusions must be tied to the sample, configuration, and date.
- Looking only at the final answer: process errors get amplified on more complex problems.
- Ignoring prompt sensitivity: the same model can swing by more than ten percentage points with a different prompt.
- Overlooking quotas and queuing: offline benchmarks look good, but online tail latency is unacceptable.
- Evaluating only once: models keep iterating, so you should maintain a monthly regression set.
8. Deployment Checklist
- Build a private evaluation set of more than 500 problems with category labels, and keep a version number;
- Fix the prompt and decoding configuration so every experiment is reproducible;
- Run automated grading, self-consistency, and human spot checks in parallel across three layers;
- Produce reports with confidence intervals, plus an error-type distribution;
- Use the scoring table together with cost, tail latency, and quotas to make routing decisions;
- Run a regression every month and update the selection conclusion.
With this method, teams do not need to rely on any external ranking and can still reach selection conclusions that are stable, explainable, and iterable under their own data and budget—which is exactly what engineering the mathematical reasoning ability of large language models requires.
