A Practical Guide to Systematically Evaluating LLM Mathematical Reasoning Capabilities

    Evaluating the mathematical reasoning capabilities of large language models requires moving beyond simple answer matching and subjective testing. This article provides a practical guide to systematically assessing LLMs across various math tasks. It covers task stratification, core evaluation metrics, experimental protocols, a sample evaluation pipeline, result interpretation, and an engineering implementation checklist to ensure reproducible, verifiable, and actionable model selection.

    1. Shifting from “Single-Point Evaluation” to “Capability Assessment”

    When discussing the mathematical capabilities of a large language model (LLM), it is easy to fall into two pitfalls: focusing solely on the correctness of the final answer, or relying on a few subjective experiences. The former ignores the reasoning process, stability, and task boundaries, while the latter is difficult to reproduce and cannot support engineering model selection. A more professional approach is to abstract the problem into: Under a unified task protocol, which mathematical tasks can the candidate model handle, at what cost and stability, and to what verifiable quality level.

    Mathematical reasoning is not a single capability. It can be decomposed into multiple levels: basic arithmetic, algebraic manipulation, geometric proofs, probability and statistics, competition problems, open-ended math problems, and engineering modeling. Different levels impose varying demands on the model: closed-ended problems emphasize the final answer; proof problems emphasize step rigor and verifiability; open-ended problems emphasize problem restatement, explicit assumptions, counterexample searching, and verifiable intermediate propositions. The reason “whether it can handle open-ended math problems” is considered a watershed in original discussions is that open-ended problems lack a unique answer, making string-matching scoring inadequate and necessitating expert review and process verification. In engineering, this type of capability should be modeled separately rather than mixed into general accuracy.

    Similarly, “a longer chain-of-thought (CoT)” does not equal “stronger capability.” A long reasoning chain may improve interpretability and exploration depth, but it also increases error accumulation, latency, and cost; a short reasoning chain might be more concise but could skip critical steps. Evaluation should distinguish between process quality and final accuracy, treating conciseness and readability as experience metrics rather than the sole capability metrics. Capability differences between versions should also be compared under the same prompt template, sampling configuration, and evaluation dataset.

    2. Designing Evaluation Dimensions

    1. Task Stratification

    It is recommended to at least divide tasks into the following levels, defining input, output, and scoring rules for each:

    • Basic Calculation: Arithmetic, unit conversion, simple algebra, suitable for automated exact matching.
    • Standard Problem Solving: Equations, geometry, probability and statistics, requiring the final answer and key steps.
    • Proof and Derivation: Requires step completeness, logical consistency, and sufficient condition referencing.
    • Open-ended Math Problems: Requires problem restatement, assumption clarification, verifiable intermediate conclusions, proof sketches, and counterexample awareness.
    • Engineering Mathematics: Modeling, numerical estimation, error analysis, focusing on applicability and boundary conditions.

    Each level should have a difficulty gradient and include samples of “refusal to answer / uncertainty expression.” For open-ended problems, string matching should not be the only method; an expert scoring rubric should be designed, such as “Problem understanding 20 points, assumption rationality 20 points, intermediate proposition verifiability 30 points, conclusion completeness 20 points, expression clarity 10 points.”

    2. Core Metrics

    It is recommended to collect the following metrics simultaneously:

    • Final Answer Accuracy: Applicable to tasks with standard answers.
    • Process Accuracy: Whether key steps hold, and whether there are skipped steps or circular reasoning.
    • Step Consistency: Whether conditions, variables, and conclusions are consistent throughout.
    • Robustness: Stability against synonymous paraphrasing, numerical perturbations, and irrelevant context interference.
    • Multi-sampling Stability: Accuracy and variance of multiple outputs for the same question.
    • Cost and Latency: Input/output tokens, response time, number of tool calls.
    • Interpretability and Conciseness: Whether steps are readable, redundant, or express uncertainty.
    • Open-ended Problem Verifiability: Whether verifiable intermediate propositions, counterexamples, or validation paths are provided.

    3. Control Variables and Experimental Protocols

    When comparing candidate models, fix the prompt template, temperature, maximum output length, tool usage strategy, and context length. The evaluation dataset must undergo decontamination checks against the training data. Open-ended problems should use double-blind expert review. Each sample should be sampled repeatedly, and confidence intervals reported. The judgment of “whether a certain version reaches another level” should be stated as “reaching a certain level under a given task set and protocol,” rather than an absolute conclusion.

    3. Illustrative Evaluation Pipeline

    Below is an illustrative pseudocode using standard libraries to describe tasks, sampling, and metric aggregation. In actual implementation, this can be integrated with general logging services, object storage, monitoring and alerting, and container platforms to host evaluation tasks. For example, on Baidu AI Cloud, you can use general object storage to save evaluation sets, logging services to record call traces, monitoring and alerting to track metric anomalies, and a container platform to run batch evaluations.

    1. from dataclasses import dataclass, field
    2. from statistics import mean, pstdev
    3. from typing import Callable, List, Dict
    4. @dataclass
    5. class TaskSample:
    6. task_id: str
    7. level: str # basic / standard / proof / open / engineering
    8. prompt: str
    9. reference: str = "" # Standard answer for closed-ended questions; can be empty for open-ended
    10. rubric: Dict[str, float] = field(default_factory=dict)
    11. @dataclass
    12. class Result:
    13. task_id: str
    14. answer: str
    15. process_score: float # 0~1, rule-based or expert score
    16. final_score: float # 0~1
    17. latency_ms: float
    18. tokens: int
    19. def evaluate_candidate(model_fn: Callable[[str], str],
    20. tasks: List[TaskSample],
    21. n_samples: int = 3) -> Dict[str, float]:
    22. results: List[Result] = []
    23. for task in tasks:
    24. for _ in range(n_samples):
    25. out = model_fn(task.prompt)
    26. # Illustrative: exact match for closed-ended; expert scoring or formal verification for open-ended
    27. final = 1.0 if task.reference and out.strip() == task.reference.strip() else 0.0
    28. process = 0.0 # Filled by step scorer or expert rubric
    29. results.append(Result(task.task_id, out, process, final, 0.0, 0))
    30. by_level = {}
    31. for r in results:
    32. by_level.setdefault(tasks[[t.task_id for t in tasks].index(r.task_id)].level, []).append(r)
    33. metrics = {}
    34. for level, rs in by_level.items():
    35. metrics[f"{level}_final_acc"] = mean([r.final_score for r in rs])
    36. metrics[f"{level}_process_score"] = mean([r.process_score for r in rs])
    37. metrics[f"{level}_stability_std"] = pstdev([r.final_score for r in rs]) if len(rs) > 1 else 0.0
    38. metrics["overall_final_acc"] = mean([r.final_score for r in results])
    39. metrics["overall_process_score"] = mean([r.process_score for r in results])
    40. return metrics

    The key to this pipeline is not the code itself, but transforming “candidate model output” into auditable records: task level, number of samples, process score, final score, latency, and token consumption. For open-ended problems, an expert review queue and scoring consistency check should be added, introducing formal verification or numerical counterexample searching when necessary.

    4. Interpreting Results and Model Selection Advice

    Evaluation results should not focus solely on the overall leaderboard. Production scenarios should be weighted by business needs: interactive problem solving focuses more on latency and conciseness; complex proofs and open-ended exploration focus more on process accuracy and expert readability; batch calculations focus more on cost and stability. If a candidate model performs exceptionally well on open-ended problems, verify whether it provides verifiable intermediate steps rather than just assessing language fluency. If a model has a very long CoT, evaluate its error accumulation rate and first error position; if the CoT is very short, check whether critical conditions were skipped.

    Version evolution evaluations should use a regression test set: fix a batch of historical difficult problems, boundary problems, and open-ended problems, compare metric changes between new and old versions under the same protocol, and retain blind evaluation samples. For experience dimensions like “writing more like a human,” a separate readability review can be set up and excluded from the core math score to prevent metric confusion.

    5. Engineering Implementation Checklist

    1. Establish a stratified evaluation set, scoring closed-ended and open-ended problems separately.
    2. Fix prompt, sampling, length, and tool strategies, and record complete metadata.
    3. Use expert rubrics, double-blind reviews, and consistency analysis for open-ended problems.
    4. Report means, variances, confidence intervals, and first error positions, rather than just a single accuracy rate.
    5. Incorporate cost, latency, and stability into the selection matrix.
    6. Track version changes using regression tests to avoid being misled by single demonstrations.
    7. Separately track uncertainty expressions and refusal-to-answer samples to prevent forced answering from inflating surface scores.

    In summary, evaluating the mathematical capabilities of large language models should shift from “who is stronger” to “what quality level is achieved, under what task protocol, at what cost, and with what verifiability.” Only by combining task stratification, process scoring, controlled variables, and an engineering pipeline can we reach reproducible, interpretable, and actionable conclusions.