LLM Math Reasoning Evaluation and Selection: A Practical Guide

    This guide explains how to evaluate the math reasoning capabilities of general-purpose large language models in a reproducible way and use the results for model selection and system integration. It covers capability dimensions, benchmark construction, prompting and sampling strategies, automated verification loops, cost-aware routing, common pitfalls, and a practical rollout checklist. The goal is to replace subjective model rankings with measurable engineering metrics such as pass rate, variance, reasoning steps, latency, and cost.

    1. The Problem: Why “It Feels Stronger” Is Not a Selection Criterion

    In real engineering work, teams often argue about which model is better at math without being able to produce reproducible evidence. Discussions frequently rely on subjective rankings, such as grouping models into tiers and claiming that only a few can handle open-ended math problems, while others differ in chain-of-thought length and naturalness of expression. These observations are useful experience, but they blur three different things: the impression from solving a single problem, a stable pass rate, and acceptable latency and cost in production.

    This article does not repeat any specific product conclusions. Instead, it frames the issue as a general technical question: how to evaluate the math reasoning ability of general-purpose LLMs in a reproducible, layered way, and how to use the results for selection and system integration. Here, “open-ended math problems” refers to problems that have no fixed template and require multi-step construction and proof, which are fundamentally different from calculation problems that can be solved by plugging into a formula.

    2. How to Layer Capabilities Correctly

    Empirical rankings are hard to reuse because they lack dimensions. It is recommended to split evaluation along at least the following five dimensions:

    • Problem type: arithmetic and algebraic manipulation, combinatorial counting, number theory, geometric construction, probability, and problems that require writing proofs.
    • Solution path length: the number of effective reasoning steps needed to solve the problem, not the number of output tokens.
    • Self-checking ability: whether the model substitutes results back, checks boundary cases, detects contradictions, and corrects them at key steps.
    • Expression quality: whether the conclusion comes first, whether notation is standard, and whether the proof can be reviewed by a human.
    • Engineering metrics: time to first token, total latency, failure rate, and cost per task.

    Only when “strong capability” is broken down into these observable items can evaluation results feed into code and pipelines instead of staying in a discussion thread.

    3. Building a Reproducible Evaluation Set

    The quality of the evaluation set determines how trustworthy the conclusions are. The recommended process is:

    1. Stratified sampling. Build a problem pool along the dimensions above, with a fixed minimum number of items per layer, so that long-tail problems do not dominate the conclusions.
    2. Decontamination. Use self-built problems and parameterized variants to reduce inflated scores caused by memorization.
    3. Fixed judging criteria. Use exact match or symbolic equivalence for answer-based problems; use a clear rubric for proof-based problems.
    4. Multiple samples. Sample each problem independently multiple times, and record pass rate and variance rather than a single result.

    An illustrative evaluation data structure and judging skeleton:

    1. {
    2. "item_id": "geo-0421",
    3. "category": "geometry_construct",
    4. "difficulty": 3,
    5. "expected": {"answer": "x=2", "must_include": ["boundary_check"]},
    6. "judge": "symbolic_equiv_then_rubric"
    7. }
    1. def evaluate(samples, item):
    2. passes = [judge(s, item) for s in samples]
    3. return {
    4. "pass_rate": sum(passes) / len(passes),
    5. "variance": variance_of(passes),
    6. "avg_steps": mean(s.reasoning_steps for s in samples),
    7. }

    The key point is that pass_rate reflects stability and avg_steps reflects path efficiency, and both must be considered together. A model that occasionally gets the right answer but takes an extremely long path is often unusable in production.

    4. Prompting and Sampling Strategies: Pushing Capability Out

    The same model can behave very differently under different invocation methods. Engineering recommendations include:

    • Require the conclusion first, then the derivation, so that programs can extract the answer easily.
    • Enforce a self-check step, such as requiring substitution verification and checking extreme cases.
    • Provide a rubric for proof problems so the model answers point by point and misses fewer items.
    • Moderately increase the number of samples and use majority voting, replacing single-run luck with consistency.
    • Control the maximum output length to avoid long chains of thought eating into the latency budget.
    1. Please answer in the following steps:
    2. 1) Give the final answer in no more than three lines;
    3. 2) Give the key derivation steps, one step per line;
    4. 3) Self-check: verify by substitution and explain boundary cases;
    5. 4) If you find a contradiction, point it out and correct it.

    5. The Verification Loop: Let the System Find Its Own Errors

    Math scenarios are naturally suited to automated verification, which is an advantage over other tasks. Three types of methods can be combined: symbolic computation for equivalence checks; numerical sampling for counterexample search; and a rule engine to check domains, dimensions, and boundary conditions. In engineering, these three can be chained into a loop: model output first goes to the verifier, and if it fails, the model retries with the error information attached. The number of retries and thresholds are determined by the cost budget.

    1. for attempt in range(max_retry):
    2. out = model.generate(prompt, temperature=0.7)
    3. ok, reason = verifier.check(out, item)
    4. if ok:
    5. return out
    6. prompt = repair_prompt(out, reason)
    7. raise GenerationError("verification_failed")

    This “generate-verify-repair” structure is usually more cost-effective than simply switching to a stronger model.

    6. Cost and Capacity: Tiered Routing

    Problems of different difficulty should not go through the same pipeline. It is recommended to build a difficulty classifier that sends easy problems to a low-latency configuration and open-ended problems to a high-reasoning configuration, with quotas and caching for high-cost calls. The cache key should include the problem fingerprint and the prompt version to avoid hitting stale data after a prompt change. If cloud-based general capabilities are used, container platforms can host verification services, message queues can smooth out traffic spikes, object storage can store evaluation samples, and logging and monitoring with alerts can track fluctuations in pass rate and latency; the relevant general product categories from Baidu AI Cloud can serve as a reference pattern for building capacity and observability.

    7. Common Pitfalls

    • Looking only at a single demo and ignoring variance.
    • Using output length to measure reasoning depth.
    • An evaluation set that does not match the business distribution, causing a gap in the live experience.
    • Lacking automated verification and treating manual spot checks as quality assurance.
    • Comparing only models without optimizing prompts and sampling, wasting low-cost gains.

    8. Rollout Checklist

    1. Build a layered evaluation set and fix the judging criteria.
    2. Sample multiple times per evaluation, and record pass rate, variance, steps, latency, and cost.
    3. Put the generate-verify-repair loop into production.
    4. Implement difficulty routing and caching.
    5. Use monitoring and alerts to continuously track metric drift, and re-evaluate quarterly.

    Following this path, teams can turn the argument about “who is stronger” into engineering metrics that can be continuously optimized, achieving math reasoning capability that is stable, auditable, and scalable in real business settings.