Evaluating the Mathematical Reasoning Capabilities of Large Language Models: Methods and Practices
Evaluating the mathematical reasoning capabilities of large language models requires rigorous methodologies to ensure objectivity and reproducibility. This article explores how to systematically assess LLM math performance across multiple dimensions, from building stratified evaluation datasets and selecting appropriate scoring methods to analyzing reasoning processes and designing controlled comparative experiments. It also provides practical guidance on interpreting evaluation results and constructing internal benchmarks for model selection and regression testing.
1. Why Mathematical Capability is Often Evaluated Separately
Answers to mathematical problems are usually objectively verifiable, and the reasoning process must be logically rigorous. Therefore, mathematics serves as a common window into a model’s logical capabilities. Unlike open-ended writing, math problems can be checked against standard answers, making evaluation conclusions easier to reproduce.
Furthermore, mathematical capability is not a single metric. The same model may perform very differently on basic arithmetic, competition-level problems, and open research questions with no universally accepted conclusions. Evaluation requires separating these levels.
2. Define Evaluation Dimensions First
It is recommended to cover at least four dimensions:
- Result Accuracy: Whether the final answer matches the reference answer.
- Reasoning Process Correctness: Whether there are logical leaps, incorrect application of conditions, or calculation errors in the intermediate steps.
- Stability: Whether the results of answering the same question multiple times are consistent.
- Expression Quality: Whether the steps are clear and whether readers can verify them step-by-step.
Looking only at the final answer risks mistaking a lucky guess for actual capability. Looking only at the length of the reasoning process risks mistaking verbosity for depth.
3. Build the Evaluation Dataset
The evaluation dataset is the foundation of credible conclusions. Common practices include:
- Stratified Sampling: Divide by difficulty into four tiers: basic calculation, medium application, competition-level, and proof-based. Keep sample sizes similar across tiers to prevent the conclusion from being dominated by one tier.
- Deduplication and Contamination Checks: If questions appear heavily in public corpora, the model’s performance may stem from memorization. Try to use proprietary or newer questions, and record their sources.
- Double-Person Verification for Standard Answers: For disputed questions, two individuals with relevant backgrounds should independently provide answers, discussing to confirm if there is a discrepancy.
- Version Control: Save question IDs, prompt templates, sampling parameters, and evaluation dates for future reproducibility.
4. Scoring Methods
Different question types suit different scoring methods.
Numeric and symbolic answers can be compared using rules, such as removing spaces and unifying fraction formats before comparison. For algebraic expressions, symbolic computation libraries can determine equivalence, preventing misjudgment due to different writing styles.
Proof-based questions are difficult to judge automatically and require manual step-by-step scoring. Reviewers can check whether assumptions are reasonable, whether each reasoning step holds, and whether the conclusion covers the question’s requirements. A simple scoring rubric—marking each step as pass or fail—can support this review.
For open-ended questions without universally accepted answers, evaluation should focus on whether the argumentation is rigorous, whether cited bases can be verified, and whether the model can identify its own uncertainties. Such questions are not suitable for measurement by a single accuracy rate.
5. Reasoning Process Analysis
The reasoning process included in the output contains important information, but length itself does not indicate quality. Analysis can focus on the following points:
- Whether the key steps are correct;
- Whether the statements are consistent throughout;
- Whether conclusions are drawn directly without supporting evidence;
- The proportion of content irrelevant to the question.
A feasible approach is to split the reasoning process into several steps, marking each as correct or incorrect, and recording the position of the first error. The later the error occurs, the stronger the model’s ability to maintain correctness during long reasoning chains.
6. Design Comparative Experiments
When comparing multiple models horizontally, controlling variables is key.
- Use the same questions, same prompts, and same output format requirements.
- Fix sampling parameters and sample multiple times per question.
- Unify the conditions for using external tools and state them in the report.
- Use confidence intervals to describe results. When the sample size is small, precise rankings should be avoided.
Below is an example of an evaluation framework. The model calling function needs to be implemented by the user, and the answer extraction rules should be adjusted based on the actual output format.
from dataclasses import dataclassfrom typing import Callable@dataclassclass EvalItem:question: strreference: str # Standard answerlevel: str # Difficulty tier: basic / applied / competition / proofdef normalize(text: str) -> str:"""Standardize answer format: remove whitespace and convert to lowercase."""return text.strip().replace(" ", "").lower()def extract_final_answer(output: str) -> str:"""Extract the final answer from the output. Assumes the answer is on the last non-empty line."""lines = [line for line in output.splitlines() if line.strip()]return lines[-1] if lines else ""def run_eval(items: list[EvalItem],call_model: Callable[[str], str],n_samples: int = 3) -> dict[str, float]:"""Sample each question multiple times and calculate average accuracy by difficulty tier."""buckets: dict[str, list[float]] = {}for item in items:hits = 0for _ in range(n_samples):output = call_model(item.question)if normalize(extract_final_answer(output)) == normalize(item.reference):hits += 1buckets.setdefault(item.level, []).append(hits / n_samples)return {level: sum(vals) / len(vals) for level, vals in buckets.items()}
7. Interpreting Evaluation Results
Once results are available, note the following:
- Report by difficulty tier; do not just give an overall score;
- Report sample size and variance simultaneously;
- Distinguish between stable correct answers and occasional correct answers;
- Present process scores and result scores separately.
If the gap between two models in a specific difficulty tier is smaller than the statistical variance, the conclusion should state that their performances are close, rather than providing a ranking.
8. Application to Model Selection and Internal Evaluation
For developers and enterprise users, public leaderboards should serve only as a reference. A more reliable approach is to build a small-scale evaluation dataset around your own business needs. Extract typical mathematical or computational problems from real-world scenarios, run them regularly following the above process, and record changes across model versions. The conclusions drawn this way directly correspond to business requirements and facilitate quick regression testing after model updates.
