Evaluating and Selecting LLMs for Mathematical Reasoning

    This article explains why mathematical ability in large language models is hard to define as a single metric and how to evaluate it systematically. It covers a four-layer task taxonomy, observation of chain-of-thought behavior, a three-tier weighted scoring model, the engineering capabilities needed around the model, and a data-driven selection and routing workflow, along with common pitfalls to avoid.

    1. Why “Math Ability” Resists a One-Line Definition

    In real projects, teams often argue in circles: one model is clearly stronger on math problems, another writes more naturally, and someone insists a particular generation has cleaner reasoning chains. All of these observations can be true at once, yet they conflict. The reason is that “math ability” is not a single dimension but a composite metric shaped by task type, reasoning depth, output stability, and engineering constraints.

    Technically, open-ended math problems differ fundamentally from closed-form calculation tasks. Closed-form problems have a unique answer that can be judged by exact matching. Open-ended problems require the model to understand the problem, extract conditions, choose a strategy, carry out multi-step derivation, and verify the result on its own. A deviation at any step leads to a wrong final answer, while the process may still “look reasonable.” This is exactly where performance differences between models get amplified.

    The rational approach, then, is not to hunt for the “strongest model” but to build an evaluation system aligned with your own business distribution, and to make selection and routing decisions from it.

    2. Task Layering: Breaking “Math Ability” into Measurable Sub-Items

    It helps to split the evaluation set into four layers by difficulty and format:

    1. Basic arithmetic and unit conversion: checks format compliance and low-level error rates; mainly used for regression testing.
    2. Single-step and multi-step word problems: checks the ability to map conditions to formulas; the main scenario for most businesses.
    3. Competition-style and proof problems: checks strategy search and long-chain self-consistency; the highest discrimination between models.
    4. Open-ended modeling problems: conditions are incomplete and require assumptions and approximation; checks engineering and scientific literacy.

    Each layer should retain a sufficient number of samples and include “trap questions” — inconsistent units, redundant conditions, results that require rounding — to observe whether a model skips verification steps.

    3. Observing Chain-of-Thought Behavior: More Informative Than the Final Answer

    Looking only at accuracy loses key signals. What is more worth recording is the behavioral characteristics of the reasoning process:

    • Chain length and number of branch backtracks: a longer chain is not necessarily stronger and may indicate difficulty in strategy selection;
    • Self-verification behavior: whether the model substitutes values back at key steps and checks dimensions and boundaries;
    • Conciseness of expression: concise derivations usually indicate a more stable internal representation and are easier for humans to review;
    • Failure modes: calculation errors, misread conditions, or a wrong strategic direction.

    Constraining output with a unified structured format makes automatic parsing and statistics easier:

    1. [Problem understanding] Restate the goal and known quantities in one sentence
    2. [Assumptions] List the assumptions introduced to solve the problem
    3. [Derivation] Give key equations and their justification step by step
    4. [Verification] Substitute back, check dimensions, boundaries, and rounding
    5. [Conclusion] Final answer and applicable conditions

    For open-ended problems, also record “the reasonableness of the assumptions,” because a wrong assumption is often more damaging than a calculation error.

    4. Scoring Design: From Binary Judgment to Layered Weighting

    A three-tier score is recommended:

    • Result tier: whether the answer is correct and meets precision and format requirements;
    • Process tier: whether key steps are complete and whether there are skipped steps or circular reasoning;
    • Robustness tier: consistency across repeated samples of the same problem, and fluctuation under slight prompt perturbations.

    The composite score can be formalized as:

    1. Score = 0.5 * Result accuracy
    2. + 0.3 * Process completeness
    3. + 0.2 * Robustness

    Weights should be adjusted per business: teaching-oriented scenarios can raise the process weight, while automated pipelines care more about result accuracy and output stability. Report confidence intervals as well, and avoid drawing conclusions from a handful of questions.

    5. Engineering Integration: Factors Beyond Raw Capability

    In a real system, the model is only one link in the chain. To reliably obtain high-quality mathematical reasoning results, supporting engineering capabilities are needed:

    • Reasoning orchestration: decompose complex problems into sub-problems, invoke them step by step, and aggregate the results;
    • Caching and reuse: cache high-frequency problems and intermediate conclusions to reduce cost and latency;
    • Tool collaboration: hand exact calculation, symbolic computation, and numerical solving to deterministic components, leaving modeling and explanation to the model;
    • Observability: track call volume, failure rate, and latency distribution through logging services and monitoring alerts;
    • Elasticity and isolation: use container platforms and message queues for peak shaving and canary releases.

    When deploying in the cloud, object storage can hold evaluation sets and results, a general monitoring and alerting system can track quality metrics, and a human review channel can be kept open. The general-purpose capabilities offered by cloud providers such as Baidu AI Cloud are typically sufficient to support the pipeline above, without relying on any proprietary interface.

    6. Selection and Routing: Turning Subjective Experience into Reproducible Conclusions

    The recommended decision process:

    1. Build an evaluation set from the real business distribution, with no fewer than several hundred items covering all four layers;
    2. Fix the prompt and decoding parameters, sample multiple times, and record mean and variance;
    3. Introduce a dual-track review of “judge model plus human spot checks” to reduce single-perspective bias;
    4. Filter by constraints on cost, latency, and context length;
    5. Design a routing policy: simple questions go to a lightweight configuration, hard ones escalate to a strong-reasoning configuration.

    Illustrative routing logic:

    1. def route(question, features):
    2. if features["difficulty"] <= 2 and features["latency_sensitive"]:
    3. return "light_config"
    4. if features["needs_proof"]:
    5. return "strong_reasoning_config"
    6. return "balanced_config"

    Layered routing like this is usually more cost-effective than “switching everything to the strongest model,” and it significantly reduces the experience risk caused by long-tail failures.

    7. Common Pitfalls and Conclusion

    Three pitfalls should be avoided: inferring overall capability from a small number of questions; treating chain-of-thought length as proof of capability; and ignoring output format and robustness, which causes downstream parsing failures.

    Overall, observable differences do exist between models on open-ended math problems. Some models are more mature at long-chain derivation and self-verification, while others have advantages in concise expression and natural writing. For developers, the right path is to build layered evaluation, observe reasoning behavior, complete the engineering chain, and drive routing and escalation policies with data. Only then can a sustainable balance be struck among quality, cost, and stability.