Evaluating Large Language Models for Mathematical Reasoning and Instruction Following
This article presents a practical evaluation framework for selecting large language models based on measurable criteria rather than subjective impressions. It breaks mathematical capability into four layers, from basic computation to open-domain proof and formalization, and shows how to score correctness, rigor, constraint adherence, conciseness, and reproducibility. It also covers instruction-following constraints, the difference between reasonable and excessive refusals, and how to model quota consumption, queueing latency, and retry costs as engineering metrics. A compliant workflow for patch analysis and reverse engineering is included, along with guidance on building an internal evaluation matrix for repeatable, risk-controlled model selection.
1. Why “It Feels Good” Is Not a Selection Criterion
Engineering teams often run into the same scenario: a new model version looks impressive in a demo, but once it is wired into a real pipeline, instruction following degrades, refusal rates climb, and long reasoning chains break. The core issue described here is not whether one version is stronger than another, but a mismatch between evaluation methods and business goals: scattered subjective impressions replace reproducible benchmarks, and a single success replaces statistical stability.
Fixing this requires splitting “is the model good?” into three measurable questions:
- Capability boundaries: where the model’s ceiling sits for mathematical proofs, formal derivations, and long logical chains;
- Controllability: whether the model strictly honors constraints on format, language, length, and citation style;
- Engineering usability: whether per-task cost, queueing latency, rate-limiting behavior, and the cost of failed retries are acceptable.
Only when all three are evaluated together can teams avoid the common trap of a model that shines in demos and stumbles in production.
2. Layering Capability: Breaking “Math Ability” into Testable Items
Saying a model is “good at math” in general terms is meaningless. It is better to split evaluation into four layers and increase pressure layer by layer:
- L1 Calculation and algebraic manipulation: solving equations, matrix operations, standard routines for limits and integrals;
- L2 Combinatorics and probabilistic modeling: problems that require constructing auxiliary structures or case-by-case analysis;
- L3 Open-domain proof: problems with no ready-made solution, where the model must find its own proof path, such as propositions in algebraic geometry or commutative algebra not covered by standard textbooks;
- L4 Formalization and writing: rewriting a proof as a structured document with consistent notation, proper citations, and no circular reasoning.
The original text mentions “having the model prove a proposition whose proof is missing from a math library and output lecture notes,” which is essentially a combined L3+L4 test. The value of such tests is that they cannot be passed by recalling a question bank; the model must actually reason and express. When designing these cases, prepare a “reference proof skeleton” so a human reviewer can judge whether the output is genuine derivation or a pseudo-proof (for example, circular reasoning or implicit use of an unproven lemma).
A simplified scoring sketch:
score = (0.35 * correctness # whether the conclusion and key steps are correct+ 0.25 * rigor # logical gaps or unproven citations+ 0.20 * constraint # language/format/notation constraint compliance+ 0.10 * conciseness # redundancy in the reasoning chain+ 0.10 * reproducibility# consistency across repeated runs of the same task)
reproducibility is often overlooked, yet it determines whether a model can enter an automated pipeline: if results vary too much across repeated runs of the same input, regression testing is impossible.
3. Instruction Following: More Impactful Than “Smartness” for Adoption
Instruction following is not simply “obeying.” It can be broken into four constraint types:
- Format constraints: a specified document type, section structure, and formula layout;
- Language constraints: output language and terminology consistent with a glossary;
- Scope constraints: no off-topic content, no expansion of irrelevant background;
- Negative constraints: no unverified assertions, no omission of key intermediate steps.
Evaluation should include “constraint conflict cases,” for example requiring both “extremely concise” and “list all intermediate steps completely,” to observe whether the model proactively asks for clarification instead of silently violating one requirement. A more practical engineering approach is to introduce a constraint validator that takes machine-checkable requirements back out of the model’s hands:
output -> format validation (sections/language/formula blocks) -> notation consistency check -> manual spot check of the proof skeleton
This way, even if instruction following fluctuates, the pipeline as a whole stays controllable.
4. Refusal Rate and Safety Policy: The Hidden Killer of Usability
A key signal in the original feedback is that the new version refuses noticeably more often on security-related tasks, frequently interrupting a previously smooth “reverse analysis to vulnerability verification” flow. Two kinds of refusal need to be distinguished:
- Reasonable refusal: real attack targets, unauthorized intrusion, destructive payloads;
- Excessive refusal: blocking compliant vulnerability principle analysis, patch verification, and experimental reproduction as well.
The recommended approach is to split tasks into a “description layer” and an “operation layer”: the description layer allows discussion of vulnerability causes, trigger conditions, and fix approaches; the operation layer runs in an isolated environment and is executed only after human review. Beyond refusal rate, metrics should also record the false refusal rate (the proportion of compliant requests wrongly blocked) and average number of retries; these two numbers reflect real experience better than the overall refusal rate.
5. Cost and Queueing: Modeling Quota Consumption as Engineering Metrics
“Burning through quota fast and waiting too long in queues” is a typical experience problem, but it can be quantified. Establish a cost baseline for each task type:
| Metric | Meaning | Use |
|---|---|---|
| Average consumption per task | Quota share consumed by one complete task | Budget planning |
| Effective output ratio | Usable output / total consumption | Detecting idle spinning |
| Queue wait percentiles | P50/P95 wait time | Deciding whether to go asynchronous |
| Retry amplification factor | Extra consumption caused by failed retries | Optimizing prompts and validation |
Engineering optimizations include: converting long tasks into asynchronous jobs, reusing cacheable intermediate results, running rule-based pre-validation before calls to reduce invalid requests, and setting quota caps and degradation strategies per task type. When using general-purpose cloud capabilities, you can store intermediate artifacts in object storage, use a message queue to smooth out traffic peaks, and track consumption and failure rates with logging services and monitoring alerts.
6. A Robust Workflow for Vulnerability Reproduction and Reverse Analysis
Under compliant conditions, models can significantly accelerate the “patch diff analysis to trigger condition inference to reproduction script draft generation” stages. Recommended workflow:
- Information gathering: organize version differences, configuration items, and interface descriptions;
- Hypothesis generation: have the model list several possible causes with confidence labels;
- Human screening: the owner removes non-compliant or high-risk paths;
- Isolated verification: execute in a controlled experimental environment with full audit trails;
- Regression archiving: turn successful paths into internal test cases and reusable assets.
The key principle is a clear human-machine boundary: the model handles divergence and drafts, humans handle authorization and final execution. This preserves efficiency while avoiding handing uncontrollable operations to an automated chain.
7. Selection Conclusion: Build Your Own Evaluation Matrix
Do not rely on external leaderboards to decide. Build an internal matrix instead: the horizontal axis is capability layers L1–L4, the vertical axis is controllability, refusal behavior, cost and latency, and stability. Run a regression pass with a fixed test set every quarter and record differences between versions. For math-intensive scenarios, focus on L3/L4 and multi-turn consistency; for engineering pipelines, focus on constraint compliance rate and the cost of failed retries.
In the end, model selection is not about picking the “strongest” one, but the one with the lowest total cost and controllable risk under your constraints. Turning subjective impressions into metrics, and wiring those metrics into the pipeline, is the only sustainable way to make technical decisions.
