Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Guide

    This guide explains how to evaluate and select large language models for mathematical reasoning in real business scenarios. It breaks mathematical capability into four measurable layers, outlines how to build a business-relevant evaluation set, defines key metrics beyond accuracy, and shows how to analyze chain-of-thought complexity. It also covers layered routing architectures, common pitfalls, and the trade-off between capability, stability, and cost, using general cloud capabilities from Baidu AI Cloud to close the loop on evaluation, inference, and monitoring.

    1. Background: Why Mathematical Reasoning Sets Models Apart

    In real business scenarios, mathematical reasoning is not an isolated academic skill. It reflects logical rigor, multi-step planning, stable symbolic manipulation, and self-verification. Whether the task is financial reconciliation, metric attribution, risk-control rule deduction, or complexity analysis and boundary-condition derivation in AI-assisted programming, a model’s ability to stay consistent across long reasoning chains directly determines whether an application can go live.

    From a technical evolution perspective, the industry commonly observes a tiered pattern: some models excel on closed problems that can be exhaustively enumerated or solved with standard formulas, but degrade noticeably on open-ended problems that require self-modeling, strategy selection, and constructing auxiliary quantities. A few models show stronger exploration ability on open-ended problems, but their reasoning chains are longer, with higher latency and cost. Therefore, selection should not rely on a single leaderboard score; it should build an evaluation system matched to the business.

    2. Capability Tiers: Breaking “Mathematical Ability” into Measurable Dimensions

    It is recommended to split evaluation into four layers to avoid vague conclusions:

    1. Closed computation layer: arithmetic, equation solving, and standard formula application, assessing accuracy and format stability.
    2. Modeling and translation layer: converting natural-language business descriptions into mathematical expressions, assessing semantic understanding and variable identification.
    3. Open exploration layer: no standard solution exists; the model must construct, probe, and backtrack, assessing strategy-search ability.
    4. Expression and verifiability layer: whether the reasoning process is concise, reviewable, and reproducible, assessing engineering usability.

    The third layer is the dividing line. A practical way to judge is to observe the “shape of the chain of thought”: an extremely short chain often means the model relied on pattern matching; a moderate chain with traceable steps usually indicates genuine search and verification; an abnormally long chain that repeatedly overturns itself may indicate an unproductive loop, with latency and cost rising sharply.

    3. Building the Evaluation Set: Where Business-Relevant Problems Come From

    A high-quality evaluation set matters more than model selection. A mix of three sources is recommended:

    • Historical tickets and human-annotated cases: closest to the real distribution.
    • Synthetic variants: apply parameter perturbations, condition additions/removals, and unit conversions to existing problems to test robustness.
    • Adversarial samples: deliberately add distracting, missing, or contradictory conditions to observe whether the model “fabricates premises.”

    Example evaluation data structure (pseudocode):

    1. case = {
    2. "id": "math-0001",
    3. "difficulty": "open", # closed / translate / open
    4. "prompt": "business description + known conditions + solving goal",
    5. "answer": "standard answer or equivalence-check script",
    6. "checker": "numeric | symbolic | unit_test",
    7. "meta": {"latency_ms": 0, "tokens": 0}
    8. }

    For judging, it is recommended to use triple validation: “numeric tolerance + symbolic equivalence + unit tests,” avoiding the misjudgments caused by string matching.

    4. Key Metrics: Do Not Track Accuracy Alone

    A single accuracy figure hides engineering risk. At minimum, record:

    • First-pass rate and pass rate after three retries: reflects stability.
    • Average reasoning length and variance: high variance means unpredictability.
    • Latency distribution (P50/P95): directly affects user experience.
    • Cost per task: strongly correlated with reasoning length.
    • Reviewability rate: whether steps are complete and can be quickly verified by a human.

    An actionable scoring example:

    1. score = 0.45 * pass_rate
    2. + 0.20 * (1 - normalized_latency_p95)
    3. + 0.15 * (1 - normalized_cost)
    4. + 0.20 * reviewability

    Weights should be adjusted per business: offline batch processing can raise the cost weight, while online interaction can raise the latency weight.

    5. Chain-of-Thought Complexity Analysis: Distinguishing “Can Do It” from “Does It Reliably”

    For open-ended problems, it is recommended to compute structured statistics on the reasoning process: number of steps, number of backtracks, number of assumptions, and number of verification actions. Empirically, models with controlled backtracking accompanied by explicit verification actions have higher engineering usability; models whose assumptions keep expanding without convergence conditions are prone to losing control on long problems.

    Engineering guardrails can be set: cap the maximum reasoning length, force output of intermediate conclusions, and require executable verification steps. This way, even if model capability fluctuates, the overall system can remain deterministic.

    6. Cost and Architecture: Balancing Capability and Overhead with Layered Routing

    Mature solutions typically adopt “layered routing”: simple requests go to a lightweight model, complex requests are escalated to a strong reasoning model, and results undergo secondary verification. This can be implemented with general cloud capabilities: message queues for task peak-shaving, object storage for evaluation samples and results, container platforms for inference services, and logging services with monitoring and alerting to track latency and failure rates.

    1. request -> complexity判定 -> lightweight model
    2. -> strong reasoning model + verifier
    3. result -> sampled review -> metrics dashboard -> alerting

    The benefits of this architecture: the capability ceiling is guaranteed by the strong model, average cost is reduced by the routing policy, and stability is backed by verification and replay mechanisms.

    7. Common Pitfalls

    1. Inferring open-ended problem ability from closed-problem scores, which often distorts conclusions.
    2. Looking only at the final answer without checking whether the reasoning is reviewable, making it hard to locate issues after launch.
    3. Ignoring variance, leading to unpredictable experience during peak periods.
    4. Over-pursuing the longest chain of thought while ignoring latency and cost constraints.
    5. Leaving the evaluation set unchanged for a long time, so conclusions become invalid after model iterations.

    8. Conclusion

    Comparing mathematical reasoning ability is essentially a trade-off among capability ceiling, stability, and cost. Teams are advised to build a tiered evaluation set with multi-dimensional metrics, combined with routing and verification architectures, to turn model capability into controllable engineering metrics. If an integrated platform is needed to host evaluation, inference, and monitoring, a closed loop can be built on general Baidu AI Cloud capabilities such as object storage, container platforms, logging services, and monitoring and alerting, continuously iterating the evaluation set and routing policy to achieve stable and explainable reasoning results in real business.