Evaluating Large Language Models on Advanced Mathematical Reasoning: A Practical Framework

    This article presents a reproducible, quantitative framework for evaluating large language models on high-difficulty mathematical reasoning tasks, where per-interaction cost and per-task output cost diverge sharply. It explains why open-ended math problems serve as a better litmus test than standard benchmarks, how to design problem sets that resist memorization, and how to judge results through a three-layer verification mechanism spanning automated checks, rule-based review, and expert blind review. It also defines a four-dimension scoring model (correctness, rigor, expression quality, and economics), a cost-and-speed methodology for deciding whether higher spending actually improves accuracy, and an engineering pipeline with sample code. Readers will gain a practical baseline for model selection, budgeting, and product design, along with a checklist of common evaluation pitfalls.

    1. Introduction: The Gap Between “Expensive” and “Worth It”

    Discussions in developer communities often surface two seemingly contradictory views of the same subscription tier: some find it “expensive without any sense of where the value lies,” while others feel it is “expensive but justified.” Price alone cannot explain this difference. A more reasonable explanation is that the first group measures cost per interaction, while the second measures cost per unit of task output—and the gap between the two shows up precisely on high-value, high-difficulty tasks.

    Advanced mathematical reasoning is a typical scenario for testing the upper limit of a model’s capability. Such problems usually satisfy three conditions at once:

    • No ready-made solution can be easily retrieved from public resources;
    • Extremely high demands on the rigor and completeness of the reasoning chain;
    • A single output often consumes tens of thousands to hundreds of thousands of reasoning tokens, making cost a significant factor.

    When the investment is this substantial, a systematic method is all the more warranted to answer three questions:

    1. Can the model get it right?
    2. How good is the output?
    3. Is it worth the cost?

    This article attempts to turn a subjective experience—“can the model solve open-ended math problems?”—into a reproducible, quantifiable evaluation system, helping developers make grounded decisions about model selection, budgeting, and product design.

    2. Capability Tiers: Why Open-Ended Math Problems Are a Litmus Test

    Conventional math benchmarks typically rely on standard problem sets whose solutions already exist widely in training corpora. Such evaluations reflect a baseline level but struggle to distinguish among top-tier models, for two reasons:

    • Data contamination: A model may simply “remember” the answer rather than actually reasoning.
    • Ceiling effect: Top models’ accuracy rates tend toward saturation, providing insufficient discrimination.

    Open-ended math problems neatly sidestep both issues. Take, for example, entries in a public mathematical resource library that state a proposition without an accompanying proof:

    • The model cannot simply “copy” an existing proof and must construct the argument itself;
    • The proof requires multi-step, in-depth reasoning;
    • The correctness of the conclusion is relatively objective, making it easy to organize manual or formal verification.

    For these reasons, open-ended math problems can be treated as a litmus test for a large model’s reasoning ability. They form a clear dividing line with conventional problems: a model that scores well on standard questions may still fail to complete a research-level proof, while a model that produces a seemingly rigorous proof may harbor flaws in a key step. Capturing and quantifying this difference is precisely the core of what evaluation must achieve.

    3. Designing the Problem Set: Making Problems Resistant to Memorization

    To make evaluation results credible, the first step is to ensure the problems are “new” to the model.

    3.1 Construction Strategies Against Memorization Contamination

    • Choose propositions with no ready-made proof: Prioritize entries in mathematical resource libraries that state a proposition without an attached proof, and note that entry contents change as the library is updated, so periodic re-review is required.
    • Equivalent transformations: Apply symbol substitution, adjustment of condition strength, or contrapositive rewriting to existing results. For example, changing “for every integer n” to “for all n ≥ N” tests whether the model can recognize when a conclusion breaks down.
    • Synthesis and generalization: Build parameterized generalizations on top of existing results, or combine multiple concepts into a new proposition to reduce overlap with public corpora.

    3.2 Mixing True and False to Test “Counterexample Recognition”

    The evaluation set should not contain only provable propositions; it should also include problems whose propositions do not hold. Take the classic example “for any positive integer n, n² + n + 41 is prime.” Many models will follow the “prove it” instruction and search for an argument, while overlooking cases such as n = 40 (where the result is 41²). The evaluation should explicitly require: if a proposition is false, a counterexample must be provided. This dimension directly tests whether a model “defaults to accommodating the problem’s premise.”

    3.3 Prompts: State Only the Goal and Requirements, Not the Method

    A good evaluation prompt should stay close to real usage, describing only the task goal and output requirements without revealing the solution path. Below is a general template, using the example of “requiring the model to prove an unproven proposition from a resource library and output it as a structured, formatted English lecture note”:

    1. [Task] Prove the following mathematical proposition:
    2. <Paste the complete statement of the proposition here>
    3. [Output Requirements]
    4. 1. Write an English lecture note using structured formatting syntax, including:
    5. the proposition statement, notation and conventions,
    6. the main lemmas (with proofs), the theorem proof,
    7. and a note on the key conditions under which the conclusion holds;
    8. 2. Do not skip key steps in the proof; justify each citation;
    9. 3. If you believe the proposition is false, provide an explicit counterexample
    10. and explain why, rather than forcing a proof.

    Two design points in this template are worth emphasizing:

    • State the proposition only, without hinting at a method: Once a prompt contains a solution idea, the evaluation actually measures “whether the model can understand and expand on the hint” rather than its independent reasoning ability.
    • Explicitly provide a “negation exit”: Allowing the model to judge a proposition false prevents the results from being contaminated by the model’s tendency to agree.

    4. Judging Results: A Three-Layer Verification Mechanism

    The correctness of a mathematical proof cannot be judged by whether it “looks reasonable.” A three-layer verification is recommended:

    Layer Applicable Scenarios Judgment Method Judge
    L1 Automated checking Propositions that are computable or formalizable Numerical verification, symbolic computation, interactive theorem prover checking Program
    L2 Rule-based review All proof-type responses Checks notation definitions, lemma citations, and coverage of boundary cases Script
    L3 Expert blind review Open-ended proofs, lecture-note quality Independent scoring by multiple reviewers, with arbitration of disagreements Experts

    In L3 blind review, two typical problems also warrant attention:

    • Skipped key steps: The overall proof framework is correct, but the single most important step is written off as “easily verified” or “follows by symmetry.”
    • Implicit citations: Directly invoking a conclusion that is not provided, or that does not even exist.

    These problems are most easily masked by the appearance of a “correct conclusion.” Therefore, expert review must not look only at the conclusion; it must check the reasoning chain step by step.

    5. Scoring Dimensions: From “Correct” to “Good and Worth It”

    It is advisable to divide evaluation into four top-level dimensions, with weights set per scenario:

    Top-level Dimension Sub-metrics Description
    Correctness First-attempt accuracy, at-least-one-correct in k samples, error rate, fabrication rate, proposition discrimination accuracy Whether there are fabricated citations or untenable lemmas
    Rigor Completeness of key steps, notation consistency, boundary-case coverage, quality of proof strategy Whether steps are skipped or special cases omitted
    Expression quality Structural clarity, terminological accuracy, language fluency, formatting standards Whether it can be used directly as a lecture note
    Economics Cost per task, cost per success, time to first token, generation speed, output length Actual investment under budget constraints

    Each metric can use a five-level scale:

    • 1: Contains key errors or fabricated content;
    • 2: Correct conclusion but with obvious gaps in the argument;
    • 3: Correct conclusion and a largely complete argument, but average readability;
    • 4: Rigorous and clear, ready for delivery;
    • 5: Concise, elegant argumentation with publication-grade expression.

    The weighted composite score is computed as follows:

    1. S = w1 × Correctness + w2 × Rigor + w3 × Expression − λ × NormalizedCost

    Here, the weights w1, w2, and w3 are adjusted according to the business scenario. For automatically generating lecture notes, expression quality carries a higher weight; for assisting research proofs, rigor carries the highest weight. λ is a cost penalty coefficient that reflects budget constraints. NormalizedCost must first be normalized to the same range to avoid cost units affecting dimensional consistency.

    6. Cost and Speed: Calculating Whether “Expensive” Is “Worth It”

    6.1 Unifying the Cost Basis

    Billing methods differ greatly across vendors, so the basis must be unified before comparing costs:

    1. Cost per task = input tokens × input unit price + output tokens × output unit price
    2. Cost per success = total cost ÷ number of successful tasks

    Here, output tokens usually include chain-of-thought and other intermediate reasoning content. Open-ended proof tasks often generate a large volume of intermediate reasoning tokens, and this portion of the cost is easily underestimated.

    Subscription users can convert “one task consumes about 2% of the monthly quota” into a count: if only these tasks are run, the monthly quota is theoretically exhausted in about 50 runs. If a team needs to process lecture notes in bulk, the per-task cost must be factored into the project budget.

    6.2 Distinguishing Price from Value

    If a cost increase comes mainly from “longer reasoning” rather than “higher accuracy,” the marginal cost-effectiveness declines. Therefore, the reasoning budget (which controls the length of the thinking process) can be set as a controlled variable to plot a cost–accuracy curve:

    • Steep segment: Each additional unit of cost yields a marked accuracy gain—this is “expensive but justified.”
    • Flat segment: Continuing to add cost yields little improvement—this is “expensive without any perceptible benefit.”

    6.3 Configurable and Reproducible

    Ideally, the reasoning budget should be configurable by task difficulty, while evaluation fixes it to a uniform value to ensure comparability across models. At the same time, the following variables should be locked in the evaluation framework:

    • System prompt and problem version;
    • Sampling parameters;
    • Maximum thinking tokens;
    • Random seed (where supported by the inference service).

    7. An Engineering Evaluation Pipeline

    Only by consolidating evaluation into an automated pipeline can comparable data be obtained continuously and reliably. The overall flow is: maintain the problem set → generate outputs → run automated checks → conduct expert blind review → aggregate and analyze. The core code is below; it describes the evaluation flow only, and specific interfaces must be adapted to the actual environment:

    1. from dataclasses import dataclass, field, asdict
    2. from typing import Callable, Protocol
    3. class ModelClient(Protocol):
    4. """Model client protocol: abstracts vendor differences, defining only input and output"""
    5. def complete(self, prompt: str, *, seed: int, max_thinking_tokens: int) -> "ModelResponse":
    6. ...
    7. @dataclass(frozen=True)
    8. class EvalConfig:
    9. seed: int = 42 # Fixed random seed
    10. runs: int = 3 # Number of repeated samples per problem
    11. max_thinking_tokens: int = 32768 # Fixed reasoning budget to ensure cross-model comparability
    12. baseline_tokens: int = 32768 # Cost baseline for normalization
    13. @dataclass
    14. class ModelResponse:
    15. text: str
    16. input_tokens: int
    17. output_tokens: int # Includes chain-of-thought and other intermediate reasoning
    18. latency_ms: int # Time to first token
    19. total_time_ms: int # End-to-end latency
    20. @dataclass
    21. class Task:
    22. task_id: str
    23. prompt: str # States only the goal and output requirements; does not reveal the method
    24. statement_true: bool # Whether the proposition is true; used to compute discrimination accuracy
    25. source_note: str = ""# Problem source and selection date, for auditing data contamination
    26. def evaluate(client: ModelClient, task: Task, checker: Callable[[str], bool],
    27. config: EvalConfig) -> dict:
    28. """Single-problem evaluation: automatic judging + blind review queue + cost accounting"""
    29. records = []
    30. for i in range(config.runs):
    31. resp = client.complete(task.prompt,
    32. seed=config.seed + i,
    33. max_thinking_tokens=config.max_thinking_tokens)
    34. records.append({
    35. "passed": checker(resp.text), # Counted as correct only if both conclusion and argument pass
    36. "answer": resp.text,
    37. "input_tokens": resp.input_tokens,
    38. "output_tokens": resp.output_tokens,
    39. "latency_ms": resp.latency_ms,
    40. "total_time_ms": resp.total_time_ms,
    41. })
    42. # 1) Proposition discrimination: when the model judges it false, can the program verify the counterexample?
    43. if not task.statement_true:
    44. counterexample_ok = any(
    45. not r["passed"] and has_valid_counterexample(r["answer"])
    46. for r in records
    47. )
    48. # 2) Blind review: submit anonymously with model identifiers removed; multiple reviewers score independently and arbitrate disagreements
    49. review_scores = submit_blind_review(
    50. [r["answer"] for r in records],
    51. rubric=["correctness", "rigor", "expression"],
    52. reviewers=3,
    53. )
    54. # 3) Cost: cost per success + cost ratio relative to the baseline
    55. total_cost = sum(r["input_tokens"] + r["output_tokens"] for r in records)
    56. base_cost = task_baseline_cost(task, config) # Total tokens for the same problem under the baseline config
    57. pass_count = sum(r["passed"] for r in records)
    58. return {
    59. "task_id": task.task_id,
    60. "pass_at_1": pass_count / config.runs,
    61. "cost_per_task": total_cost / config.runs,
    62. "cost_per_success": total_cost / pass_count if pass_count else None,
    63. "cost_ratio_vs_baseline": total_cost / base_cost,
    64. "latency_ms_p50": sorted(r["latency_ms"] for r in records)[config.runs // 2],
    65. "tokens_per_second": round(sum(r["output_tokens"] for r in records) * 1000
    66. / sum(r["total_time_ms"] for r in records), 1),
    67. "counterexample_ok": counterexample_ok if not task.statement_true else None,
    68. "review_scores": review_scores,
    69. }

    In this pipeline, cost-effectiveness can be measured by “composite score relative to baseline cost.” For example, Model A has a composite score of 80 at twice the baseline model’s cost; Model B has a composite score of 65 at the same cost as the baseline. Then A’s cost-effectiveness is 40 and B’s is 65. This shows that a higher-scoring model is not necessarily more cost-effective, and evaluation must output both quality and cost data.

    An evaluation platform needs to support fairly large-scale concurrent calls while ensuring results are traceable. On Baidu AI Cloud, the following general product categories can be combined:

    • Object storage: stores the problem set, run records, and review results;
    • Message queue: asynchronously distributes evaluation tasks;
    • Container platform: elastically scales evaluation and inference services;
    • Logging and monitoring/alerting: tracks call volume, failure rate, and latency.

    This architecture applies equally to multi-model side-by-side comparison.

    8. Common Pitfalls and a Checklist

    1. Relying only on leaderboard rankings: Leaderboards emphasize general knowledge Q&A and have limited relevance to open-ended reasoning tasks;
    2. Ignoring memorization contamination: A model may simply have “memorized” the answer; equivalent transformations and periodic problem rotation effectively mitigate this;
    3. Judging quality by length: The longest chain of thought is not the best reasoning. A concise, natural argument is equally an important capability;
    4. Defaulting errors to zero: Counting only “correct” cases while ignoring “confidently wrong” ones underestimates the real risk posed by fabrication;
    5. Concluding from a single sample: Accuracy on open-ended proofs fluctuates considerably; sample multiple times and report the mean and variance;
    6. Inconsistent cost bases: Vendors bill chain-of-thought tokens differently, so a cost comparison without a unified basis is meaningless.

    9. Conclusion

    Around the question of “how to evaluate advanced mathematical reasoning models,” a concise practical path can be distilled:

    1. Select problems: Center on unproven propositions from public resource libraries, supplemented by equivalent transformations and a mix of true and false statements;
    2. Pose the question: Give only the goal and output requirements, and provide a “negation exit” allowing for a false proposition;
    3. Judge: Combine automated checking with expert blind review, focusing on skipped steps and fabricated citations;
    4. Measure: Score across the four dimensions of correctness, rigor, expression quality, and economics, and output cost per success;
    5. Operate: Lock evaluation parameters, automate the pipeline, and periodically update the problem set.

    For developers, rather than debating “which model is the strongest,” it is better to build a reproducible evaluation baseline around your own business. Only when capability, cost, and business goals are measured simultaneously under the same set of metrics will “expensive” and “worth it” transform from subjective impressions into engineering conclusions that can be calculated and optimized.