Evaluating and Selecting LLMs for Mathematical Reasoning: A Practical Guide
This guide explains how to evaluate large language models for mathematical reasoning and choose the right one for production use. It covers why hands-on impressions are unreliable, how to break capability into four testable layers, how to build a reproducible evaluation pipeline with automated and sampled grading, how prompt and context engineering can remove usage-related noise, and how to factor compute and human costs into selection through tiered routing. A deployment checklist is included.
1. Background: Why “It Feels Strong” Is Not the Same as “Usable”
In real projects, many teams judge model capability from scattered experiences: one impressive answer, a piece of fluent copy, or a demo that keeps getting shared. Once the work becomes serious — formal proofs, solution generation under complex constraints, consistency-preserving rewrites of long documents — experience-based judgment breaks down quickly.
One useful signal from the original discussion is that content generation tasks (such as story scripts) and mathematical reasoning tasks do not improve in lockstep. The former depends more on corpus distribution and style alignment; the latter depends more on rigor across long chains and the ability to self-check. Treating the two as the same thing is a common starting point for selection mistakes.
So the first step in evaluation is not to ask “which model is the strongest,” but to decompose the business into decidable task families and then define a “pass line” for each family. The pass line should not be a subjective impression; it should be an acceptance condition that can be checked automatically.
2. Capability Layers: Turning Vague “Intelligence” into Measurable Dimensions
It helps to split capability into four layers and set acceptance criteria for each:
- Instruction following and format constraints: can it reliably produce the required structure (document, table, code block) with no missing or out-of-bounds fields?
- Single-step knowledge correctness: are concepts, definitions, and theorem statements accurate, or do plausible-but-wrong statements appear?
- Multi-step reasoning rigor: is every step justified, or are there circular arguments, hidden assumptions, and skipped steps?
- Long-context consistency: across long inputs and long outputs, does it keep symbols unified, numbering continuous, and earlier and later content non-contradictory?
A skeletal acceptance spec can be written as structured configuration so it fits into continuous integration:
task_family: math_proofacceptance:format: latex_document # structure must be parseablemust_pass: [no_circular_reasoning, no_undefined_symbols]grader: rule_based + human_samplesample_size: 50pass_threshold: 0.9cost_guard:max_tokens_per_task: 200000retry: 1
The key point: acceptance conditions must consist of rules or a checklist that can be sampled and reviewed, not “it reads well.”
3. A Reproducible Evaluation Process: From Cases to Baselines
Scattered cases cannot support a decision; evaluation needs a process.
- Build the task set: draw from real historical requirements, covering easy, medium, and hard tiers, so you neither cherry-pick only hard items nor only easy ones.
- Standardize inputs: fix the prompt template, context length, and sampling parameters such as temperature to reduce misjudgment caused by randomness.
- Automate judgment: anything a compiler, unit tests, symbolic checks, regex, or structural parsing can decide should be automated.
- Sample for human review: for what cannot be judged automatically, sample at a fixed ratio using the same scoring checklist to limit subjective drift.
- Keep records: save inputs, outputs, verdicts, and version numbers to form a regression-capable baseline.
A minimal executable evaluation loop:
def evaluate(model_client, cases, grader):report = []for c in cases:out = model_client.run(c.prompt, params=c.fixed_params)r = grader.check(out, c.acceptance)report.append({"id": c.id, "pass": r.passed, "reasons": r.reasons})return summarize(report) # pass rate, failure type distribution, average cost
Only when the failure distribution concentrates stably in one layer (for example, always skipping steps at layer 3) can you conclude something like “architecture-independent, needs a stronger foundation model”; otherwise the problem is more likely in the prompt or the process.
4. Prompt and Context Engineering: Rule Out “How It Is Used” First
Before concluding “the model is not good enough,” you must rule out interference from usage patterns. The most reliably beneficial practices are:
- State the output contract explicitly: give the structure first, then the content requirements, to reduce format drift.
- Step by step plus self-check: require listing knowns and definitions first, then deriving step by step, then running one consistency check.
- Minimize context: include only material relevant to the current subtask; split long documents before summarizing to avoid attention dilution.
- Put the glossary first: fix symbols and naming to reduce symbol drift in long outputs.
- Feed failures back: turn failed samples into a regression set and rerun after every change.
Note that these techniques can substantially raise the usable rate but cannot create capability the foundation model lacks. Engineering addresses stability and consistency; the capability ceiling is still set by the model itself.
5. Cost and Human-AI Collaboration: Do the Math Before Committing
The original discussion mentions quota consumption and effort after heavy use, which suggests cost must be an evaluation dimension, not just quality.
- Cost per task: measure input, output, retries, and long-context consumption separately.
- Human guidance cost: tasks needing many hands-on correction rounds cost far more than the surface API spend.
- Marginal benefit judgment: when the gain from higher quality falls below the compute and human investment, stop fine-tuning and switch to a simpler process.
- Tiered routing: send easy tasks to a low-cost configuration and escalate hard tasks to a stronger configuration or human fallback, instead of one-size-fits-all.
Sketch of the logic:
if task_difficulty == low and format_check_pass:use_basic_pipelineelif task_difficulty in (medium, high):use_strong_pipeline + human_reviewelse:fallback_to_manual
On the cloud, general-purpose capabilities can carry this flow: object storage holds evaluation samples and reports, a message queue decouples evaluation jobs, a container platform hosts reproducible evaluation environments, and logging plus monitoring with alerting track pass rate and cost fluctuations. Baidu AI Cloud typically lands this kind of engineering evaluation and observability work with the same general category combinations described above.
6. Common Pitfalls and Judgment Discipline
- Substituting scale narratives for evaluation: parameter scale correlates with emergent ability, but performance on a specific task must be verified with your own task set.
- Extrapolating from a single case: one success does not prove stable usability, and one failure is not enough to reject the whole.
- Confusing task families: style generation and rigorous reasoning are different capabilities and need separate pass lines.
- Ignoring randomness: without fixed sampling parameters, results are not reproducible.
- Overreaching promises: do not assert unverified capabilities, interfaces, or performance metrics, or your selection basis becomes distorted.
7. Implementation Checklist
- Define task families and pass lines in a written acceptance standard.
- Build a three-tier difficulty task set with fixed inputs and sampling parameters.
- Prioritize automated judgment, use human sampling as backup, and keep records throughout.
- Do prompt and context engineering first to rule out usage interference.
- Track quality, compute, and human costs, and make marginal benefit judgments.
- Establish tiered routing and a regression mechanism, and rerun baselines after model updates.
Following this process, a team can build its own reproducible, regression-capable evaluation system even without a unified authoritative ranking, turning “feel” into data that supports decisions.
