How to Evaluate Mathematical Reasoning in Large Language Models: Methods and Practice
This guide explains how to evaluate the mathematical reasoning of large language models in a systematic way. It covers the core evaluation dimensions, how to build a stratified benchmark with decontaminated and annotated problems, how to assess reasoning steps, how to combine automatic grading with expert review, a minimal evaluation pipeline, common mistakes in interpreting results, and recommended reporting practices.
1. Why Systematic Evaluation Is Needed
The performance of large language models on math tasks varies widely. A model may be very stable on basic arithmetic but fluctuate noticeably on problems that require multi-step derivations, counterexample construction, or complete proofs. Drawing conclusions from a few problems or personal impressions is prone to bias from problem selection, prompt wording, and chance. Evaluation therefore needs clear dimensions, a reproducible process, and traceable scoring criteria.
2. Core Evaluation Dimensions
- Computational accuracy: Tests basic skills such as integer arithmetic, algebraic simplification, and numerical calculation. These problems have a unique answer and can usually be graded automatically.
- Logical reasoning: Checks whether each step is justified and whether intermediate conclusions support the final conclusion.
- Proof completeness: For proof problems, checks whether all cases are covered and whether any unstated assumptions are present.
- Open-ended problem solving: For problems without standard answers, assesses the model’s ability to propose an approach, test it, and revise it.
- Stability: Samples the same problem multiple times and observes the consistency of answers and the distribution of accuracy. A single correct answer does not show that the ability is stable.
3. Building the Benchmark
The benchmark is the foundation of the whole evaluation. Its quality directly determines how much the results can be trusted.
- Stratification: Divide problems into four difficulty levels: basic, intermediate, competition-level, and research-level. Keep enough problems at each level to compare performance across difficulty.
- Decontamination: Check whether problems already appear in public corpora. Models that were trained on a problem will overestimate their ability on it, so new or adapted problems should be preferred.
- Annotation: For each problem, record the reference answer, the key solution steps, and common error types. This makes it easier to analyze why a model fails.
- Size: Each difficulty level should contain at least several dozen problems. With too few samples, results are easily affected by chance.
4. Evaluating the Reasoning Process
The final answer only shows the result. It does not reflect the quality of the reasoning. The length of a derivation also cannot be equated with ability. A long derivation may contain many wasted attempts, while a short one may skip key steps. When evaluating the reasoning process, focus on the following points:
- Whether each step can be verified independently;
- Whether there are internal contradictions;
- Whether key turning points are clearly explained;
- Whether the final conclusion is consistent with the preceding derivation.
For problems that can be formalized, symbolic computation tools or formal proof checkers can verify intermediate steps by machine. This reduces the amount of manual judgment required.
5. Combining Automatic Grading with Human Review
Automatic grading suits problems with a unique answer. It is efficient and reproducible. Proof and open-ended problems require expert review. Two reviewers should score independently, and the consistency of their scores should be calculated. Problems with large disagreements should be sent to a third reviewer for adjudication. A review form can score correctness, completeness, rigor, and clarity of expression separately, so that a single total score does not hide specific problems.
6. Example: A Minimal Evaluation Pipeline
def run_eval(model_fn, dataset, samples=3):results = []for item in dataset:answers = []for _ in range(samples):output = model_fn(item["question"])answers.append(extract_final_answer(output))correct = sum(a == item["answer"] for a in answers)results.append({"id": item["id"],"level": item["level"],"accuracy": correct / samples,})return results
This code shows the basic idea. It samples each problem multiple times, calculates the accuracy for each problem, and then aggregates the results by difficulty level. extract_final_answer must be implemented according to the actual output format. Numeric answers can be normalized before comparison. Proof problems should be handled by the human review process and should not be compared as plain strings.
7. Common Mistakes in Interpreting Results
- Treating a single ranking as a complete conclusion. Rankings can differ entirely across problem types and difficulty levels, so results should be reported separately for each.
- Drawing conclusions from too few samples. Accuracy on a small set of problems has a large margin of error. Report the sample size along with a confidence interval.
- Favoring long derivations or fluent writing. Fluent expression does not mean correct reasoning. Reviewers should judge answers by whether the logic holds.
- Ignoring evaluation conditions. Prompts, sampling parameters, and whether external tools are allowed all affect results. Report these conditions together with the results.
8. Practical Recommendations
When building an internal evaluation baseline, first fix the problem set and the scoring criteria. Then compare different versions or approaches. Save the raw output of every evaluation run to support later review and error analysis. When reporting results internally or externally, give specific accuracy rates, sample sizes, and scoring consistency, rather than general descriptions such as “strong” or “weak.”
