Evaluating LLM Mathematical Reasoning: Metrics and Model Selection

    A practical framework for evaluating mathematical reasoning in large language models and selecting models for different workloads. Learn how to measure correctness, verifiability, latency, throughput, cost, and stability; assess mathematical proofs independently; and use quality–cost trade-offs to guide model routing and deployment decisions.

    1. Why Subjective Impressions Are Not Enough

    Many teams select large language models based on personal trials. Testers may describe one model as “more inventive” or another as “more natural at writing.” These impressions can be useful, but they have three clear limitations.

    First, trials usually involve few examples and inconsistent prompting styles, making comparisons difficult. Second, perceived quality is easily influenced by response length, tone, and formatting—none of which necessarily indicates correctness. Third, model versions change quickly, so a single trial may not reflect sustained performance.

    Model selection therefore needs to turn impressions into observable metrics: accuracy, response latency, cost per task, and whether outputs can be independently verified. The following sections build on this approach.

    2. Segment Workloads by Task Type

    Different applications have different requirements. A single “strongest model” is not necessarily the best choice for every workload. Start by dividing tasks into three categories.

    1. Exploratory tasks. These include brainstorming, drafting proposals, and generating ideas. Diversity and interaction speed matter most. Some inaccuracies may be acceptable because people will review and filter the results.

    2. Batch execution tasks. These include data cleaning, structured extraction, bulk rewriting, and code completion. Inputs arrive at scale, and outputs need to be consistent. Per-task correctness usually matters more than creativity, while speed and cost are major constraints.

    3. Advanced reasoning tasks. These include mathematical proofs, complex algorithm design, and multistep causal reasoning. Errors are costly, so rigorous verification is essential. Model capability is usually the primary consideration.

    Once workloads are segmented, selection becomes a question of which metrics to optimize for each category. Batch workloads may prioritize throughput and cost, while advanced reasoning should prioritize correctness before speed.

    3. Build an Evaluation Metric Framework

    An evaluation should cover at least six dimensions.

    Dimension Meaning Measurement
    Correctness Whether the final answer or conclusion is correct Comparison with reference answers or automated validation
    Verifiability Whether intermediate reasoning can be checked step by step Manual spot checks or formal verification
    Time to first token Time from submitting a request to receiving the first output Client-side timing
    Generation speed Number of output tokens generated per second Output tokens divided by generation time
    Cost per task Average expense of completing a task Input and output token counts multiplied by their respective rates
    Stability Consistency across repeated runs of the same problem Variance or agreement rate across repeated samples

    The following illustrative code provides a minimal evaluation framework. The user supplies model_fn to call the model through their chosen integration and verifier to determine whether an answer is correct.

    1. import time
    2. from dataclasses import dataclass
    3. @dataclass
    4. class EvalRecord:
    5. task_id: str
    6. correct: bool
    7. latency_s: float
    8. output_tokens: int
    9. def run_eval(model_fn, tasks, verifier):
    10. """Run a task set and record correctness, elapsed time, and output length."""
    11. records = []
    12. for task in tasks:
    13. start = time.perf_counter()
    14. answer, usage = model_fn(task["prompt"])
    15. latency = time.perf_counter() - start
    16. ok = verifier(task, answer)
    17. records.append(
    18. EvalRecord(task["id"], ok, latency, usage["output_tokens"])
    19. )
    20. return records
    21. def summarize(records):
    22. """Summarize accuracy, average elapsed time, and aggregate token throughput."""
    23. n = len(records)
    24. accuracy = sum(r.correct for r in records) / n
    25. avg_latency = sum(r.latency_s for r in records) / n
    26. throughput = sum(r.output_tokens for r in records) / sum(
    27. r.latency_s for r in records
    28. )
    29. return {
    30. "accuracy": accuracy,
    31. "avg_latency_s": avg_latency,
    32. "tokens_per_s": throughput,
    33. }

    This minimal framework records end-to-end latency; it does not separately measure time to first token or generation-only speed.

    Keep sampling parameters, system prompts, and context lengths fixed during evaluation. Otherwise, comparisons will mix model differences with other variables, undermining reproducibility.

    4. Evaluate Mathematical Reasoning Separately

    Mathematical reasoning is particularly contentious because an output can resemble a proof while containing gaps in its logic. Control evaluation quality at three stages: problem selection, verification, and scoring.

    4.1 Problem Sources and Contamination Control

    Prefer publicly available textbooks, course notes, and standard proofs of classical theorems, and record the source of each problem. However, substantial overlap with a model’s training data can allow it to reproduce existing material rather than demonstrate reasoning ability.

    One practical approach is to create problem variants. Preserve the structure of a proposition, change its conditions or parameters, and check whether the model derives a result under the revised assumptions. A model that repeats a familiar proof but cannot adapt to changed conditions provides weaker evidence of reasoning ability.

    4.2 Distinguish Recall from Independent Derivation

    A model-generated proof may come from memorization. The following checks help assess whether the model can reason beyond reproducing a known solution:

    • Check for references to nonexistent theorem numbers or lemma names.
    • Check whether key steps depend on unstated assumptions.
    • Ask for two different proof approaches to the same proposition and check their consistency.
    • Modify one premise and ask which step of the proof no longer holds.

    4.3 Formal Verification and Human Review

    For propositions that can be formalized, prioritize machine checking with formal proof tools. This can rule out many unsupported logical steps, but formalization is costly and is often best used on a sample of outputs.

    For long proofs that cannot be formalized, use human review. A review checklist can ask:

    • Is every lemma stated clearly?
    • Is each inference justified?
    • Are boundary cases handled?
    • Are symbols defined and used consistently?

    Reviewers should record error types, not just “correct” or “incorrect.” This makes it possible to compare failure patterns across models.

    4.4 Use Graded Scoring

    A practical scoring scheme separates outputs into three categories:

    1. Correct conclusion with a sound derivation.
    2. Correct overall approach, but gaps in the details.
    3. Incorrect conclusion.

    These distinctions reveal different weaknesses. Some models frequently reach the right conclusion but omit essential details; others show a different pattern. Those differences can have very different consequences in practice.

    5. Balance Speed and Quality

    Response speed and reasoning quality often involve trade-offs. One model may use more tokens to work through a problem, increasing latency while improving accuracy. Another may respond quickly and suit high-volume workloads but make more mistakes on difficult problems.

    Do not evaluate models using a single metric. Plot accuracy against throughput or cost per task. The nondominated models form a Pareto frontier: within the evaluated set, no other option improves one objective without sacrificing another. Select a point on that frontier that fits the application’s constraints.

    Also distinguish average latency from tail latency. In interactive applications, a small number of exceptionally slow responses can seriously affect the user experience. Track p50, p95, and p99 latency alongside the average.

    6. Manage Costs and Quotas

    Subscription plans and usage-based billing are two common cost models. With either approach, monitor actual consumption by task category to avoid exhausting allowances on unproductive experiments.

    The following code estimates the cost of a single task. Supply rates from the service’s actual pricing; the code only illustrates the calculation structure.

    1. def estimate_cost(input_tokens, output_tokens,
    2. price_in_per_k, price_out_per_k):
    3. """Estimate call cost using input and output rates per thousand tokens."""
    4. return (input_tokens / 1000) * price_in_per_k \
    5. + (output_tokens / 1000) * price_out_per_k
    6. def task_budget_report(records_with_usage, price_in_per_k, price_out_per_k):
    7. total = 0.0
    8. for r in records_with_usage:
    9. total += estimate_cost(
    10. r["input_tokens"], r["output_tokens"],
    11. price_in_per_k, price_out_per_k,
    12. )
    13. return {"total_cost": total, "tasks": len(records_with_usage)}

    For long reasoning tasks, output tokens often account for a large share of the cost. Set a maximum output length and define truncation and retry policies for excessively long responses.

    7. Account for Deployment Conditions

    Actual inference performance depends heavily on deployment conditions, including hardware, batch size, concurrency, and quantization. The same model can deliver substantially different throughput in different environments, so results from one setup should not be generalized to another.

    Teams that need private deployments should rerun benchmarks on their target hardware and record batch and concurrency settings.

    Teams accessing models through cloud platforms should use a unified evaluation environment. Run candidate models with the same prompts, problem set, and verification scripts to make comparisons fair.

    8. Build a Model Selection Workflow

    The evaluation and selection process can be organized into six steps:

    1. Map business tasks. Divide them into exploration, batch execution, and advanced reasoning.
    2. Set primary metrics for each category. Prioritize interaction speed for exploration, cost and stability for batch execution, and correctness and verifiability for advanced reasoning.
    3. Build representative evaluation sets. Include at least several dozen examples per category and retain source records.
    4. Run candidates under fixed conditions. Record correctness, latency, and cost.
    5. Plot trade-off curves. Select candidates that satisfy budget and response-time requirements.
    6. Run a limited production trial. Observe performance on real requests before deciding on a full rollout.

    In practice, many teams use tiered routing. Difficult tasks go to the model with the strongest reasoning capability, while routine batch tasks go to faster, lower-cost models. Human spot checks remain part of the workflow. This approach helps control costs while protecting quality on critical tasks.

    1. def route(task_type: str) -> str:
    2. """Select a model tier by task type; tier names are deployment-defined."""
    3. routing_table = {
    4. "brainstorm": "fast_tier",
    5. "batch": "cost_tier",
    6. "hard_reasoning": "strong_tier",
    7. }
    8. return routing_table.get(task_type, "cost_tier")

    9. Common Evaluation Mistakes

    Mistake 1: Treating one success as stable capability. A model may succeed and fail on repeated runs of the same problem. Collect multiple samples before drawing conclusions.

    Mistake 2: Ignoring verifiability. A proof-like response may look complete without every step being valid. High scores offer limited evidence when there is no verification process.

    Mistake 3: Comparing token prices alone. A model with lower rates may require more retries or longer outputs, making it more expensive overall. Compare the total cost of completing a task.

    Mistake 4: Ignoring data contamination. Scores may be inflated when evaluation problems closely match common training material. Refresh the problem set regularly and include variants.

    Mistake 5: Generalizing from one speed test. Latency and throughput depend on load, networking, and hardware. Measure them under conditions close to the intended production environment.

    10. Summary and Practical Recommendations

    Evaluating LLM mathematical reasoning requires replacing subjective judgments with reproducible measurements. Segment workloads, measure correctness, verifiability, latency, throughput, cost, and stability, independently check mathematical outputs, and use trade-off curves to guide selection.

    For teams beginning model selection, a practical first step is to spend a week building a small evaluation set covering the three main task categories. Record each model’s results, then use the data to choose a tiered routing strategy.

    Make the evaluation process part of the team’s engineering standards and rerun it regularly as model versions change.