Evaluating LLMs on Mathematical Proof Tasks: Methods and Best Practices

    Large language models are increasingly used for theorem proving, lemma derivation, and mathematical writing, but a fluent proof is not necessarily a correct one. This article presents a five-dimension evaluation framework covering logical correctness, completeness, verifiability, expression standards, and resource cost; a dependency-graph method for checking proof chains with Python code; a five-layer verification workflow; common pitfalls such as treating confident output as reliable; and practical recommendations for reproducible benchmarks, human sign-off, and cost management when using LLMs for mathematical proof tasks.

    Evaluating LLMs on Mathematical Proof Tasks: Methods and Best Practices

    1. Background

    In mathematical research, teaching, and engineering verification, more and more people are using large language models to assist with proposition derivation, theorem proving, and lecture note drafting. These tasks differ fundamentally from ordinary text generation. A derivation that reads smoothly is not necessarily logically valid. The core of evaluation is therefore not “does the output look right,” but “does every step withstand scrutiny.”

    When no ready-made proof exists in reference material, model output should be treated as a draft awaiting verification. It may synthesize known results correctly, or it may skip critical conditions. Judging draft quality requires clear standards and a repeatable process.

    2. Five Evaluation Dimensions

    1. Logical correctness: Is each inference step derived from premises through valid rules? Pay special attention to hand-waved jumps like “obviously” or “it follows that.”
    2. Completeness: Does the proof cover all hypotheses and conclusions of the proposition? Are edge cases addressed, such as empty sets, zero elements, or degenerate parameter values?
    3. Verifiability: Do the cited definitions, theorem numbers, and stated conclusions actually exist and match the original sources? Are the applicability conditions satisfied?
    4. Expression standards: Are symbols defined before use? Is quantifier order correct? Is the formula layout clear enough for reviewers to locate each step quickly?
    5. Resource cost: Compute resources and expense consumed per task, plus the human time required for review. Cost should be compared against the number of conclusions that pass review, not against a single output.

    3. Decomposing a Proof into a Dependency Graph

    Long proofs typically consist of several lemmas with dependency relationships between them. By explicitly annotating each lemma’s dependencies, a program can check whether an unproven conclusion is used prematurely.

    1. def check_proof_chain(steps, known=None):
    2. """
    3. steps: list of dicts {"id": str, "deps": [str, ...]}, in proof order
    4. known: set of already-established conclusions, initially empty
    5. Returns a description of the first break in the chain,
    6. or a success message if the chain is complete
    7. """
    8. known = set(known or [])
    9. for step in steps:
    10. missing = [d for d in step["deps"] if d not in known]
    11. if missing:
    12. return f"Step {step['id']} uses unproven conclusions: {missing}"
    13. known.add(step["id"])
    14. return "Dependency chain complete; all references established earlier"
    15. steps = [
    16. {"id": "L1", "deps": []},
    17. {"id": "L2", "deps": ["L1"]},
    18. {"id": "L3", "deps": ["L2", "L4"]}, # L4 has not appeared yet
    19. ]
    20. print(check_proof_chain(steps))

    This code only checks structure; it does not judge whether each lemma itself is correct. Its purpose is to quickly surface obvious chain breaks before manual review, saving reviewer time.

    4. A Multi-Layer Verification Workflow

    It is recommended to divide review into five layers, progressing from shallow to deep:

    1. Syntax layer: Check symbols, quantifiers, and variable scoping to confirm no undeclared variables are used.
    2. Logic layer: Step through the use of inference rules, focusing on inductive hypotheses, proof-by-contradiction assumptions, and the handling of existential arguments.
    3. Counterexample layer: Try to construct examples that satisfy some conditions but violate the conclusion. If the conclusion still holds after removing a hypothesis, that hypothesis may be redundant; if a counterexample works directly, the proof is wrong.
    4. Citation layer: Verify the statement and applicability conditions of each cited theorem, avoiding the application of similar but non-equivalent results to the current context.
    5. Formalization layer: Where the problem permits, use formal proof tools to verify key steps. This layer is costly and is best reserved for core lemmas rather than every detail.

    Pass/fail status should be recorded separately for each layer. If any layer fails, the entire proof should be marked as needing revision rather than accepted as a whole.

    5. Common Pitfalls

    1. Mistaking formatting for correctness. Well-structured, neatly numbered text can still contain logical errors.
    2. Treating output confidence as a reliability signal. A model sounding certain does not mean its reasoning holds.
    3. Extrapolating from easy problems to hard ones. Test sets should cover varying difficulty levels and domains.
    4. Ignoring output randomness. Generating the same problem multiple times may produce inconsistent conclusions. Sample multiple times and compare the consistency of conclusions and key steps.
    5. Judging cost by the feel of a single output. A more reasonable metric is “resources spent per conclusion that passes review,” which reflects expense, time, and rework together.

    6. Building a Reproducible Evaluation Methodology

    A reliable evaluation records enough context for others to reproduce the results:

    • Problem set: Stratified by difficulty and domain, with each problem accompanied by a standard answer or acceptable proof points.
    • Configuration records: Save the model version, invocation parameters, full prompt text, and generation date.
    • Review process: Have at least two reviewers score independently; when disagreement is significant, a third reviewer adjudicates, and the rationale is recorded.
    • Metrics: Compute the pass rate and break it down by dimension, such as logical error rate and citation error rate.

    Score aggregation can be written very simply:

    1. def pass_rate(results):
    2. # results: list where each item is True (passed human review) or False (failed)
    3. return sum(results) / len(results) if results else 0.0

    The pass rate alone does not tell the whole story. It should be reported together with the difficulty distribution of the problem set and the time spent on review, to avoid summarizing overall performance with a single number.

    7. Practical Recommendations

    1. Define task boundaries clearly. Using the model for inspiration, draft generation, literature review, and final proofs should each carry a different level of review rigor.
    2. Keep human sign-off checkpoints. Any proof entering teaching materials or formal results must be signed off by someone with the appropriate expertise.
    3. Record sources and the review process. Preserve generation records and review comments so disputes can be traced.
    4. Set cost thresholds. Establish a budget cap per task; when exceeded, split the problem into smaller sub-propositions and handle them separately.
    5. Review metrics regularly. After a model version update, re-run the same problem set, compare changes across dimensions, and then decide whether to adjust how the model is used.

    In short, the key to judging a model’s value in proof tasks is whether its output can be transformed into verified conclusions. Process, record-keeping, and human sign-off determine the reliability of the final result far more than the surface quality of any single output.