How to Evaluate LLM Math Reasoning: Task Tiers, Automated Verification, Scoring, and Cost Trade-offs

    Math reasoning is one of the clearest yardsticks for judging a large language model's logic, planning ability, and reliability. Debate never stops about whether a given model is actually good at math or worth the price, but most of that debate stays at the level of gut feeling and cannot support real procurement decisions. This article takes a developer's perspective and breaks the problem into three questions: how to measure, how to choose, and how to operationalize. It covers a difficulty ladder that runs from searchable problem types to open mathematical questions, an evaluation loop built around automated verification, multi-dimensional scoring, and the cost and resource trade-offs between calling an inference service and self-hosting. The goal is a reusable evaluation framework, so that judgments are not driven by a single hands-on impression or one leaderboard.

    1. Introduction: why math reasoning has become a key capability benchmark

    The capability boundary of large language models keeps expanding fast. From code generation to research assistance, financial modeling, and industrial simulation, math reasoning is an unavoidable core step. Like code generation, math problems have an advantage that few other tasks can match: the answer can be judged precisely to a large extent. Whether a numeric result is correct, whether a derivation holds, whether a proof contains a gap — each can be assessed with relatively clear conclusions through symbolic computation, enumeration, formal checking, or expert review.

    For exactly this reason, mathematical reasoning has become an important reference point for measuring how much “intelligence” a model actually has. Yet community assessments often stop at subjective impressions such as “feels quite usable” or “doesn’t feel cost-effective,” which give enterprises little to act on. This article tries to turn that kind of subjective discussion into an actionable engineering methodology, organized around three questions:

    1. How to understand a model’s math capability in layers, so that “retrieval and recall” is not mistaken for “reasoning ability”;
    2. How to build a rigorous, repeatable evaluation process whose conclusions hold up to statistical scrutiny;
    3. How to decide cost between API calls and self-hosting, and embed evaluation results into day-to-day development.

    2. Task tiers: from “retrieval math” to open mathematical problems

    The first step in assessing math ability is to be explicit about what is being tested. By how available a solution is in public material, math tasks roughly fall into three tiers.

    2.1 Difficulty tiers and what they measure

    Tier Task characteristics Solution availability in public material Main capability tested Typical scenarios
    L1 retrievable Classic problem types, or problems with existing proofs in reference material Abundant; the model may well have seen them in its training corpus Memory and pattern matching Textbook examples, classic inequalities
    L2 compositional Competition-level problems that require transferring and combining several methods Present but scattered; the model must organize and assemble them itself Method transfer and step orchestration Olympiad problems, hard exam questions
    L3 open Propositions with no existing proof in the material that the model must construct itself Essentially none Autonomous argument construction, long-chain reasoning, self-checking Research-grade proofs, domain-specific problems

    A common way to probe a model in the community is to ask it to prove a proposition drawn from a math knowledge base and write it up as a properly formatted lecture note — with the explicit stipulation that the proposition has no existing proof in that knowledge base. This is a textbook L3 test, for three reasons:

    • The model cannot pass by recitation; it has to actually construct an argument.
    • A proof involves many steps and a long dependency chain, which puts heavy demands on sustained reasoning.
    • The lecture-note output simultaneously tests structured exposition and correct math typesetting.

    2.2 Why “no existing proof” matters

    The essential difference between L3 and L1/L2 is the scarcity of the information source. On L1/L2 tasks, a model can produce a plausible-looking answer by stitching together similar fragments from memory even without truly deriving anything. On L3, it must organize lemmas, construct intermediate steps, and check the result with no reference to lean on — much closer to the shape of real research and engineering problems.

    The implication for developers is this: evaluating a model with L1/L2 items only answers “is it well-read?”; evaluating it with L3 items is what answers “does it think reliably?” In enterprise settings — pricing derivations for financial derivatives, timing-constraint analysis for chips, algorithm complexity proofs — a great deal of demand sits between L2 and L3. If the evaluation set contains only easy items, the selection conclusion is very likely skewed.

    3. Building the evaluation set around automated verification

    Once tasks are tiered, the next question is who grades the papers. Pure human review is expensive, inconsistent, and hard to support frequent iteration. The more workable approach is automated verification as the primary mechanism, with sampled review as a supplement.

    3.1 Constrain the output format per task type

    Evaluation validity depends heavily on whether the model can produce a machine-decidable answer. A practical rule is to constrain the output format explicitly in the prompt:

    1. Please prove the following proposition:
    2. 1. Give the complete proof, annotating every step with the theorem or derivation used;
    3. 2. Wrap the final conclusion with a designated marker, e.g. a standalone line beginning with "Conclusion:";
    4. 3. If any step is uncertain, it must be flagged explicitly and must not be assumed to hold by default;
    5. 4. End the proof with "[END OF PROOF]".

    Rule 3 matters most. Many models, when a derivation gets hard, silently assume some step is “obviously true” and jump straight to the conclusion. If the prompt does not force the model to surface uncertain steps, the evaluation will mistake a seemingly complete proof for a correct one.

    3.2 Three kinds of automated verification

    • Result checking: when the final answer is a number, a closed-form expression, or a concrete structure, cross-validate it with a symbolic math library, a numerical solver, or brute-force enumeration over small cases.
    • Formal verification: for key lemmas, the model can also be required to produce a formal proof (for example, in an interactive theorem prover), which a proof checker verifies step by step. Such tooling is effective at catching skipped or default-assumed steps in natural-language proofs.
    • Rule checking: verify that conclusion markers are present, that formulas follow the agreed typesetting conventions, and that there are no structural defects such as circular reasoning.

    3.3 The three-layer structure of an evaluation set

    A sustainable evaluation set usually contains three kinds of items:

    1. Core set: private, unpublished, closely tied to the business, carrying most of the weight.
    2. Reference set: public benchmark items, used only for directional comparison, with lower weight.
    3. Regression set: a small, fixed number of items dedicated to detecting capability regressions after version updates.

    4. Scoring and statistics: making conclusions repeatable

    4.1 Why a single sample is unreliable

    LLM output is stochastic: the same item can yield different results across samples. One success does not prove capability, and one failure does not prove weakness. Reliable evaluation has to rest on multiple samples and summary statistics.

    4.2 Three common metrics

    • pass@1: the share of cases that pass verification on a single sample, reflecting expected performance in ordinary one-shot use.
    • maj@k: accuracy of the majority-consistent answer over k samples, reflecting the model’s ability to perform stably.
    • pass@k: the share of cases where at least one of k samples passes, reflecting the model’s capability ceiling.
    1. import collections
    2. import math
    3. def pass_at_k(correct: list[bool], k: int) -> float:
    4. """Unbiased estimate of pass@k from n samples and the number that passed."""
    5. n = len(correct)
    6. c = sum(correct)
    7. if n - c < k:
    8. return 1.0
    9. return 1.0 - math.comb(n - c, k) / math.comb(n, k)
    10. def evaluate(case_results: list[list[bool]], k: int = 5) -> dict:
    11. """Aggregate sampling results across multiple cases."""
    12. return {
    13. "pass@1": sum(r[0] for r in case_results) / len(case_results),
    14. "maj@k": sum(
    15. collections.Counter(r).most_common(1)[0][0] for r in case_results
    16. ) / len(case_results),
    17. "pass@k": sum(pass_at_k(r, k) for r in case_results) / len(case_results),
    18. }

    Three further points matter in practice:

    • Report confidence intervals: with small sample sizes (for instance, fewer than a hundred items), a difference of a few percentage points may just be statistical noise.
    • Report by tier: give L1, L2, and L3 scores separately so that an aggregate number does not hide weaknesses.
    • Fix the prompts: any prompt change requires re-running the evaluation, otherwise historical conclusions are no longer comparable.

    4.3 Multi-dimensional scoring: more than “right or wrong”

    For outputs like proofs and lecture notes, judging correctness alone is far from enough. A structured rubric, scored by reviewers per dimension, is advisable:

    1. {
    2. "Correctness": {"weight": 0.4, "notes": "Is the conclusion correct, and do the key lemmas hold?"},
    3. "Completeness": {"weight": 0.2, "notes": "Are required steps missing, and are uncertain points flagged?"},
    4. "Rigor": {"weight": 0.2, "notes": "Is the reasoning chain closed, with no circular reasoning or default assumptions?"},
    5. "Formatting": {"weight": 0.1, "notes": "Are math symbols, formula layout, and structural hierarchy conventional?"},
    6. "Usability": {"weight": 0.1, "notes": "Can it be reused directly as lecture or documentation material?"}
    7. }

    Reviews should be double-blind — reviewers do not know which model produced a given result — and inter-rater agreement should be computed (for example, a Kappa coefficient). This meaningfully reduces bias from subjective preference.

    5. From leaderboards to in-house evaluation: making selection conclusions trustworthy

    Model rankings circulating in the community — tiers by math ability, debates about the relative position of different model versions — are useful for understanding the industry landscape. Used directly for enterprise selection, however, they carry three biases:

    1. Item contamination: public benchmark items may already be widely present in training corpora, inflating scores.
    2. Version drift: models are updated frequently and old conclusions go stale quickly, so continuous regression testing is needed.
    3. Task-distribution mismatch: leaderboard items are often inconsistent with your own business scenarios.

    A more robust approach is to build a tiered “evaluation pyramid”:

    • Base: the automated-verification core set, the largest layer, used for day-to-day regression.
    • Middle: a semi-automatic set of semi-open items, with key intermediate results checked by symbolic computation.
    • Apex: a small open-ended set graded blind by domain experts, used for the final selection decision.

    At the same time, the evaluation dimensions should span four areas: correctness, economics, stability, and compliance. Only when capability is viewed alongside cost, latency, and data compliance does the selection conclusion become truly actionable.

    6. Cost and resources: the API-versus-self-hosting trade-off

    6.1 Replace “price per token” with “cost per task”

    Discussions about cost-effectiveness often collapse into an intuitive judgment about whether something is expensive. A more scientific metric is cost per task:

    1. cost per task = average token cost per task × expected number of calls (including retries)

    Math reasoning tasks typically involve a lot of intermediate derivation, so they emit many output tokens, and hard problems may need several attempts. A model with a higher unit price that returns a correct answer on the first try may well have a lower total cost than a cheap model that has to be retried repeatedly.

    1. INPUT_TOKENS = 1200
    2. OUTPUT_TOKENS = 4000
    3. PASS_RATE = 0.85 # Single-attempt pass rate, from your own evaluation results
    4. RETRY_LIMIT = 2 # Maximum number of retries
    5. PRICE_PER_MTOK = 5.0 # Unit price: cost units / 1M tokens (assumed value)
    6. def expected_attempts(pass_rate: float, retry_limit: int) -> float:
    7. """Compute the expected number of calls, including retries."""
    8. total, prob = 0.0, 1.0
    9. for _ in range(retry_limit + 1):
    10. total += prob
    11. prob *= 1 - pass_rate
    12. return total
    13. print(expected_attempts(PASS_RATE, RETRY_LIMIT) * (INPUT_TOKENS + OUTPUT_TOKENS)
    14. * PRICE_PER_MTOK / 1e6)

    6.2 The break-even point for self-hosting

    If call volume is stable and large, running your own inference service can be more advantageous than calling an API. Industry discussions also frequently cover how to achieve high inference throughput with single-rack AI servers. But a self-hosting decision cannot rest on “peak throughput” alone; fixed costs and resource utilization have to be weighed too.

    Dimension Inference API Self-hosted inference
    Fixed cost Essentially zero Server purchase/lease, data center, power
    Marginal cost Billed per token Close to electricity and depreciation
    Elasticity Naturally elastic, scales on demand Bounded by your own cluster capacity
    Operational burden Carried by the provider You handle deployment, tuning, and failure recovery
    Data compliance Depends on service terms and deployment mode Data stays in your own environment, easier to control
    Best fit Volatile traffic, experimentation phase High, steady volume; strict compliance requirements

    A simplified decision formula:

    1. def break_even_calls(fixed_cost: float, variable_cost_per_task: float,
    2. api_cost_per_task: float) -> float:
    3. """Minimum task volume at which self-hosting beats API calls."""
    4. return fixed_cost / (api_cost_per_task - variable_cost_per_task)

    On top of that, capacity has to be sanity-checked with resource estimation:

    1. Required concurrent batch size ≈ target token throughput ÷ average output tokens per request
    2. Required GPU memory ≈ weight memory + KV cache memory
    3. KV cache memory ≈ layers × 2 × KV heads × head dim × context length × batch size × bytes per element
    1. def kv_cache_bytes(layers: int, kv_heads: int, head_dim: int,
    2. context_len: int, batch_size: int, bytes_per_elem: int) -> int:
    3. return layers * 2 * kv_heads * head_dim * context_len * batch_size * bytes_per_elem

    Math reasoning tasks produce long outputs and can also carry long contexts, so the KV cache is often more likely than the weights themselves to become the memory bottleneck — it cannot be ignored in planning. Two other costs are routinely underestimated:

    • Utilization from sparsity of demand: if average utilization is only 20%, the effective cost per task of self-hosting is multiplied several times over.
    • Peak-to-trough swings: self-hosting must be sized for the peak, leaving resources idle in the troughs.

    6.3 Hybrid architecture: routing by task tier

    In practice, many teams end up with a hybrid architecture that routes tasks by difficulty.

    1. def route(task: dict, small_endpoint: str, large_endpoint: str) -> str:
    2. """Pick the inference endpoint by difficulty: easy items go to the small model."""
    3. if task["level"] == "L1" or task["estimated_tokens"] < 2000:
    4. return small_endpoint
    5. return large_endpoint

    Worth stressing: the routing policy itself should be evaluated. If the small model is mis-routed too often, total cost goes up rather than down. Routing rules should be continuously calibrated against evaluation data, not fixed by intuition.

    7. Engineering the loop: embedding evaluation in daily development

    Evaluation is not one-off work; it should be part of the development process. A practical path:

    1. Set up a regression gate: keep a fixed evaluation set in the repository, run regression automatically on every model version upgrade or prompt change, and alert when the pass rate drops beyond a threshold.
    2. Accumulate a failure-sample library: classify and archive cases that fail verification — “calculation error,” “skipped logical step,” “non-conforming formatting” — to analyze model weaknesses and guide subsequent prompt optimization.
    3. Improve observability: record token consumption, latency, and verification results for every call, and aggregate cost by scenario to locate where the money actually goes.
    4. Design caching sensibly: results for highly similar questions can be reused, but math answers demand very high precision, so caches must ship with verification and invalidation mechanisms.

    If the workload runs on Baidu AI Cloud, you can use its general-purpose container services to deploy inference services and evaluation jobs, object storage to hold evaluation datasets and failure samples, and logging plus monitoring and alerting to track call cost and verification pass rates over time. That closes the loop of evaluate → monitor → iterate. The same workflow applies on other clouds; what matters is turning the methodology into a reusable toolchain.

    8. Common pitfalls and how to avoid them

    • Pitfall 1: substituting a single hands-on session for evaluation. One success may be luck. Fix the prompts, sample multiple times, and report pass@1, maj@k, and confidence intervals.
    • Pitfall 2: inferring complex-task ability from easy items. Solving textbook examples does not mean a model can handle open-ended problems. Build the evaluation set in tiers and report scores per tier.
    • Pitfall 3: looking only at unit price, not cost per task. Factor pass rate and retry count into cost accounting.
    • Pitfall 4: ignoring version drift. After a model update, old conclusions may no longer hold. Maintain a fixed regression set and monitor continuously.
    • Pitfall 5: comparing only peak throughput. Ignoring average utilization badly underestimates self-hosting cost. Do capacity planning against the request distribution and peak-to-trough ratio.

    9. Conclusion

    The discussion around large-model math capability ultimately answers one question: how can we judge, in a verifiable way, whether a model is reliable in unpredictable real-world scenarios? The methods in this article reduce to a single line:

    1. Use difficulty tiers to define what you are evaluating;
    2. Use automated verification to cut evaluation cost;
    3. Use statistical metrics to keep conclusions robust;
    4. Use cost per task to measure economics;
    5. Use hybrid routing and a regression gate to embed evaluation in the engineering process.

    For developers, what matters is not memorizing where a given model ranks on a given leaderboard, but mastering a reusable evaluation methodology. As models iterate faster and cost structures keep shifting, that methodology is what moves technology selection from “going by feel” to “backed by evidence.”