Evaluating LLMs for Advanced Mathematical Reasoning: Methodology and Cost Model

    This article explains why engineering teams should build their own evaluation system for LLM-based mathematical reasoning instead of relying only on public leaderboards. It covers a three-layer benchmark based on verifiability, prompt and rubric design for reproducible evaluation, Pass@K metrics with failure attribution, and a cost-latency model for task routing. By combining machine verification, human review, and explicit cost controls, teams can turn “which model is stronger?” into measurable decisions.

    In mathematical modeling, financial engineering, cryptography, formal verification, and related domains, the value of an LLM depends heavily on whether a derivation is valid. A model may recall standard answers, but that does not mean it can produce a self-consistent proof for a proposition without a reference solution or ready-made template. Conversely, a model may score well on public leaderboards but still fail when applied to domain-specific notation, conventions, and delivery formats.

    Public leaderboards answer only one question: average performance on a fixed distribution of problems. They do not answer three questions that engineering teams actually care about:

    1. What is the error rate on my workflow, and what do those errors look like?
    2. What token cost, queueing time, and retry overhead are required to reach the target accuracy?
    3. Can the output be handled by automated verification stages such as symbolic computation, formal checkers, unit tests, or review rules?

    Therefore, the goal of evaluation is not simply to rank models. The goal is to build a capability profile:

    capability boundary × cost curve × delivery compliance

    This profile can guide task routing: which subtasks should go to higher-tier models with long chain-of-thought, which should go to low-cost fast models, and which require human review.

    1. Why Build a Custom Math Reasoning Evaluation?

    A custom evaluation system is necessary because public benchmarks only measure performance on a fixed problem distribution. They cannot tell you how a model behaves in your own technical environment, especially when your requirements include specific notation, proof standards, output formats, cost constraints, and automated verification.

    For high-stakes domains such as mathematics, financial engineering, cryptography, and formal verification, the critical question is not whether a model can reproduce known results. The critical question is whether its reasoning remains valid when there is no reference answer and no reusable template.

    A well-designed evaluation system should therefore answer three practical questions:

    1. How often does the model fail on tasks relevant to our workflow?
    2. What forms do those failures take?
    3. Can the output be accepted by automated verification tools or human review processes?

    The result should be a reusable capability profile rather than a single score.

    2. Three-Layer Benchmark Construction

    It is useful to divide the evaluation set into three layers based on verifiability, increasing automation and precision layer by layer.

    L1: Machine-checkable reasoning tasks

    This layer includes tasks such as algebraic manipulation, solving equations and inequalities, integral and limit calculations, combinatorial counting, and linear algebra determinations.

    The key advantage of this layer is that answers can be checked automatically:

    • Numerical problems can be compared using high-precision numerical evaluation.
    • Symbolic problems can be checked through equivalence simplification using a symbolic computation system.
    • Decision problems can be checked by directly comparing the final conclusion.

    L2: Proof tasks that require human or rubric-based grading

    This layer includes standard proofs from competition-level problems and graduate-level coursework. Reference solutions may be available, but the answer space remains open.

    For this layer, evaluation usually depends on a scoring rubric plus a two-person review process. The rubric should cover correctness, completeness, rigor, and format.

    L3: Research-level and long-chain tasks

    This layer includes more demanding tasks, such as propositions from public mathematical repositories for which no proof is provided. The model may be asked to produce a complete lecture-style exposition.

    The most valuable experience often comes from this layer. If a model can produce a structurally complete English lecture note, that suggests it can maintain long-chain consistency: it does not lose assumptions midway, does not silently change quantifiers, and does not cite nonexistent lemmas.

    Scoring for this layer almost always requires expert judgment. However, it also provides the strongest differentiation between models.

    Having all three layers in the same evaluation system helps avoid a common failure mode: high scores on easy benchmarks being mistaken for strong performance on tasks that require deep reasoning or formal precision.

    3. Prompt Design: Making Evaluation Reproducible

    A useful prompt design is to give the model a concise task description: prove a proposition from a public mathematical repository, write the result as an English lecture note in LaTeX, and state that no existing proof is available.

    This simple design reflects four engineering principles.

    Define deliverables explicitly

    The prompt should specify the proof body, lecture structure, and formatting requirements in one place. This prevents the model from wasting budget deciding whether to provide an outline, a proof, or only high-level intuition.

    Explicitly prohibit copying answers

    The prompt should explicitly state that no reference solution is available. This can reduce retrieval-style answers and hallucinated citations.

    Require explicit listing of lemmas and assumptions

    The model should list all lemmas, definitions, and assumptions it relies on. This creates a clear interface for later automated verification, such as checking each lemma for equivalence or validity.

    Require uncertainty markers

    The model should mark uncertain or weak steps. These self-identified weak points often overlap with issues found by experts and can serve as a cheap confidence signal.

    A rubric can be fixed in configuration to support version control:

    1. rubric:
    2. statement_equivalence: 0.10 # Whether the statement is equivalent to the prompt; quantifiers and conditions cannot be relaxed
    3. coverage: 0.30 # Whether all cases are covered, including degenerate and boundary cases
    4. rigor: 0.20 # Whether implicit assumptions are stated, such as limit interchange, convergence, and measurability
    5. lemma_validity: 0.20 # Whether cited lemmas actually exist and whether their conditions are satisfied
    6. artifact_quality: 0.10 # Structural quality, LaTeX compilability, and notation consistency
    7. honesty: 0.10 # Honesty in marking incomplete parts

    4. Metrics: From Single-Sample Pass Rate to Pass@K

    A single sample can produce a high-variance pass rate. In engineering evaluations, it is usually better to report Pass@K.

    For the same prompt, sample independently n times. Pass@K measures the proportion of evaluations where at least k of the n samples pass.

    The unbiased estimator is:

    1. Pass@k = 1 - C(n - c, k) / C(n, k)

    where:

    • n is the number of samples,
    • c is the number of passing samples,
    • C(n, k) is the binomial coefficient.

    Pass@1 reflects out-of-the-box capability. Pass@5 and Pass@10 reflect how well failures can be recovered through retries.

    If there is a large gap between Pass@1 and Pass@5, the model may benefit from automatic retry and self-verification loops. If the gap is very small, the failures are likely systematic, and simply increasing the budget may not help.

    1. import math
    2. from typing import Callable, Tuple
    3. def pass_at_k(n: int, c: int, k: int) -> float:
    4. """Unbiased Pass@k estimate"""
    5. if n - c < k:
    6. return 1.0
    7. return 1.0 - math.comb(n - c, k) / math.comb(n, k)
    8. def evaluate(model: Callable[[str], str],
    9. prompt: str,
    10. judge: Callable[[str], Tuple[bool, str]],
    11. samples: int = 5,
    12. k: int = 1) -> dict:
    13. """judge should return (passed, failure reason label)"""
    14. outcomes, latencies = [], []
    15. for _ in range(samples):
    16. text = model(prompt)
    17. outcomes.append(judge(text))
    18. passed = sum(1 for ok, _ in outcomes if ok)
    19. reasons = [r for ok, r in outcomes if not ok]
    20. return {
    21. "pass@k": pass_at_k(samples, passed, k),
    22. "pass@1": passed / samples,
    23. "failure_taxonomy": reasons, # Failure attribution is more diagnostic than a single score
    24. }

    In addition to pass rate, it is useful to record four items consistently:

    1. Failure taxonomy distribution: such as citing nonexistent lemmas, changing quantifiers, missing degenerate cases, calculation errors, or format violations.
    2. Average output length and chain-of-thought length: this helps reveal cost and latency risks.
    3. End-to-end latency P50/P95: this is important for production workflows and interactive use cases.
    4. Token consumption and converted cost per task: this allows evaluation results to be compared against real budget constraints.

    5. Cost and Latency: The Often-Ignored Second Axis

    Chain-of-thought reasoning has a direct cost consequence: output tokens include a large amount of reasoning content. For the same task, billed tokens may be one or more orders of magnitude higher than in a normal mode. The exact multiplier must be measured on your own data, because it varies greatly by task.

    This explains a common problem: a small number of tasks can consume most of the budget.

    A practical cost model should make this explicit:

    1. Cost per task ≈ input tokens × input unit price
    2. + (output tokens + chain-of-thought tokens) × output unit price
    3. Total budget ≈ number of tasks × retry factor × cost per task × (1 + long-context amplification factor)

    There are three useful engineering controls.

    1. Task-tier routing

    Tasks that can be automatically verified should go to low-cost, fast models and then be checked with symbolic computation. Only L2 and L3 tasks should use higher-tier long-chain models, and rubric-based retries should control the number of attempts.

    2. Upper-bound constraints

    Set limits for tokens per task, concurrency, and failure behavior. For example, use a stop-on-failure policy when a single sampling run shows signs of runaway cost. This prevents one failed sample from consuming the entire monthly budget.

    3. Batch processing and priority handling

    Offline evaluations can run through an asynchronous queue, such as a cloud message queue service. The question bank and model outputs can be stored in object storage. Formal verification and symbolic computation can run on a container platform. Chain-of-thought traces and grading records can be written to a logging service. Latency, failure rate, and budget consumption can be connected to monitoring and alerting.

    When queuing or rate limiting occurs, tasks can be downgraded to smaller, faster models according to business priority rather than being allowed to wait indefinitely.

    6. Common Misjudgments and Corrections

    Focusing only on average scores

    Looking only at average scores can hide tail error rates. In review or production scenarios, P95 latency and worst-case errors are often more important.

    Treating output length as rigor

    A longer chain of thought does not necessarily mean higher correctness. It also increases cost and timeout risk, so it should be evaluated together with accuracy.

    Drawing conclusions from a single sample

    At minimum, report both Pass@1 and Pass@5. Also state the sampling temperature, because it affects reproducibility.

    Trusting an unreliable judge

    String matching or regular-expression extraction can systematically underestimate or overestimate model performance. When possible, prefer symbolic equivalence checks or formal proof checkers.

    Ignoring version drift

    Models and prompts should both be versioned. Evaluation results should be bound to specific version numbers; otherwise, conclusions are difficult to reproduce.

    7. Conclusion

    The right way to evaluate a model’s true ability in advanced mathematical reasoning is not to search for a leaderboard ranking. The right way is to turn evaluation into a reproducible experiment.

    A three-layer benchmark ensures differentiation across task difficulty. Rubrics and automated verification make scoring more trustworthy. Pass@K and cost-latency models make the results usable in engineering decisions.

    In practice, this often leads to a simple routing table:

    Task type Recommended routing
    Machine-checkable calculations Low-cost fast model plus symbolic verification
    Standard proof tasks Mid-cost model with rubric-based retries
    Research-level long-chain derivations Higher-tier long-chain model with expert spot checks

    This approach helps control budget and queueing variability. More importantly, it turns the vague question of “which model is stronger?” into a quantitative conclusion that each team can answer for itself.