Evaluating LLM Mathematical Reasoning: Methods, Metrics, and Practices

    Evaluating the mathematical reasoning capabilities of Large Language Models (LLMs) requires rigorous methodologies to avoid misleading metrics. This article explores why direct comparisons of math scores are often unreliable and outlines a comprehensive framework for accurate evaluation. It covers defining evaluation goals, constructing benchmark datasets, designing robust scoring rules for both calculation and proof problems, controlling variables through repeated measurements, and reporting results with failure analysis. By following these best practices, teams can achieve reproducible evaluations for effective model selection and business validation.

    1. Why Mathematical Capabilities Are Difficult to Compare Directly

    When evaluating the same set of math problems, changing the dataset, scoring rules, or prompt can result in vastly different scores. There are three primary reasons for this:

    First, the questions may have already appeared in the model’s training data, meaning the score reflects memorization rather than reasoning. Second, the format of the answers is rarely uniform; the same result can be written as a fraction, decimal, or radical, leading to false negatives with direct string matching. Third, the results are highly sensitive to whether the model is allowed to use computational tools, how many reasoning steps are permitted, and the sampling temperature. Therefore, whenever you see a ranking score, the first question to ask is under what conditions that score was obtained.

    2. Define Evaluation Goals First

    Before starting the evaluation, you must answer three questions:

    1. What type of mathematical ability is being evaluated? Basic calculation, competition-level problem solving, theorem proving, or open-ended research questions?
    2. What is the application scenario? Tutoring, research assistance, or automated grading? Different scenarios focus on different types of errors.
    3. What external conditions are allowed? Is internet search, code execution, or an external calculator permitted? These conditions must be explicitly documented in the evaluation report.

    Without clear goals, no score can be properly interpreted.

    3. Construct the Evaluation Benchmark

    The quality of the evaluation set determines the upper limit of your conclusions. It is recommended to design it as follows:

    • Source: Mix public datasets, textbook exercises, and internal original questions. Public datasets are prone to leakage, so you should include newly published questions (released after the model’s training cutoff date) for isolated testing.
    • Difficulty Tiering: Categorize questions into basic, advanced, and competition levels based on the number of solving steps and knowledge points involved. Try to keep the sample sizes balanced across tiers.
    • Question Type Coverage: Ensure a certain proportion of calculation, proof, and modeling questions. Proof questions should be scored separately, as their scoring method differs from calculation questions.
    • Deduplication: Perform near-deduplication on the problem descriptions to prevent variants of the same question from being scored multiple times.

    Below is a tiering illustration:

    Level Question Characteristics Suggested Sample Size Main Error Types
    Basic Single knowledge point, few steps 200 Calculation errors
    Advanced Multiple connected knowledge points 150 Missing conditions
    Competition Requires construction or clever transformations 100 Reasoning skips, incorrect conclusions

    4. Design Scoring Rules

    1. Final Answer Comparison

    Direct string matching will produce many misjudgments. Normalization is required first: unify fraction simplification, remove units, and standardize symbols and parentheses. An example is shown below:

    1. def normalize(ans):
    2. ans = ans.strip().replace(" ", "")
    3. ans = ans.replace("×", "*").replace("−", "-")
    4. return canonical_form(ans)
    5. def score_final(pred, gold):
    6. return 1 if normalize(pred) == normalize(gold) else 0

    Here, canonical_form needs to perform algebraic simplification on the expression. Otherwise, “2/4” and “1/2” would be judged as different answers.

    2. Process Scoring

    For questions requiring multi-step derivation, the solution can be broken down into several key steps to determine if each step is correct. Process scoring can distinguish cases where “the answer happens to be correct but the reasoning is flawed,” which is impossible when only looking at the final answer.

    3. Proof Scoring

    Proof questions do not have a uniform string answer. It is recommended that two or more reviewers independently score them according to a pre-written rubric, and inter-rater reliability (such as Cohen’s kappa coefficient) should be calculated. Samples with significant disagreements should be adjudicated by a third reviewer.

    5. Control Variables and Repeat Measurements

    Single-run results are unreliable. The following practices are recommended:

    • Fix decoding parameters, and explicitly state the temperature, maximum output length, and system prompt in the report.
    • Run each question K times (e.g., 5 times), and record the mean accuracy and standard deviation.
    • Save the complete inputs, outputs, and version information for post-hoc review.

    The pseudocode is as follows:

    1. results = []
    2. for item in benchmark:
    3. runs = [evaluate(model, item.prompt, seed=s) for s in range(K)]
    4. acc = mean([score(r, item.answer) for r in runs])
    5. results.append((item.id, acc))
    6. overall = mean([a for _, a in results])
    7. ci = bootstrap_ci([a for _, a in results])

    When reporting, provide the confidence interval of the overall accuracy rather than just a point estimate. If the gap between two models falls within the confidence interval, you cannot assert that one is definitively stronger than the other.

    6. Common Pitfalls in Horizontal Comparison

    • Comparing with different budgets: The longer the reasoning chain, the more computational resources are consumed. When comparing, you should also report cost metrics such as latency and token usage.
    • Looking only at a single ranking: The ranking may reverse across different difficulty tiers; results should be reported by tier.
    • Relying on secondhand information: Screenshots, hearsay, and conclusions with undisclosed details are difficult to reproduce and can only serve as leads, not evidence.
    • Substituting personal experience for measurement: Impressions from personal use can generate hypotheses, but they require a benchmark to validate.

    7. How to Write an Evaluation Report

    A credible evaluation report should contain at least the following: a description and source of the evaluation set, scoring rules, run parameters, sample size, accuracy and confidence intervals, and a classification of failure cases.

    The classification of failure cases is particularly important. By categorizing errors into calculation errors, missing conditions, reasoning skips, and incorrect conclusions, readers can see where the model falls short and determine whether it is suitable for their specific scenario.

    8. Implementation Checklist

    • Evaluation goals and allowed external conditions are documented.
    • The evaluation set has been deduplicated and checked for leakage.
    • Scoring rules include normalization steps, and proof questions have a scoring rubric.
    • Each question is run multiple times, and results include standard deviation or confidence intervals.
    • The report includes failure case classification and runtime environment information.

    By following this workflow, teams can achieve reproducible conclusions at a low cost and apply them to model selection and business validation.