How to Evaluate and Select LLMs for Mathematical Reasoning

    This article presents a neutral, practical framework for evaluating the mathematical reasoning ability of large language models. It breaks math capability into four measurable layers, explains how to build contamination-resistant evaluation sets, and shows how to assess process quality, reasoning length, cost, and stability. It also covers weighted scoring and tiered routing so evaluation results can be turned into a production selection strategy. Readers will learn why a single "which model is best" ranking is misleading and how to build a reproducible, layered, and cost-aware evaluation system.

    1. The Problem: Why “Which Model Is Stronger” Is the Wrong Question

    In real engineering selection work, teams often argue about whether a given model is strong at math and whether it can replace the current solution. One valuable point from the original discussion is that clear capability gradients exist between models, and these gradients are not consistent across problem types. Some models have a clear advantage on open-ended math problems, some produce more concise chains of thought and write more like humans, and some have the longest and most complex reasoning but do not necessarily achieve higher accuracy.

    Translated into engineering language, this yields three conclusions:

    1. Model capability is not a scalar but a vector. It includes at least five dimensions: accuracy, process verifiability, reasoning length, expression naturalness, and stability.
    2. Rankings must be bound to a specific problem set and evaluation protocol. A ranking detached from the problem set has no engineering meaning.
    3. “Can it solve open-ended problems” and “can it solve standard problems” are two different capabilities and must be measured separately.

    Therefore, this article does not discuss any specific product. Instead, it provides a neutral, actionable framework for evaluating mathematical reasoning ability.

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

    It is recommended to divide math tasks into four layers, increasing in difficulty:

    • L1 Calculation and symbolic manipulation: arithmetic, fractions, unit conversion, and simple equation solving. Tests basic accuracy and format compliance.
    • L2 Standard problem reasoning: problems with fixed solution methods, such as functions, sequences, probability, and solid geometry. Tests the stability of multi-step reasoning.
    • L3 Competition and proof problems: require construction, proof by contradiction, and case analysis. Tests process verifiability and self-correction ability.
    • L4 Open-ended math problems: incomplete problem statements, self-modeling, non-unique answers, or the need to propose conjectures. Tests exploration and convergence ability.

    The judgment from the original discussion that only one model “can solve open-ended problems” is essentially a very high rating at the L4 layer. In engineering, L4 should be built as a separate set and not mixed with L1–L3 into a total score, otherwise real weaknesses will be masked.

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

    The quality of the evaluation set determines the quality of the conclusions. The following principles are recommended:

    1. Layered proportions: L1 at 20%, L2 at 35%, L3 at 30%, and L4 at 15%, adjustable based on business focus.
    2. Decontamination: prioritize self-built, adapted, and parameter-randomized problems, and avoid directly using original public benchmark questions.
    3. Prefer unique answers: L1–L3 should ensure unique, automatically verifiable answers; L4 should use human or strong-verifier review.
    4. Difficulty calibration: run a pre-test with two or three models of different capability tiers, remove all-correct and all-wrong problems, and keep problems with high discrimination.
    5. Version freezing: assign version numbers to the problem set and record change notes for any modification to ensure cross-round comparability.

    A sample implementation of parameter randomization:

    1. import random
    2. def gen_linear_equation(seed: int):
    3. r = random.Random(seed)
    4. a = r.randint(2, 9)
    5. x = r.randint(-20, 20)
    6. b = r.randint(-50, 50)
    7. c = a * x + b # Fix the known solution first to guarantee a unique answer
    8. return f"Solve the equation {a}x + ({b}) = {c}", x

    This “define the answer first, then generate the problem statement” approach can produce automatically verifiable problems in bulk at low cost.

    4. Process Evaluation: From “Correct Answer” to “Trustworthy Process”

    Process quality is the most easily overlooked aspect in math scenarios. A model may answer correctly but skip serious reasoning steps, then fail on a similar problem. It is recommended to introduce three types of process metrics:

    • Step completeness: whether key intermediate quantities appear and whether case analysis is complete.
    • Self-correction rate: whether the model can detect and fix an erroneous intermediate step on its own.
    • Expression naturalness: whether it writes like a human solving a problem rather than mechanically stacking formulas.

    A practical automatic verification idea is “intermediate quantity comparison”: annotate several key intermediate quantities for each problem and use a symbolic computation library to verify equivalence.

    1. # Sample: verify whether an intermediate quantity is equivalent to the reference answer
    2. from sympy import simplify, sympify
    3. def check(expr_a: str, expr_b: str) -> bool:
    4. return simplify(sympify(expr_a) - sympify(expr_b)) == 0
    5. print(check("(x+1)**2 - 1", "x**2 + 2*x")) # True

    For L4 open-ended problems, it is recommended to use “dual review plus disagreement arbitration”: two reviewers score independently, a third reviewer is introduced when the disagreement exceeds a threshold, and the reasons for disagreement are recorded to form a traceable review record.

    5. Reasoning Length and Cost: The Most Complex Is Not the Best

    The original discussion mentioned that a certain type of model has the longest and most complex chain of thought but is not necessarily stronger. This is critical in engineering: reasoning length and accuracy are not monotonically positively correlated. Overly long reasoning increases the probability of “going off track midway” and significantly raises latency and cost.

    It is recommended to record the following metrics together:

    • Average reasoning token count and P95 reasoning token count;
    • Per-problem end-to-end latency P50/P95;
    • Per-problem cost (measured separately for input, output, and reasoning);
    • Cost per correct answer = cost / number of correct problems.

    Use a simple cost-performance view to support decisions:

    1. Model tier Accuracy Avg reasoning length Cost/problem Cost per correct answer
    2. High-capability High Long High Medium
    3. Balanced Medium-high Medium Medium Low
    4. Lightweight Medium Short Low Low

    The usual conclusion is: use the lightweight tier for L1–L2, the balanced tier for L3, and the high-capability tier for L4, forming tiered routing rather than sending everything to the strongest model.

    6. Stability and Engineering Constraints

    A single evaluation is not enough to support production decisions; stability testing must be added:

    1. Repeated sampling: run the same problem multiple times and measure answer consistency and variance.
    2. Prompt perturbation: change wording, order, and format requirements, and observe accuracy drift.
    3. Long context: lengthen the problem statement and reference material, and observe the performance decay curve.
    4. Refusal and hallucination rate: measure the proportion of unfounded assertions and fabricated conditions.
    5. Structured output compliance rate: measure the format compliance proportion when a fixed output format is required.

    On the engineering side, observability should also be a focus: write the request chain, token consumption, and review results into a unified logging service, and set dual-threshold alerts for accuracy and cost with monitoring, to avoid hidden regressions caused by model iterations or prompt changes.

    7. Selection Decisions: Turning Evaluation Results into a Launch Strategy

    It is recommended to use weighted scoring instead of a single ranking:

    1. score = w1*accuracy + w2*process verifiability + w3*stability
    2. - w4*normalized cost - w5*normalized latency

    Set weights by scenario: offline proof assistance favors accuracy and process; online problem-solving services favor latency and cost; education scenarios should also add a weight for expression naturalness.

    For implementation, a three-step approach is recommended:

    1. Offline evaluation: run the full layered problem set and produce a capability radar chart.
    2. Gray-release validation: replay small-traffic real requests to calibrate the deviation between offline conclusions and online performance.
    3. Tiered routing: dynamically select the model tier based on problem difficulty and business value, while keeping a fallback path.

    8. Common Pitfalls

    • Looking only at the total score: the total score masks L4 weaknesses, causing the experience to collapse after open-ended tasks go live.
    • Blind faith in the longest reasoning: the longer the reasoning, the higher the risk of going off track and timing out.
    • Problem set contamination: using public original questions leads to inflated conclusions.
    • Ignoring format compliance: a correct answer that cannot be parsed is an engineering failure.
    • One-off evaluation: models and prompts keep changing, so evaluation must be normalized and versioned.

    9. Conclusion

    The evaluation of mathematical reasoning ability is not about giving a verbal conclusion of “who is first,” but about building a reproducible, layered, and cost-aware evaluation system. By breaking capability into layers, quantifying the process, and putting cost and stability into the same table, then using tiered routing to apply the conclusions to the production pipeline, selection decisions can remain stable and reliable in an environment of rapid model iteration.