How to Evaluate LLM Mathematical Reasoning: A Practical Evaluation Guide

    Mathematical reasoning is not a single-dimensional capability, and evaluating it properly requires a layered test design, contamination-resistant datasets, fair sampling, and rigorous grading. This guide walks through building a robust evaluation methodology—from constructing test sets by difficulty tier and defining rubrics to combining rule-based and model-based grading, ensuring reproducible experiments, and interpreting results within the boundaries of your evidence—so you can make model selection decisions that generalize better than any public leaderboard.

    Why “Mathematical Ability” Is Hard to Pin Down in One Sentence

    In real-world model selection, one of the most common debates is whether a given model can “do math.” These debates never resolve because mathematical ability is not a single-dimensional metric. It can be decomposed into at least three layers:

    1. Closed-form problem solving: Problems with a unique, determined answer, such as competition problems, textbook exercises, or formal proofs. Grading is objective, but such problems are easily covered by training data.
    2. Open-ended exploration: Problems with no standard answer, where the solver must define the problem, construct counterexamples, and propose conjectures with verification paths. Grading relies on expert review and assesses research-oriented thinking.
    3. Presentation and readability: Whether the chain of thought is concise, whether conclusions read like human-written reasoning, and whether peers can quickly verify them.

    Evaluating only the first layer yields conclusions like “tops the leaderboard but collapses on any new problem.” Evaluating only the third layer risks mistaking stylistic preference for capability differences. A rigorous evaluation must be designed in layers, with the applicable scope of each layer’s conclusions clearly stated.

    Building the Evaluation Set: Difficulty, Coverage, and Contamination Control

    The quality of the evaluation set determines the credibility of the conclusions. Follow these principles:

    • Graduated difficulty: Distribute problems across four tiers—“routine calculation, multi-step reasoning, constructive insight required, open-ended exploration”—to avoid a ceiling effect from concentrating everything in the easy tiers.
    • Diverse sources: Mix textbook problems, competition problems, lemmas from research papers, and newly authored problems to reduce inflation caused by training-data contamination.
    • Reserve a private set: Keep a portion of never-published problems as a regression baseline for longitudinal comparison across model versions.
    • Answer normalization: Normalize numeric answer formats (fractions, radicals, units, significant figures); otherwise, grading noise can drown out real differences.

    An illustrative data structure:

    1. {
    2. "id": "math-0421",
    3. "tier": "open", # closed / multi_step / constructive / open
    4. "prompt": "Given the constraints, determine whether the proposition holds and provide a proof or counterexample.",
    5. "reference": None, # open-ended problems have no standard answer
    6. "rubric": ["Is the definition rigorous?", "Is the counterexample verifiable?", "Is the reasoning chain reviewable?"],
    7. "tags": ["number theory", "constructive"]
    8. }

    Grading: Rules First, Model Review as Fallback

    Grading is the stage where evaluation pipelines most easily become distorted. A recommended combined strategy:

    • Closed problems: Prefer rule-based matching with symbolic-equivalence checks—for example, simplifying expressions and comparing them—rather than direct string comparison.
    • Multi-step problems: In addition to the final answer, extract and verify key intermediate quantities to detect “right answer, wrong reasoning” outputs that come from guessing.
    • Open problems: Use explicit rubric-based scoring with multiple reviewers, and report inter-rater agreement. A single reviewer’s score is not statistically meaningful.
    1. def grade(item, response):
    2. if item["tier"] == "closed":
    3. return symbolic_equivalent(extract_answer(response), item["reference"])
    4. scores = [rubric_score(item["rubric"], response) for _ in range(3)]
    5. return {"mean": mean(scores), "variance": variance(scores)}

    One important caveat: any automated grading should include manual spot checks, with a recommended sampling rate of at least 10%, and record disagreement cases for rubric iteration.

    Fairness in Sampling and Prompt Settings

    The most common mistake in comparing models is inconsistent sampling configuration. For comparability:

    • Fix temperature, maximum output length, and random seed (where supported), and use the same prompt template for every model.
    • For long chain-of-thought models, set the output length cap high enough; otherwise, truncation gets misreported as “lack of capability.”
    • Sample each problem multiple times (e.g., 5 runs) and report the pass rate and mean rather than a single-run result.
    • Also track chain-of-thought length and conciseness as auxiliary metrics. Empirically, longer reasoning chains do not necessarily translate into higher accuracy; concise, reviewable reasoning is often more valuable in production deployments.

    Reproducible Experiment Workflow and Engineering Support

    Evaluation is a data-intensive task and benefits from an engineered pipeline: write problems and results to object storage, schedule inference jobs on container platforms with batch scheduling, route inference calls through a unified gateway with rate limiting and retries, and use logging plus monitoring and alerting to track failure rates and latency distributions. Baidu AI Cloud can support this kind of scenario with its general-purpose container, storage, logging, and monitoring capabilities, without requiring any custom offerings.

    1. for item in dataset:
    2. for k in range(K):
    3. resp = call_model(item["prompt"], config=FIXED_CONFIG)
    4. record = grade(item, resp)
    5. sink.write({"id": item["id"], "tier": item["tier"],
    6. "len": len(resp), "score": record})

    Interpreting Results: Confine Conclusions to the Evidence

    The evaluation report should explicitly state its boundaries: a model leading on closed-form problems does not mean it can handle open-ended exploration; a model performing well on open problems does not mean it is faster or more efficient on routine calculations. For untested problem types, the correct statement is “not evaluated” rather than extrapolation.

    The practical recommendation for teams: first build a small private set of 100–200 problems based on your actual business problem types and run a layered evaluation; then perform weighted model selection using four metrics—pass rate, process correctness, chain-of-thought conciseness, and unit cost; after each model version update, rerun the same private set for longitudinal regression. Conclusions drawn this way will be far closer to production reality than any single public leaderboard.