LLM Mathematical Reasoning Evaluation and Throughput Benchmarking Guide

    This guide explains how to evaluate large language models on mathematical reasoning and measure inference throughput without drawing misleading conclusions. It covers difficulty-stratified accuracy, reasoning-process quality, proof and open-ended tasks, stability across samples, reproducible evaluation pipelines, answer-equivalence checking, serving metrics such as time to first token and tail latency, load testing, unit-cost estimation, fair cross-model comparison, common pitfalls, and practical implementation steps.

    1. Why Systematic Evaluation of Mathematical Reasoning Is Needed

    Math problems have standard answers, which makes them a common scenario for testing LLM reasoning. However, looking only at whether a single problem is answered correctly often leads to unreliable conclusions. A model may produce different results when sampled multiple times on the same problem. A problem may also already appear in training data, so a high score does not necessarily reflect true reasoning ability.

    Therefore, evaluation needs to answer three questions at the same time: whether the model can reach the correct answer, whether the process used to reach that answer is reliable, and whether performance is stable across different difficulty levels and problem types.

    2. Breaking Down Evaluation Dimensions

    2.1 Accuracy and Difficulty Stratification

    Stratify problems by difficulty, such as basic algebra, combinatorics, number theory, and analysis and proof. Reporting accuracy separately for each stratum is more informative about the model’s capability boundary than a single overall score.

    2.2 Quality of the Reasoning Process

    The length and structure of the reasoning chain (chain of thought) can be observed, but length alone does not equal capability. A longer reasoning chain may mean the model is repeatedly trying and failing, or it may simply be redundant output. Therefore, record accuracy and average output length together, and calculate the number of output tokens consumed per correct answer.

    When evaluating the reasoning chain, check the following:

    • Whether intermediate steps have a clear logical basis;
    • Whether there are skipped steps or contradictions;
    • Whether the model performs a self-check before reaching a conclusion.

    2.3 Open-Ended and Proof Tasks

    Closed problems can be scored automatically, while proof-based or open-ended problems usually require manual review or dedicated scoring rules. A proof can be broken into several key steps and scored item by item, avoiding a simple binary “correct” or “incorrect” summary.

    2.4 Stability

    Differences in results for the same problem under different temperature parameters or random seeds reflect the stability of model output. It is recommended to sample each problem multiple times and report both the mean and variance of the pass rate.

    3. Building a Reproducible Evaluation Pipeline

    A reproducible mathematical evaluation usually includes the following steps:

    1. Benchmark construction: record problem sources and versions, and split the benchmark into a public set and a holdout set.
    2. Decontamination check: perform near-duplicate detection on problems to avoid high overlap between evaluation problems and known training corpora.
    3. Prompt fixing: version-control the system prompt, number of examples, and output format.
    4. Inference and sampling: fix sampling parameters and save the complete output of every request.
    5. Answer extraction and scoring: normalize the answer format first, then judge whether answers are equivalent.
    6. Manual spot check: sample a percentage of results to review automatic scoring and estimate scoring error.
    7. Statistical reporting: provide confidence intervals rather than only a point estimate.

    The pseudocode below shows the main data flow of the evaluation and does not depend on any specific framework:

    1. for each problem in benchmark:
    2. for trial in range(N_SAMPLES):
    3. response = call_model(prompt=build_prompt(problem),
    4. temperature=FIXED_TEMP,
    5. max_output_tokens=LIMIT)
    6. record.raw_output = response.text
    7. record.output_tokens = response.usage.output_tokens
    8. record.answer = extract_final_answer(response.text)
    9. record.correct = judge_equivalence(record.answer, problem.gold)
    10. store(record)
    11. report:
    12. accuracy_by_level = mean(correct) grouped by difficulty
    13. tokens_per_correct = sum(output_tokens) / count(correct)
    14. confidence_interval = bootstrap(correct_per_problem)

    3.1 Notes on Answer Equivalence

    Mathematical answers may have multiple equivalent forms, such as fractions versus decimals, different simplified forms, or different orderings of a set. Simple string comparison will underestimate model scores. It is recommended to perform symbolic normalization first, compare the normalized results, and manually confirm edge cases.

    4. Measuring Inference Throughput and Serving Performance

    Beyond model capability, serving-side performance also affects model selection. Common metrics include:

    • Time To First Token (TTFT): the time from sending a request to receiving the first output token, which directly affects interactive experience.
    • Output rate: the number of tokens generated per second, which determines how long a long reasoning chain takes to wait for.
    • Concurrent throughput: at a specified concurrency level, the number of completed requests or total output tokens per unit time.
    • Tail latency: percentile latencies such as P95 and P99, which reflect real user experience better than averages.

    4.1 Influencing Factors

    Throughput is determined by multiple variables:

    • Hardware configuration, including accelerator model, memory capacity, and inter-card interconnect bandwidth;
    • Batching strategy: larger batches usually increase overall throughput, but also increase per-request latency;
    • Quantization and precision: lower precision can reduce memory usage, but may affect output quality;
    • Parallelism strategy: tensor parallelism and pipeline parallelism have different trade-offs in communication overhead;
    • Input and output length distribution: long contexts consume more KV cache.

    Therefore, any single throughput number must be accompanied by test conditions, including model size, precision, batch size, input and output lengths, and hardware topology. Without these conditions, different numbers cannot be compared.

    4.2 Load Testing Method

    Load testing should use a request distribution close to production, gradually increase concurrency, and record the curves for throughput and tail latency. The knee point of the curve is usually the usable capacity limit of the system.

    1. for concurrency in [1, 2, 4, 8, 16, 32, ...]:
    2. run_load_test(concurrency, request_distribution=PROD_LIKE)
    3. record(throughput_tokens_per_sec, p95_latency, error_rate)
    4. if error_rate > THRESHOLD or p95_latency > SLO:
    5. break
    6. capacity = last_good_concurrency

    4.3 Unit Cost Estimation

    Comparing self-hosted deployment with managed services ultimately comes down to cost per token. A simplified estimation formula is as follows:

    Unit output token cost = hourly resource cost ÷ (effective output tokens per second × 3600)

    Here, “effective” means output that passes the quality threshold. If throughput is high but the error rate is also high, the actual cost is not low. The calculation should include retries, failed requests, and resource idle rate.

    5. Fairness Principles for Cross-Model Comparison

    Cross-model comparison often suffers from inconsistent definitions. The following conventions are recommended:

    1. Use the same set of problems, the same prompts, and the same maximum output length.
    2. Record model versions and release dates; re-evaluate after version changes.
    3. Standardize sampling parameters and state whether external tools or code execution are enabled.
    4. Report inference cost and latency separately; do not merge them into a single score.
    5. Evaluation conclusions apply only to the tested conditions and should not be directly extrapolated to other tasks.

    6. Common Pitfalls

    • Treating long reasoning chains as evidence of strong capability. Length needs to be interpreted together with accuracy.
    • Looking only at single-run results. Sampling randomness can cause large fluctuations in single-run pass rates.
    • Claiming generalization ability directly after evaluating on public benchmarks. Public problems may already be in training data.
    • Treating peak throughput as stable serving capacity. Peak throughput usually occurs under ideal load; sustained load and tail latency should also be observed.
    • Ignoring scoring error. Bias in automatic scoring is directly passed into final conclusions.

    7. Practical Recommendations

    To implement this method within a team, proceed in the following order:

    1. First build a small but high-quality internal benchmark covering three to four difficulty levels, with at least dozens of problems per level.
    2. Fix evaluation scripts and report templates, and store results in version control for traceability.
    3. Establish a load-testing baseline for the serving side, and remeasure whenever hardware, precision, or batching configuration changes.
    4. Compare accuracy, cost per correct answer, and tail latency in the same table as the basis for model selection.
    5. Regularly sample and manually review results to maintain scoring quality.

    8. Conclusion

    Mathematical reasoning ability and serving throughput are two different problems, each requiring rigorous benchmark design and standardized load-testing methods. Only when measurements are taken under the same conditions and complete metrics are reported do comparison conclusions have reference value.