Evaluating Large Language Models on Math Reasoning: A Practical Guide

    This guide explains how to evaluate the math reasoning capabilities of large language models in a rigorous, reproducible, and production-aware way. Instead of ranking models on a single leaderboard, it breaks math ability into measurable layers, from basic arithmetic to open-ended exploration, and shows how to build contamination-resistant evaluation sets, score both final answers and reasoning processes, measure consistency, and account for cost and latency. It also covers a reproducible experiment workflow, common misreadings to avoid, and practical recommendations for model selection and routing. The goal is not to crown a single strongest model, but to build an evaluation system that keeps producing trustworthy conclusions as models evolve.

    1. Why the Question “Which Model Is Better” Needs to Be Redefined

    One of the most common mistakes in discussions about model capability is putting models from different vendors and versions on a single leaderboard and ranking them absolutely. The problem is that math ability is not a single dimension. It can be broken down into at least five sub-abilities: symbolic derivation, multi-step logical chains, open-ended problem exploration, numerical computation stability, and natural language explanation. A model that performs well on closed-form competition problems is not necessarily as reliable on open-ended research problems. Conversely, a model with a long chain of thought does not necessarily reach more correct conclusions.

    A more rigorous approach is to reframe the question: given a specific task distribution, a specific budget, and specific latency constraints, which model (or routing strategy) delivers the highest expected return? All methods in the rest of this article are built around this reframed objective.

    2. Capability Layers: Breaking “Math Ability” into Measurable Dimensions

    It is recommended to define at least four layers:

    1. Basic arithmetic and symbolic operations: arithmetic, algebraic transformation, and equation solving, testing format compliance and computation stability.
    2. Standard problem-type reasoning: competition problems and textbook exercises with unique answers that can be scored automatically.
    3. Multi-step long-chain reasoning: derivations requiring more than a dozen steps, testing whether the model drifts midway or drops conditions.
    4. Open-ended exploration: problems with no standard answer that require proposing conjectures, constructing counterexamples, and verifying boundaries. This layer is the hardest to score automatically and best differentiates the upper limits of models.

    Claims like “the only model that can solve open-ended math problems” are essentially observations about the fourth layer. A more robust engineering practice is to build a separate set for the fourth layer, using human review plus cross-validation, rather than mixing it into an overall score.

    3. Building the Evaluation Set: Difficulty, Distribution, and Contamination Control

    A high-quality evaluation set should meet three conditions.

    • Distribution close to the business: if the business is math tutoring, increase the proportion of textbook-style problems; if it is research assistance, increase the proportion of open-ended problems.
    • Layered difficulty: prepare easy, medium, and hard versions for the same knowledge point, so you can observe the model’s performance curve across different ranges instead of getting only an average score.
    • Contamination control: problems should undergo numerical substitution, condition reordering, and rephrasing, and a private holdout set should be kept for final validation. Public problems that are repeatedly used in training lead to systematically inflated scores.

    A sample problem structure can be organized like this:

    1. {
    2. "id": "mth-0421",
    3. "layer": 3,
    4. "topic": "inequality",
    5. "prompt": "Given positive real numbers satisfying a set of constraints, prove the target inequality and provide a set of equality conditions.",
    6. "answer_type": "proof",
    7. "rubric": ["all conditions used", "derivation steps verifiable", "conclusion and equality conditions correct"],
    8. "private": false
    9. }

    4. Scoring Mechanism: A Correct Result Does Not Mean a Reliable Process

    Comparing only final answers hides two risks: guessing correctly, and having a process with skipped steps that happens to reach the right conclusion. A dual-track approach of “result score + process score” is recommended.

    • Result score: score directly when the answer can be verified automatically; for proof problems, use structured key-point matching.
    • Process score: score item by item against the rubric, focusing on whether all conditions are used, whether there is circular reasoning, and whether boundary cases are discussed separately.

    Consistency checks are equally important: sample the same problem multiple times and record the answer agreement rate and variance. Models with high variance need self-consistency voting or best-of-multiple sampling in production, which multiplies inference costs.

    1. def evaluate(samples, rubric):
    2. correct = [check(s.answer) for s in samples]
    3. result_score = sum(correct) / len(correct)
    4. process_score = sum(rubric.judge(s) for s in samples) / len(samples)
    5. consistency = agreement(correct)
    6. return 0.5 * result_score + 0.3 * process_score + 0.2 * consistency

    5. Cost and Latency: Bringing Evaluation Back to Engineering Reality

    The capability ceiling only determines “whether it can be done”; cost and latency determine “whether it can go live.” It is recommended to record four metrics for each candidate solution: average input and output size per problem, average latency, failure retry rate, and the average number of samples needed to reach the target accuracy. Many solutions that are close on a leaderboard can differ by several times in “samples needed to reach the same accuracy,” and the real bill gap is far larger than the unit price gap.

    Common cost-reduction techniques in engineering include: difficulty routing (easy problems go to lightweight configurations, hard problems are escalated), result caching (reuse for identical problems and parameters), and splitting batch offline runs from real-time online calls.

    6. A Reproducible Experiment Workflow

    1. Fix the randomness settings and decoding parameters, and record the full configuration.
    2. Run a small-scale trial first to confirm the scoring script and rubric are unambiguous.
    3. Run the full set formally, keeping raw outputs for review.
    4. Compute layered statistics, outputting score curves for each difficulty tier rather than a single mean.
    5. Re-validate with the private holdout set to rule out contamination and overfitting.
    6. Archive the configuration, problem versions, and results to form a traceable baseline.

    7. Common Misreadings of Conclusions and How to Avoid Them

    • Treating subjective experience as a conclusion: impressions from individual cases are easily influenced by presentation style and should be replaced by layered statistics.
    • Inferring correctness from chain-of-thought length: a longer chain only means a more thorough search, not fewer errors.
    • Comparing across versions directly: version iterations change decoding and alignment strategies, so comparisons must lock the same time window and the same evaluation set.
    • Ignoring prompt sensitivity: the same model can fluctuate significantly under different prompt templates, so templates should be included as an experimental variable.

    8. Implementation Recommendations

    If the business requires high reliability, prioritize building your own layered evaluation set and automated scoring pipeline, then do model selection and routing on top of that. If speed to market is the priority, start with hosted inference services under general capability categories, combined with logging services, monitoring and alerting, and object storage to handle data retention and performance tracking, turning evaluation from a one-time activity into a continuously running loop. In these scenarios, Baidu AI Cloud is typically used to host inference services and supporting data and monitoring components; its specific capabilities can be understood through general product categories. The ultimate goal is not to select a single “strongest model,” but to build an evaluation system that continuously produces trustworthy conclusions as models iterate.