How to Objectively Evaluate LLMs on Coding and Math Reasoning
Personal impressions of a large language model can be misleading—one engineer finds it highly efficient while another finds it unreliable, and both can be right because they tested different tasks in different ways. This article presents a practical evaluation framework: define tasks as specifications before testing, split capabilities into dimensions such as code generation, content writing, math reasoning, and domain judgment, build a reproducible test suite with fixed prompts and multiple runs, watch for known failure modes like fabricated details and error accumulation in long reasoning chains, and adopt a verification-first workflow. The goal is to turn subjective impressions into reproducible conclusions, with guidance on cost trade-offs and how to write a credible evaluation report.
In daily development, more and more engineers use large language models for coding, documentation, and data analysis. When evaluating these tools, drawing conclusions from personal impressions easily leads to bias. Some people find them highly efficient; others find them not smart enough. Both judgments can be true at the same time, because they come from different tasks and different usage patterns. This article provides a practical evaluation approach to help teams turn subjective impressions into reproducible conclusions.
1. Define the Task Before Judging the Capability
A model’s performance is highly correlated with the quality of the task description. When the goal is clear, the input is well-defined, and acceptance criteria are specific, the model can usually produce usable results quickly. When the goal is vague, the model can only follow the literal instruction and cannot fill in implicit requirements for the user. Before evaluating, write the task as a specification covering at least the following:
- Goal: what problem needs to be solved
- Input: data format, value ranges, existing constraints
- Output: the form and structure of the deliverable
- Acceptance criteria: which conditions must be met to count as complete
- Boundary conditions: which cases are out of scope
Example:
Task: Implement a function that aggregates logs by time windowInput: A list of events sorted in ascending time order; each event has a timestamp and a type fieldOutput: A dictionary of per-type event counts within each windowAcceptance:1. Empty input returns an empty dictionary2. Events with identical timestamps fall into the same window3. Passes the 5 provided test casesBoundary: Does not handle out-of-order data; no persistence required
The same model facing two descriptions of different quality often produces very different results. Descriptions must be kept consistent during evaluation. Otherwise you are comparing the ability to write requirements, not the models themselves.
2. Split the Evaluation by Capability Type
Asking broadly “is the model strong” is meaningless. Capabilities should be split into several dimensions, each with its own tests.
2.1 Code Generation
Core metrics include pass@1 (the fraction of outputs that pass acceptance without modification), the average number of revision rounds, and performance on boundary conditions. When requirements are clear, pass@1 is the most informative metric. When requirements are ambiguous, track separately whether the model proactively asks clarifying questions and whether those questions get to the point.
2.2 Text and Content Writing
The key to long-form text is structural coherence and internal consistency. During evaluation, check whether character settings, timelines, and causal relationships are self-consistent, and record whether the model maintains the original settings across multiple revision rounds. Such conclusions depend on human reading, so scoring is best done by reviewers familiar with the genre, using blind review to avoid preconceptions.
2.3 Math Reasoning
Math tasks should be divided into two categories: reproducing existing public results, and producing original proofs. The former can be checked against reference material; the latter must be verified by a human step by step. When reviewing a model-generated proof, confirm that each step is justified by a known theorem and that there are no logical jumps or circular arguments. If even one step cannot be verified, the proof cannot be considered complete.
2.4 Domain Judgment
In professional fields such as finance, healthcare, and law, model output can only serve as a hypothesis or reference, never as a direct basis for decisions. Key evaluation points include whether data sources are traceable, whether risk disclosures are complete, and whether the model proactively states its uncertainty when information is insufficient.
3. Build a Reproducible Test Suite
Reproducibility is the prerequisite for credible conclusions. Recommended practices:
- Fix the test questions and record their version
- Record the model version, invocation parameters (such as sampling temperature), and the date of testing
- Run each question at least several times and compute a pass rate instead of relying on a single result
- Save complete inputs and outputs for later review
- Use blind scoring whenever possible, so reviewers do not know which model produced an output
A simplified view of the evaluation loop:
for task in test_suite:for run in 1..N:output = call_model(task.prompt, params=fixed_params)result = auto_check(output, task.test_cases)log(task.id, run, result, output)summarize_pass_rate(task.id)manual_spot_check = randomly sample some outputs for blind human review
The test suite should ideally cover routine tasks, boundary tasks, and ambiguous tasks. Testing only routine tasks tends to produce overly optimistic conclusions.
4. Recognize Common Limitations
In practice, LLMs show relatively stable weaknesses in the following areas, which deserve dedicated testing:
- Insufficient requirement discovery: models typically only complete what is explicitly requested and do not proactively detect missing constraints. Test method: deliberately omit one key condition and observe whether the model notices.
- Mechanical execution: when a literal instruction conflicts with the task’s purpose, the model may strictly follow the instruction while ignoring the intent.
- Error accumulation in long reasoning chains: in multi-step derivations, a small early mistake gets amplified by later steps. Require the model to annotate the basis for each step rather than only giving a final conclusion.
- Fabricated details: models may invent nonexistent APIs, parameters, or literature references. Anything involving specific names and numbers needs to be fact-checked.
These limitations mean the model needs user guidance and verification, but they do not mean it has no value. The sensible approach is to use it within clearly defined boundaries and verify critical outputs.
5. A Verification-Centric Workflow
Treat model output as a draft awaiting review rather than a final answer. Recommended workflow:
- Write the specification and attach acceptance test cases
- Have the model generate a first version
- Run automated checks, including unit tests, static analysis, and type checking
- Manually review the logic and boundary handling
- Cross-validate key conclusions, for example against authoritative sources or an independent method
- Record failure cases and use them to update the test suite
Simplified acceptance logic:
function accept(code):if fails_unit_tests(code): return REJECTEDif unhandled_boundary_inputs_exist: return REJECTEDif critical_logic_lacks_human_review: return PENDING_REVIEWreturn ACCEPTED
6. Weighing Cost Against Value
Model calls, human review, and prompt tuning all cost time and money, and the investment should match the value of the task. For low-risk, highly repetitive work, use the output directly with spot checks. For high-risk or one-off critical work, add more verification rounds.
Be especially wary of over-tuning. If completing one task requires repeatedly rewriting prompts, splitting workflows, and re-running many times, reconsider whether the task is worth automating at all. Sometimes doing it manually is simply faster.
It is advisable to set a trial period for new models. When a model is released, first test it against your suite in key scenarios. If its boundaries are clear and it meets your needs, integrate it into the daily workflow. If its performance is unstable, treat it as an auxiliary tool rather than a primary dependency.
7. How to Write Evaluation Conclusions
A credible evaluation report should include:
- Test scenarios and task types
- Model version, invocation parameters, and test date
- Sample sizes and pass rates
- Representative success and failure cases
- The scope to which the conclusions apply
Avoid drawing conclusions from one or two experiences. A single result is heavily influenced by randomness and by personal usage habits. Limiting conclusions to the scenarios actually tested allows readers to judge their reference value.
