Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Framework
This article presents a practical method for evaluating large language models on mathematical reasoning and selecting one for a specific task. It covers how to define evaluation goals, a five-dimension scorecard with suggested weights, a three-layer test-set design, repeated-run execution and logging, cost and quota planning formulas, a stepwise prompt template, and common evaluation mistakes. Readers can use the framework to build a repeatable test workflow, compare models on verifiable problems, and balance quality against token cost and latency.
Large language models have moved beyond text summarization and translation into more complex scenarios such as logical reasoning, code generation, and academic research. Mathematical proof is a common standard for testing whether a model reasons rigorously, but to judge whether a model fits your task, looking only at how many problems it solves correctly is not enough. This article provides an executable evaluation method. Readers can follow the steps to build their own testing workflow.
1. Define the Evaluation Goal First
Before evaluation, state what question the test should answer. If the goal is research assistance, the focus is whether the proof is rigorous. If the goal is teaching materials, the focus is whether the explanation is clear and the structure is well formed. If the goal is batch processing, the focus is cost and latency. Different goals imply different weights for each metric. Comparing scores without defining the goal first usually produces conclusions with no reference value.
2. Scorecard: Five Dimensions and Weights
The scorecard below can be used directly for internal evaluation. The weights are suggested values. Teams can adjust them for their own goals, but every adjustment should be documented.
| Dimension | Specific metric | Suggested weight | Judgment method | Reference pass line |
|---|---|---|---|---|
| Proof correctness | Whether each reasoning step holds and whether the conclusion is consistent with the premises | 40% | Manual step-by-step review; key steps can be checked with formal tools such as Lean | All key steps hold; no circular reasoning |
| Open problem solving | When there is no standard answer, whether the model can give a reasonable proof route | 20% | Two reviewers independently judge whether the route is feasible | Reviewers can reproduce the proof by following the route |
| Chain-of-thought conciseness | Ratio of effective steps to all steps; number of rollbacks and repetitions | 15% | Manual or rule-based counting of effective steps and total steps | Redundancy ratio below the team-defined threshold, for example 30% |
| Academic standard output | Whether LaTeX compiles and whether theorem, lemma, and proof environments are complete | 15% | Compile with a LaTeX compiler, then manually check the structure | No compilation errors; structure matches the target journal or lecture-notes format |
| Cost and latency | Input and output tokens per item, time to first token, total elapsed time | 10% | Read data from the usage field returned by the API |
Meets business budget and response deadline |
Proof correctness has the highest weight because a proof that looks fluent but has logical gaps is the most harmful in research. Chain-of-thought conciseness should not be treated as a standalone “shorter is better” metric. Reasoning that is too short may skip key justification, so it must be judged together with correctness.
3. Building the Test Set
A test set should be divided into three layers. The first layer contains standard theorems from textbooks, such as Lagrange’s theorem, to test basic reasoning ability. The second layer contains lemmas from published papers, to test more complex argumentation. The third layer contains internal propositions that the team has not yet published and for which experts have already provided reliable proofs, to test true open problem solving.
Two points require attention. First, for items in the second and third layers, verify whether they already appear in the model’s training data. If the proof of a proposition is widely circulated online, the model’s performance may come from memorization rather than reasoning. Second, every item must have a verifiable answer. Using an “unsolved” proposition as a test item makes it impossible for reviewers to judge whether the model’s proof is correct, and the test result becomes meaningless.
Take Lagrange’s theorem as an example. The item can be written as: Let G be a finite group and H a subgroup of G. Prove that the order of H divides the order of G. Reviewers should check whether the model correctly uses the definition of left cosets, whether it proves that distinct cosets are disjoint, and whether it shows that each coset corresponds one-to-one with the elements of H. If the model directly cites “Lagrange’s theorem” as the conclusion, the item should be marked as failed on proof correctness, because the task asks for the proof process.
4. Running the Evaluation
Model outputs are stochastic, so a single result is unreliable. Run each item at least five times and use the pass rate as the item score. For each run, record the following information: model name and version, call date, temperature parameter, system prompt, complete input and output, and token statistics returned by the API. The same model name may correspond to different underlying versions on different dates, so recording only the model name is insufficient.
Chain-of-thought token statistics should be recorded separately. Some APIs bill or return reasoning-process tokens separately from final-output tokens. Track them separately and avoid mixing the two.
5. Cost Estimation
The cost of a model call is determined by three parts: input tokens, output tokens, and the number of retries after failures. The formulas are:
Single-call cost = input tokens ÷ 1000 × input unit price + output tokens ÷ 1000 × output unit price
Expected cost ≈ single-call cost × (1 + retry rate)
The unit price follows each platform’s price table. The retry rate must be calculated from logs, generally by dividing the number of failures by the total number of calls. Cached input tokens may be billed at a lower price. If the platform supports caching, include the cache ratio in the calculation.
It is important to note that quota consumption percentage cannot be used directly to measure the computational complexity of a task. For the same task, longer input, more detailed output, and more retries will consume more quota, but these factors are not equivalent to reasoning difficulty. Therefore, use token counts and the cost formula to measure consumption, and use the scorecard to measure task quality.
6. Quota and Scheduling
Many teams encounter this problem: prepaid quota cannot be used during peak periods because of queuing, and a large remaining balance is discovered only near expiry. This can be addressed in three ways.
First, build a usage dashboard that records daily call volume and remaining quota for each model, and send a reminder thirty days before quota expires. Second, set fallback rules for peak periods. For example, when the queue time for a model exceeds a defined threshold, complex tasks can be switched to a backup model, and the quality difference before and after the switch should be recorded for later evaluation. Third, for low-priority batch tasks, schedule concentrated consumption near quota expiry, but confirm before execution that the output quality of these tasks meets requirements.
For task allocation, layer by difficulty. Tasks such as text polishing and comment generation are suitable for lower-cost models. Tasks such as proof derivation and architecture design are suitable for models with stronger reasoning ability. After layering, still use the scorecard in Section 2 for periodic sampling to confirm that the model in each layer meets the expected quality.
When choosing a platform that supports multi-model routing, usage statistics, quota management, and fallback strategies, check the following capability list item by item: whether it supports per-model call limits, whether it provides token details for each call, whether it has audit logs, whether it can switch automatically on failure, and whether the billing rules are clear. This article does not recommend any specific platform. The choice should depend on budget, data compliance requirements, and the existing technology stack.
7. Stepwise Prompt Template
Stepwise prompts can break a complex proof into shorter reasoning segments, which makes it easier to check the justification for each step. The following template can be modified directly.
Step 1: List the theorem.
“You are a math assistant. The proposition is: {proposition}. List only the known theorems and definitions that may be used in the proof. For each one, note its name and applicable conditions. Do not start the proof yet.”
Step 2: Build the skeleton.
“Based on the theorems listed in the previous step, break the proof into several sub-conclusions. For each sub-conclusion, state the premises it depends on and the theorem used.”
Step 3: Fill in step by step.
“For each sub-conclusion in the skeleton, write a complete derivation and cite the justification for each step. Do not skip steps. If the justification is insufficient, state that explicitly; do not add unstated assumptions.”
Step 4: Self-check.
“Check each item one by one: whether all assumptions are used; whether there is circular reasoning; whether the applicable conditions of each theorem are met; whether the conclusion matches the original proposition. Output the check results. If problems are found, correct them before outputting the final proof.”
Step 5: Typeset.
“Convert the final proof to LaTeX using theorem, lemma, and proof environments. Do not add unverified references.”
Stepwise prompts can often shorten the length of a single reasoning pass and reduce skipped steps. However, this conclusion must be verified with the scorecard. Teams should compare direct prompting and stepwise prompting on the same test set, record accuracy and token consumption, and then decide which approach to use.
8. Common Mistakes and Cautions
First, using placeholders or propositions without standard answers as test items, which makes it impossible to judge whether the result is correct. Second, reporting only the total score without recording the model version, call date, and prompt, which makes the result irreproducible. Third, treating quota percentage as a complexity metric and ignoring the effects of input length, retries, and caching. Fourth, accepting literature citations from the model without checking the sources; the model may fabricate papers that do not exist. Fifth, when an article or evaluation conclusion is funded by a third party, failing to disclose this relationship at the beginning. Sixth, failing to set expiry reminders for prepaid quota, causing the quota to expire without anyone noticing.
9. Conclusion
Evaluating the mathematical reasoning ability of large language models requires looking at five dimensions together: proof correctness, open problem solving, chain-of-thought conciseness, academic standard output, and cost and latency. Tests must use verifiable items, run multiple times, and record complete information. When selecting a model, combine the scorecard results with the cost formula, and then allocate models by task difficulty. Following this process, teams can find a model that fits their tasks within a limited budget and continuously monitor changes in quality.
