Evaluating LLMs for Mathematical Proofs: A Scientific Approach to Capabilities and Costs

    Evaluating large language models (LLMs) on mathematical proofs requires a dedicated framework distinct from general benchmarks. This article explores how to assess LLMs across five key dimensions: logical correctness, completeness, verifiability, citation reliability, and resource consumption. It covers test dataset design, preventing data contamination, establishing an evaluation workflow with code examples, avoiding common comparison pitfalls, and calculating effective costs and throughput. By following this structured approach, developers and researchers can make informed decisions on model selection and deployment.

    1. Why Mathematical Proofs Require Dedicated Evaluation

    Mathematical proofs are among the most demanding tasks for evaluating a large language model’s reasoning capabilities. Unlike standard Q&A, a proof requires every step to be justified; a single error invalidates the entire conclusion. Therefore, a model scoring high on general benchmarks may not necessarily perform well in rigorous proof tasks.

    Proof tasks also have two unique characteristics. First, the answer is typically a complete derivation process rather than a single verifiable number, making automated scoring difficult. Second, a single proposition may have multiple valid proof paths, meaning evaluation cannot solely rely on the final conclusion. These factors dictate that evaluation must simultaneously consider the conclusion, the process, and the presentation.

    For developers and researchers, evaluation generally serves three purposes: determining if the model can assist with derivation, deciding where to introduce human review, and estimating the resource consumption per task. Each purpose corresponds to different metrics, which must be clearly defined before designing the workflow.

    2. Breaking Down the Evaluation Dimensions

    A usable evaluation framework should cover at least the following five dimensions.

    1. Logical Correctness: Whether each step of the reasoning is valid and whether non-existent theorems or incorrect premises are cited. This is the core dimension, usually requiring manual step-by-step checks or comparison against expert-provided standard answers.

    2. Completeness: Whether the proof covers all cases. Many errors do not stem from a broken reasoning chain but from missing boundary conditions or special cases, such as omitting a branch, ignoring zero elements, or empty sets.

    3. Verifiability: Whether a reader can independently reproduce the conclusion following the text. Even if a proof’s conclusion is correct, skipping too many “obvious” steps will increase the review cost.

    4. Citation Reliability: Whether the definitions, theorem numbers, and sources cited by the model actually exist. Fabricated citations are a common issue and should be tracked separately.

    5. Resource Consumption: The number of input and output tokens, time, and cost consumed to complete a task. For tasks requiring multiple attempts, the average cost per correct result must also be calculated.

    These five dimensions cannot be merged into a single total score. For instance, one model might have high logical correctness but many citation errors, while another might have concise expression but frequently miss boundary cases. Merging the scores would obscure these differences.

    3. Test Dataset Design and Evaluation Workflow

    3.1 Dataset Stratification

    The dataset should be stratified by difficulty and type. A common practice is to divide it into three categories:

    • Propositions with existing standard proofs: Derived from public mathematical materials with accessible standard proofs. These are suitable for testing basic reasoning and expression skills, and the results are easy to verify.
    • Propositions requiring the combination of multiple knowledge points: The model must invoke multiple theorems, testing its knowledge integration capability.
    • Problems with unknown proof status or no public conclusions: These best reflect exploratory ability but have the highest evaluation cost. They require domain expert judgment and must be checked to ensure the conclusion is not simply regurgitated from training data and misjudged as “original.”

    Each category should record the source, difficulty annotation, and the storage location of the standard answer. Standard answers should not be included in the prompt to prevent the model from directly reciting them.

    3.2 Preventing Data Contamination

    If a problem or its standard proof already exists on public web pages, the model might be reciting training data rather than genuinely deriving it. Methods to mitigate this include:

    1. Equivalently rewriting the problem (e.g., changing variable names or adjusting the order of the proposition’s expression while keeping the mathematical meaning intact).
    2. Using new problems published after the model’s training cutoff date.
    3. Saving the problem’s hash value and source information in the evaluation records for future auditing.

    3.3 Evaluation Workflow Example

    Below is a general schematic code for the evaluation workflow to uniformly record the results of each call. The code only describes the process structure and does not depend on any specific platform.

    1. from dataclasses import dataclass, field
    2. @dataclass
    3. class EvalRecord:
    4. problem_id: str
    5. model_name: str # Model identifier, filled by the user
    6. proof_text: str # The complete proof output by the model
    7. correct: bool | None # Human judgment result, None if not judged
    8. gap_count: int = 0 # Number of logical gaps found
    9. bad_refs: int = 0 # Number of citation errors
    10. input_tokens: int = 0
    11. output_tokens: int = 0
    12. latency_s: float = 0.0
    13. notes: list[str] = field(default_factory=list)
    14. def summarize(records: list[EvalRecord]) -> dict:
    15. judged = [r for r in records if r.correct is not None]
    16. n = len(judged)
    17. if n == 0:
    18. return {"judged": 0}
    19. return {
    20. "judged": n,
    21. "accuracy": sum(r.correct for r in judged) / n,
    22. "avg_gaps": sum(r.gap_count for r in judged) / n,
    23. "avg_bad_refs": sum(r.bad_refs for r in judged) / n,
    24. "avg_output_tokens": sum(r.output_tokens for r in judged) / n,
    25. }

    The key to the record structure is saving the conclusion, process, citations, and resource consumption separately. During summarization, each metric is calculated individually without weighted merging.

    3.4 Blind Review and Cross-Checking

    During the review, reviewers should not know which model generated the output to prevent subjective bias. The same proof should be independently judged by at least two reviewers, and samples with significant disagreements should be arbitrated by a third reviewer. Inter-reviewer consistency can be measured by simple agreement rates or stricter statistical metrics, and the results should be reported alongside the evaluation.

    4. Common Comparison Pitfalls

    4.1 Chain-of-Thought Length Does Not Equal Capability

    A longer intermediate reasoning process may appear more rigorous, but it can also contain a lot of invalid exploration. When judging capability, look at the correctness and conciseness of the final proof, not the length of the reasoning text. A short and complete proof is usually more valuable than a lengthy one with logical leaps.

    4.2 Reasoning Budgets Must Be Consistent

    Different models or different tiers of the same model may allow different output lengths, thinking times, and retry limits. When comparing, these parameters must be fixed; otherwise, the results reflect budget differences rather than model capability differences. The evaluation report should list the budget settings item by item.

    4.3 Prompts Must Be Unified

    The wording of the prompt significantly affects proof quality. For example, asking for a “complete proof” yields very different results from asking for an “approach.” The same prompt template should be used during comparison, and the original template text should be attached to the report.

    4.4 Insufficient Sample Size in Personal Experience

    Subjective feelings based on a few questions are easily influenced by the difficulty distribution of the problems. If only five to ten problems are tested, it is difficult to distinguish the actual gap between two models. It is recommended to cover multiple problem types and sample each problem multiple times to observe stability.

    5. Calculating Costs and Throughput

    Users typically care about two types of costs: the expense per task and the waiting time for results.

    Single-task cost is determined by input tokens, output tokens, and unit price. For proof tasks, the output is often far greater than the input, making the number of output tokens the primary variable. The calculation formula is as follows:

    • Single Cost = Input Tokens × Input Unit Price + Output Tokens × Output Unit Price
    • Effective Cost = Single Cost ÷ Accuracy Rate

    Effective cost better reflects actual expenditure than single-task cost. A solution with a lower unit price but low accuracy might end up being more expensive due to the need for repeated attempts.

    Inference throughput refers to the number of tokens generated per second. Higher throughput means shorter waiting times for long proofs. Throughput is affected by hardware, batching strategies, model size, and deployment method. Since values vary greatly across different environments, the report should specify the test environment and record at least the first token latency and overall latency.

    For interactive use, first token latency affects user experience; for batch tasks, overall throughput and concurrency matter more. The optimization directions for these two scenarios are different and should not be evaluated using a single metric.

    6. From Evaluation Results to Deployment

    The ultimate goal of evaluation is to guide usage. Based on the data above, the following practices can be adopted:

    1. Tiered Usage: For proofs with strong conclusive elements and many citations, always schedule human review; for auxiliary derivation drafts, they can be used directly to inspire ideas.
    2. Establish a Regression Set: Retain problems from historical evaluations and re-run them after changing models or updating prompts to observe if metrics degrade.
    3. Record Failure Modes: Track error types, such as missing cases, circular reasoning, or fabricated citations. Failure modes guide prompt and workflow improvements better than a total score.
    4. Formalization Assistance: For mechanically verifiable parts, such as algebraic transformations or finite case calculations, symbolic computation tools or proof checkers can be used to reduce the human burden.

    7. Conclusion

    Evaluating mathematical proof capabilities hinges on examining correctness, completeness, verifiability, citation reliability, and resource consumption separately. The test dataset must be stratified and protected against contamination, reviews should be blind, and comparisons must fix the budget and prompt. Cost calculations should use effective cost, and throughput tests should specify the environment.

    Only by establishing this reproducible workflow can evaluation results be reliably used for selection and decision-making. Personal experience can serve as a clue for identifying issues but should not be directly used as a conclusion.