How to Rigorously Evaluate the Mathematical Reasoning Ability of Large Language Models
This article presents a practical framework for evaluating the mathematical reasoning capabilities of large language models. It covers how to categorize math tasks (computation, proof, and open problems), how to audit proofs step by step, how to control common evaluation biases such as output length bias and training data contamination, how to build a reproducible evaluation pipeline, and which resource and cost metrics to track. The goal is to help engineers and researchers run fair, verifiable, and repeatable benchmarks for both horizontal model comparisons and longitudinal tracking of a single model.
Introduction
The mathematical performance of large language models (LLMs) is drawing increasing attention. Engineers, researchers, and math enthusiasts keep asking the same question: can a model independently complete non-trivial mathematical derivations? The question sounds simple, but evaluating it in practice involves task selection, result verification, process auditing, and cost accounting. This article outlines a general evaluation methodology that works for both horizontal comparisons across models and longitudinal tracking of a single model over time.
1. Start by Distinguishing Task Types
Math tasks fall roughly into three categories.
- Computation tasks: The answer is uniquely determined, such as evaluating an integral or solving a system of equations. Results are easy to check automatically, making these tasks well suited for large-scale benchmarking.
- Proof tasks: The model must produce a complete logical derivation. Judging correctness requires human review or formal verification tools, which is expensive.
- Open-problem tasks: There is no known standard answer. The model must propose an approach or construction, and whether the conclusion holds depends on subsequent rigorous verification.
Before evaluating, be clear about which category you are testing. Mixing all three into a single score usually produces conclusions with little practical meaning.
2. How to Audit Proofs
Proofs are the task type most prone to creating the illusion of “looking correct.” The following review steps are recommended.
- Step-by-step verification: Check whether each step follows directly from prior conditions or previously established results.
- Dependency checking: List every theorem and lemma the proof cites, and confirm that their statements and applicability conditions match the original sources. Cited conditions are often quietly weakened or omitted.
- Boundary testing: Construct degenerate cases—such as the empty set, zero-dimensional objects, or trivial parameters—and check whether the proof still holds.
- Counterexample search: If the conclusion might be false, models sometimes swap concepts at critical steps. Actively hunting for counterexamples exposes this kind of problem.
- Citation verification: Theorem numbers or bibliography entries given by the model may not exist at all and must be checked one by one.
Below is a sketch of the auditing workflow in code:
def audit_proof(steps, known_results):report = []for i, step in enumerate(steps):missing = [d for d in step["cites"] if d not in known_results]if missing:report.append((i, "unverified dependency", missing))elif not step["follows_from"]:report.append((i, "logical gap", step["text"]))return report
This code only demonstrates how to organize the checks. Whether a dependency actually holds still requires human judgment—code cannot replace that step.
3. Common Evaluation Biases
Several types of bias need to be actively controlled during evaluation.
- Output length bias: Long, well-formatted answers easily give an impression of reliability, but length has no necessary correlation with correctness.
- Intermediate reasoning bias: A longer internal reasoning trace does not imply a more reliable conclusion. The criterion should be whether the final proof passes verification.
- Training data contamination: If the problems or their proofs already appear in public materials, the model may be reciting rather than deriving. Prefer unpublished or rewritten problems for testing, and record the source of each problem.
- Prompt sensitivity: Rephrasing the same problem can produce very different results. Use fixed templates and sample multiple times per problem, then aggregate the statistics.
- Insufficient sample size: One or two problems cannot support any conclusion. Prepare at least dozens of problems per task category.
- Subjective impressions: A confident tone and human-like writing style are not reliable indicators of mathematical ability.
4. Building a Reproducible Evaluation Pipeline
A reliable evaluation pipeline typically consists of five steps: define the problem set, fix the prompts, run batch sampling, grade with a combination of automated and manual review, and archive the results.
Here is an example configuration:
benchmark:name: proof_eval_v1task_types: [computation, proof, open_problem]samples_per_item: 5temperature: fixed_and_documentedgrading:auto: [computation]manual_review: [proof, open_problem]record:- model_version- prompt_hash- token_usage- wall_clock_latency
When archiving, save the model version, prompts, raw outputs, and grading results. Without this information, the experiment cannot be reproduced later or compared against other results.
5. Resource and Cost Metrics
Evaluation should not stop at accuracy—resource consumption must also be recorded. Commonly used metrics include:
- Average input and output token counts per problem.
- Output throughput, i.e., tokens generated per second. When measuring, specify the concurrency level and load conditions.
- End-to-end latency, including queuing and network transfer time.
- Average cost per verified proof, calculated as total spending divided by the number of proofs that pass verification.
Throughput figures should be based on your own measurements. Deployment environment, batch size, and hardware differences all significantly affect results, so numbers measured by others under different conditions should not be applied directly.
6. Conclusion and Recommendations
Evaluating mathematical reasoning ability comes down to four essentials: clear task categorization, rigorous verification methods, controlled biases, and reproducible results. For proof and open-problem tasks, human review remains irreplaceable for now.
Readers can follow this framework to build a small problem set of their own: start with medium-difficulty problems to get the pipeline running, confirm that the grading criteria are stable, and then gradually expand to harder problems.
