Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Guide

    This article presents a practical framework for evaluating and selecting large language models on mathematical reasoning tasks. Instead of relying on a single leaderboard, it breaks math capability into four measurable layers, defines four parallel metrics covering result accuracy, process accuracy, reasoning quality, and stability, and uses relative positioning against reference points for more robust comparisons. It then covers four levers for controlling inference cost, strategies for using remaining quota on high-value reusable outputs, and how to turn evaluation into a continuous, auditable engineering pipeline.

    1. The Starting Problem: Why “Which One Is Better” Is the Wrong Question

    The most common pattern in model capability discussions is to compare two models in broad terms and produce a ranking. But in engineering practice, the meaningful question is not the ranking. It is “which configuration fits best given my task distribution, my budget, and my latency constraints.” Open-ended math problems differ from routine Q&A in that the answer space cannot be enumerated, verification is expensive, and errors tend to appear in intermediate reasoning steps rather than in the final phrasing. Evaluation therefore has to be grounded in measurable terms.

    It is worth stressing that the relative strength of models drifts with task type. A model that performs well on proof problems is not necessarily as stable on numerical estimation, combinatorial construction, or applied modeling. Freezing the conclusion into a single linear leaderboard is a shortcut in evaluation methodology.

    2. Task Layering: Breaking “Math Ability” into Measurable Subitems

    A practical approach is to divide the evaluation set into four layers, scored separately rather than combined with a simple weighted sum:

    • L1 Calculation and transformation: symbolic simplification, equation solving, inequality bounding. Answers are unique and automatically checkable.
    • L2 Structured reasoning: requires composing multiple lemmas, with intermediate conclusions that can be verified locally.
    • L3 Open-ended problems: solution paths are not unique, auxiliary structures must be constructed, and no ready-made template exists.
    • L4 Modeling and exposition: converting a natural-language scenario into a formal model and providing a plausibility explanation for the conclusion.

    The value of layering is locating the weak spot. If a configuration is near-perfect on L1 but drops noticeably on L3, the bottleneck lies in search and self-verification rather than foundational knowledge. For this kind of problem, increasing the number of samples usually yields limited returns.

    3. Metric Design: Looking Only at the Final Answer Hides the Real Gap

    A single accuracy figure is strongly misleading. It is advisable to run at least four metric families in parallel:

    1. Result accuracy: expressed in an automatically decidable form, for example symbolic equivalence comparison rather than string matching.
    2. Process accuracy: local assertions on intermediate steps, locating where the error first appears.
    3. Reasoning chain quality: whether the reasoning is concise, whether there is redundant backtracking, and whether circular reasoning occurs. A longer reasoning chain does not mean stronger capability; verbosity often indicates low search efficiency.
    4. Stability: the variance across repeated runs on the same problem, and the self-consistency rate (whether conclusions agree across multiple samples).

    A sketch of the evaluation skeleton follows. The emphasis is on “layered scoring + multiple samples + local assertions”:

    1. def evaluate(case, run_model, n=5):
    2. records = []
    3. for _ in range(n):
    4. out = run_model(case.prompt)
    5. records.append({
    6. "final_ok": check_equivalent(out.answer, case.gold),
    7. "steps_ok": [check(a, out.steps[i]) for i, a in enumerate(case.asserts)],
    8. "len": len(out.steps),
    9. "self_check": out.has_verification,
    10. })
    11. first_bad = first_failing_index(records)
    12. return {
    13. "accuracy": mean(r["final_ok"] for r in records),
    14. "process_accuracy": mean(all(r["steps_ok"]) for r in records),
    15. "avg_steps": mean(r["len"] for r in records),
    16. "variance": variance(r["final_ok"] for r in records),
    17. "first_bad_step": first_bad,
    18. }

    4. Capability Coordinates: Relative Position Instead of Absolute Ranking

    A more robust way to express results is to give each configuration relative coordinates: anchor two reference points, then describe where the object under test falls. For example, on the general reasoning dimension, some configurations sit roughly between the “previous-generation flagship” and the “current-generation flagship.” On the long-chain reasoning dimension, some configurations produce longer and more complex reasoning chains, but this does not necessarily translate into higher accuracy. On writing-oriented tasks, configurations with concise reasoning and natural phrasing tend to be preferred.

    The advantage of this description is that it is verifiable and iterable: whenever the reference points are updated, the coordinates update with them, without overturning the entire set of conclusions. It also reminds us that cross-generation comparisons must hold the prompt, sampling parameters, and scoring script constant; otherwise the difference may come from the evaluation setup rather than the model itself.

    5. From Evaluation to Production: Four Levers for Inference Cost

    What actually drives the bill is not the unit price but the amplification effect of ineffective reasoning. Four general-purpose levers are available:

    • Difficulty routing: use a lightweight classifier to determine the problem level first, send L1/L2 to a small configuration, and escalate to a large one only for L3/L4. This typically compresses total cost significantly.
    • Budget-constrained decoding: set limits on reasoning length and retries per request so that a few hard problems do not consume the entire batch quota.
    • Result caching and semantic deduplication: reuse answers for equivalent problems to reduce repeated reasoning.
    • Self-consistency voting instead of blindly lengthening: taking the consistent conclusion from multiple short reasoning runs on the same problem is often more cost-effective than one very long run.

    Pseudocode for the routing logic:

    1. def route(prompt):
    2. level = classify_difficulty(prompt) # L1..L4
    3. if level <= 2:
    4. return small_config, {"max_steps": 6, "retries": 1}
    5. return large_config, {"max_steps": 24, "retries": 2, "self_consistency": 3}

    6. Resource Allocation When Quota Is Running Out

    A common real-world scenario: a platform membership is about to expire, the remaining credits cannot be consumed within the validity period, and queuing is severe during peak hours. The rational move is not to keep waiting in line, but to spend the resources on “high-value, reusable” output:

    1. Batch offline jobs: run non-real-time document extraction, batch classification, and test data generation together.
    2. Asset-style output: organize results into evaluation sets, prompt template libraries, and regression cases that can be reused long term, turning a one-time quota into lasting value.
    3. Accumulating failure samples: deliberately run boundary and adversarial samples, record failure modes, and provide a basis for later selection decisions.
    4. Avoiding the sunk cost fallacy: do not manufacture meaningless requests just to “use up the quota.” Remaining credits expiring is a fixed cost and should not affect subsequent technical judgment.

    7. Engineering Loop: Making Evaluation Continuously Valuable

    It is advisable to build evaluation as a pipeline rather than a one-off script: a versioned dataset, fixed scoring logic, and fixed sampling parameters, with automatic regression on every model or prompt change, producing two tables, a layered report and a cost report. The report gives accuracy, process accuracy, average reasoning length, and cost per task at the same time, so that selection discussions have a shared factual basis.

    For cloud implementation, object storage can hold datasets and results, a message queue can smooth out peaks and handle queuing, a container platform can host evaluation and inference jobs, and logging plus monitoring and alerting can track failure rates and cost drift. This upgrades “comparing by feel” into an engineering capability that is reproducible, auditable, and optimizable.