A Practical Guide to Evaluating and Selecting LLMs for Mathematical Reasoning

    Evaluating large language models (LLMs) on mathematical reasoning requires more than a single trial. This guide provides a reusable evaluation methodology, covering test set construction, prompt standardization, multi-dimensional scoring, and cost-efficiency analysis, to help you select and configure the right model for specific mathematical tasks.

    Mathematical performance is often used as a benchmark for the intelligence of large language models (LLMs). Constructing logical chains and transferring existing knowledge through formal proofs is inherently more difficult than recalling facts. However, with numerous models available at varying price points, a single trial is rarely conclusive. This article introduces a reusable evaluation framework and explains how to select and configure models based on the results.

    1. Define What to Test

    Before evaluation, define the task. Mathematical reasoning generally falls into three categories:

    • Computational problems primarily assess the accuracy of intermediate steps.
    • Proof-based problems evaluate whether the logic is closed and complete.
    • Open-ended problems lack standard answers and test the model’s ability to propose viable solution paths.

    Each category has different failure modes and requires distinct scoring criteria. Mixing them together will cause results to offset each other, rendering the average score meaningless.

    Start by documenting your actual needs. Are you grading student assignments, checking lemmas for a paper, or batch-verifying known conclusions? Different needs prioritize different metrics.

    2. Build the Test Set: Distinguish Memorization from Reasoning

    The core of a test set is distinguishing between “memorization” and “reasoning” tasks. Memorization tasks, such as recalling a constant’s value or a theorem’s name, can be answered directly from training data, primarily testing retrieval. Reasoning tasks require step-by-step derivation where intermediate steps cannot be directly found in existing materials. Only the latter reflects true reasoning capability.

    To construct reasoning tasks:

    1. Select clearly stated but unproven propositions from public formalized math libraries or textbook exercises.
    2. Modify existing propositions (e.g., weaken assumptions or change parameters) to create new problems requiring fresh derivation.
    3. Design small-scale counterexample tasks manually, asking the model to determine the truth value of a proposition and justify its answer.

    The test set does not need to be large but should cover your domain. Testing only algebra makes it hard to generalize to topology or number theory. Prepare at least 20 questions per domain, recording the source, difficulty, and standard answer for each. Standard answers should ideally be verified manually or by formal tools.

    3. Standardize Prompts and Avoid Leading Wording

    The same problem can yield vastly different outputs depending on the prompt. To ensure a fair comparison, all models must use the exact same prompt. An effective template typically includes four parts:

    1. A strict problem statement, including all assumptions and notation definitions.
    2. Output format requirements, such as using LaTeX, theorem environments, and step-by-step numbering.
    3. Additional constraints, like “list the lemmas used and cite their sources.”
    4. Prohibitions, such as “do not omit boundary cases.”

    Avoid leading words in prompts, such as “please explain in detail” or “provide a simple proof.” These words alter the model’s strategy, making comparisons meaningless. Once finalized, do not modify the prompt during testing.

    4. Scoring Dimensions and Rules

    Score each output across four dimensions, from 0 to 2 points each, with a maximum of 8 points:

    • Correctness: Whether each derivation step holds and if there are conceptual errors. This can be manually spot-checked or verified using automated theorem provers for formalizable parts.
    • Completeness: Whether necessary cases are omitted, especially boundary conditions and special scenarios.
    • Conciseness: Whether redundant derivations exist that can be removed.
    • Format Friendliness: Whether the LaTeX code compiles directly and if variable naming and annotations are clear.

    Blind evaluation is recommended, where reviewers do not know which model produced the output, to reduce subjective bias. If there are two reviewers, calculate an inter-rater reliability metric, such as Cohen’s kappa, and specifically discuss highly disputed items. Keep complete scoring records, including each question’s output, scoring rationale, and reviewer ID, for future review.

    5. Run Multiple Times and Capture Stable Values

    LLM outputs are inherently stochastic. The same question might be answered correctly on the first run but incorrectly on the second. Therefore, a single result does not represent the model’s capability.

    A practical approach is to run each model on each question at least five times, record the score for each run, and calculate the average score, lowest score, and variance. If four out of five runs are correct, the accuracy rate is 80%. High variance indicates instability and should be specifically flagged in the report.

    The number of runs depends on your budget. If budget is limited, start with a small number of questions run five times, observe whether variance is significant, and then decide whether to expand the sample. Regardless, clearly state the number of runs in the report to prevent readers from assuming it was a single pass.

    6. Chain of Thought Length Does Not Equal Capability

    Chain of Thought (CoT) refers to the intermediate reasoning process a model generates before the final answer. Many assume a longer CoT indicates greater rigor, which is inaccurate.

    CoT length only indicates the volume of intermediate text generated. It might be highly distilled or contain repetitive explanations. Some models produce very long, redundant reasoning yet still reach the correct conclusion. Others might have a short CoT but skip necessary conditions at a critical step. Therefore, CoT length should be evaluated alongside correctness and completeness, not used as a standalone ranking metric.

    Additionally, a longer CoT usually means more output tokens and higher API costs. Whether it is worth paying for depends on whether the task genuinely requires those intermediate steps.

    7. Measuring Cost and Efficiency

    When comparing costs, measurement conditions must be specified, or results from different individuals cannot be compared. A reliable record should include: model name and version, subscription plan or billing method, input and output token count per question, credits or cost consumed per question, response time, and the region and concurrency level during testing.

    Cost per question can be estimated using the formula:

    Cost per question = Consumed Credits × Unit Credit Price

    If the service bills per API call, convert the consumed credits into token counts first, then multiply by the unit price. Response time is affected by network, service load, and concurrency, so it should be measured multiple times under identical conditions, reporting the median.

    8. Selection Advice: Match by Task Conditions

    Selection should be based on task conditions; a model’s popularity cannot replace test results. The following describes general patterns, but final conclusions should rely on your own test set.

    • Open research requiring new ideas: Typically demands models with strong reasoning and long context. These tasks are prone to wrong paths, requiring careful manual review and more verification time.
    • Generating teaching materials: Mid-tier models are often sufficient. These tasks prioritize clear expression and complete steps rather than peak reasoning capability.
    • Batch-verifying known conclusions: If conclusions have reliable sources and verification steps are simple, a more economical configuration can be used with spot-checking.
    • Mixed math and code tasks, such as formal verification: Prioritize models with good support for structured output and programming syntax, while using compilers or proof assistants to check the results.

    Note that model capability does not scale linearly with price. Some smaller models might perform well in specific domains but fall short on cross-domain problems. It is recommended to build a “task vs. model” matrix and test each cell with real questions.

    9. Common Pitfalls

    • Judging a model based on a single question: Single-question outcomes are highly stochastic; use a set of questions at minimum.
    • Focusing only on the final conclusion: A proof might yield the correct conclusion but contain flaws in intermediate derivations. Such outputs cannot be directly used in teaching or papers.
    • Ignoring data compliance: If test questions contain unpublished research data, verify the terms of service first to avoid uploading sensitive information to inappropriate platforms.
    • Treating a one-time experience as a long-term conclusion: Models and services update continuously; test conclusions should be re-evaluated periodically.

    10. Three-Step Action Checklist

    1. Define the test set: Prepare at least 20 reasoning-type questions per task type, with clear standard answers and sources.
    2. Run multiple times: Run each model on each question at least five times, recording outputs and operating conditions.
    3. Blind evaluation and scoring: Score based on correctness, completeness, conciseness, and format friendliness. Calculate the average score and variance, then make a decision combined with cost analysis.

    By following these three steps, your conclusions will be much more aligned with your specific needs than public leaderboards.