Evaluating Mathematical Reasoning in Large Language Models: A Practical Framework and Methodology

    This article presents a reproducible framework for evaluating the mathematical reasoning capabilities of large language models (LLMs). Instead of ranking models by impression, it breaks mathematical ability into five layers of sub-tasks, scores candidates with a six-dimension scorecard, and uses fixed sampling parameters, multi-sample runs, and a three-part test set (public, variant, and private) to ensure stability. It also covers prompt and sampling strategies, common evaluation pitfalls, and how to integrate the evaluation into an engineering pipeline with regression gates and cost visibility. The methodology is product-agnostic and applies to scenarios such as coding assistants, educational tutoring, and financial calculation that require rigorous reasoning.

    1. Why “Math Ability” Is Hard to Define in One Sentence

    In model selection practice, many teams run into an awkward situation: the same model performs well on unit test generation and copywriting refinement, but as soon as it is given an open-ended math problem, the output starts to show a pattern of “steps that look reasonable but a conclusion that is wrong.” The informal practice of ranking models against each other is essentially an empirical judgment. It has value, but it is not reproducible, cannot be regression-tested, and is hard to transfer to a specific business.

    A more sound approach is to decompose “math ability” into several observable dimensions and then quantify them with a unified test set and fixed sampling parameters. Only when subjective impressions are turned into repeatable experiments do evaluation conclusions carry engineering significance.

    It is worth emphasizing that this article does not rank any specific model. Instead, it offers a methodology: when you face multiple candidate models, how to reach your own conclusions.

    2. Layering the Capability: Breaking “Math” into Measurable Sub-tasks

    A vague claim of being “good at math” is meaningless. It is recommended to split it into at least five layers, with increasing difficulty and openness:

    1. Arithmetic and numerical precision layer: multi-digit operations, unit conversion, percentages and growth rates. The focus is “does it miscalculate.”
    2. Symbolic and algebraic transformation layer: solving equations, factorization, inequality manipulation. The focus is “whether the transformation is equivalent.”
    3. Combinatorics and probability layer: counting principles, recurrences, conditional probability. The focus is “whether it double-counts or misses boundary cases.”
    4. Proof and open-ended problem layer: requires constructing an approach on its own, choosing a method, and verifying completeness. The focus is “whether it can find a path by itself.”
    5. Modeling and approximation layer: turning a real-world description into a mathematical structure, making reasonable assumptions and order-of-magnitude estimates. The focus is “whether assumptions are explicit and results are testable.”

    The “can solve open-ended math problems” discussed in the original text corresponds exactly to layer 4. This layer has the largest capability differences and is the one that should least be judged by a single case.

    3. Evaluation Framework: A Scorecard of Six Dimensions

    It is recommended to build a scorecard with the following dimensions, scoring each independently (1–5) and finally weighting them by business priorities:

    • Accuracy: whether the final answer is correct and whether verifiable intermediate quantities are provided.
    • Reasoning chain quality: whether the steps are self-consistent and whether there is any luck component of “skipping steps but getting the right conclusion.”
    • Conciseness: the length of the shortest path to a correct conclusion. Conciseness often means fewer chances to make mistakes.
    • Self-verification ability: whether it proactively performs dimensional checks, boundary tests, and back-substitution verification.
    • Stability: consistency across multiple samples of the same problem, measured by variance.
    • Explainability: whether it can explain in a human-readable way why the problem is solved this way.

    There is an easily overlooked point here: a longer chain of thought does not mean stronger ability. A long chain increases the probability of intermediate errors and context drift. When evaluating, record both “length” and “accuracy,” observe the correlation between them, and do not treat length as a capability signal.

    4. Test Set Construction: From Public to Private Problems

    The credibility of an evaluation depends on the problem distribution. A three-part construction is recommended:

    • Part A (public benchmark problems): used to align with external conclusions and ensure a clear difficulty coordinate.
    • Part B (variant problems): change the numbers, change the phrasing, add distractor conditions, to test whether there is real understanding rather than memorization.
    • Part C (private business problems): real problems from your own business scenarios, with the highest weight.

    When problems are added to the set, they should carry metadata: the layer they belong to, the standard answer, the acceptable set of solutions, and scoring points. This is what enables automated scoring and regression.

    1. {
    2. "id": "C-0231",
    3. "layer": "proof_open",
    4. "prompt": "Prove that for any positive integer n, the parity of a certain recurrence sequence follows a pattern with period 3.",
    5. "rubric": ["state initial terms clearly", "write the induction hypothesis clearly", "cover n=1,2,3 boundary cases", "verify the conclusion by back-substitution"],
    6. "weight": 1.5
    7. }

    5. Experimental Procedure: Making Conclusions Reproducible

    Fixing variables is the prerequisite for reproducibility. At minimum, fix: temperature and sampling parameters, maximum output length, system prompt, whether tools are enabled, and the version of the scoring script. The recommended procedure is as follows:

    1. Run Parts A/B/C with a fixed prompt, sampling each problem k times (k is recommended to be 3–5).
    2. Record the final answer of each output, the step length, and whether self-verification was triggered.
    3. Use a dual-track check of rule-based scoring plus manual spot checks, with a spot-check ratio of no less than 10%.
    4. Compute the mean and variance of accuracy, and output a layered radar chart.
    5. For models with no significant difference, label them “indistinguishable” to avoid false conclusions.

    An illustrative evaluation loop:

    1. def evaluate(model_client, items, k=5, temperature=0.2):
    2. report = []
    3. for it in items:
    4. runs = [model_client.solve(it["prompt"],
    5. temperature=temperature) for _ in range(k)]
    6. correct = sum(score(r, it["rubric"]) for r in runs)
    7. report.append({
    8. "id": it["id"],
    9. "layer": it["layer"],
    10. "accuracy": correct / k,
    11. "avg_steps": mean(len(r.steps) for r in runs),
    12. "variance": var([score(r, it["rubric"]) for r in runs])
    13. })
    14. return aggregate_by_layer(report)

    6. Prompt and Sampling Strategies: Suppressing Uncertainty

    The same model can perform very differently under different strategies, with differences that may exceed the differences between models. Therefore, the strategy must be part of the experimental design:

    • Require explicit step-by-step work: have the model first list known quantities, target quantities, and constraints, then solve.
    • Enforce a self-check instruction: require back-substitution verification or a dimensional check as the last step.
    • Multi-sample voting: take a majority vote at the answer level, which can significantly reduce sporadic errors.
    • Decompose then synthesize: split complex problems into sub-problems first, then combine the conclusions, reducing long-chain drift.
    • Separate tools from computation: hand large-number arithmetic and symbolic simplification to deterministic computation components, and let the model handle modeling and explanation.

    A concise system prompt skeleton:

    1. You are a math problem-solving assistant. Please output in the following structure:
    2. 1) knowns and constraints; 2) solution approach (no more than 5 steps);
    3. 3) derivation; 4) verification (back-substitution or boundary check); 5) final answer.
    4. If information is insufficient, list assumptions first and then continue.

    7. Common Pitfalls and Interpretation Principles

    • Drawing conclusions from a single case: the noise of a single win or loss is huge, so a sufficient sample size is needed.
    • Treating length as ability: a long reasoning chain only means a verbose path and must be observed jointly with accuracy.
    • Ignoring problem leakage: public problems may be memorized, so variant problems must be used for cross-validation.
    • Confusing “can calculate” with “can prove”: numerical correctness does not mean a complete proof.
    • Ignoring cost constraints: enterprise selection needs to look at latency, throughput, and cost per task at the same time, not just accuracy.

    The interpretation principle can be summarized in one sentence: first look at layered accuracy, then stability, and finally cost per unit; only when all three are indistinguishable can you say the capabilities are “comparable.”

    8. Engineering Implementation: Integrating Evaluation into the R&D Process

    Make evaluation a pipeline rather than a one-off report:

    1. Data management: put problems and scoring points under version control, with traceable changes.
    2. Automated scoring: rule-based scoring covers objective problems, while subjective proof problems go through a manual spot-check queue.
    3. Regression gate: when a candidate model or prompt changes, run the full set automatically; block the release if accuracy drops beyond a threshold.
    4. Observability: connect call logs, elapsed time, and failure reasons to a logging service and monitoring alerts to form a closed loop.
    5. Cost view: combine the actual resource consumption of the container platform and message queue to calculate the cost per task.

    For cloud implementation, object storage can hold evaluation datasets and result snapshots, a container platform can host evaluation tasks to ensure environment consistency, and monitoring alerts can track regression metrics. General cloud product categories offered by cloud vendors such as Baidu AI Cloud can typically cover the data, compute, and observability needs above; specific selection should be based on your own compliance and cost constraints.

    9. Conclusion

    Judging a model’s math ability should shift from “impression-based ranking” to “reproducible layered evaluation.” Break math into five layers of sub-tasks, quantify with a six-dimension scorecard, ensure stability with fixed parameters and multi-sampling, and then connect regression gates and a cost view. This way, you can reach reliable conclusions even without a unified leaderboard. This method does not depend on any specific product and applies to business scenarios that require rigorous reasoning, such as coding assistants, educational tutoring, and financial calculation.