LLM Evaluation in Practice: A Model Selection Framework from Math Proofs to Engineering Tasks
Choosing the right large language model is harder than it looks, because informal comparisons mix different reference points, task difficulties, and cost definitions. This article turns scattered hands-on impressions into a reproducible evaluation and selection methodology. It answers three practical questions: how to measure a model's real capability on a task class, how to balance quality against speed and cost under business constraints, and how to orchestrate multiple models when no single model fits every need. You will get a task-tiering scheme (open-ended reasoning, general knowledge work, agentic execution), concrete evaluation pipelines with prompts and code, a cost model for cloud APIs versus self-hosting, a draft-review-expert cascade design, and a selection checklist.
Introduction: Why “Is It Good?” Is So Hard to Judge
Discussions about general-purpose LLM capability tend to take three forms. The first is “Model A is good for brainstorming, but for actual work, the faster Model B is nearly as smart, and I struggle to find a task that truly requires A.” The second is “With a single prompt, the model wrote a complete proof lecture note for a proposition from a given paper, and it consumed a noticeable share of my monthly quota.” The third is ranking models into capability tiers, or comparing each one against a widely accepted strongest model.
Each of these observations has value, but they cannot be converted into one another. The same model can excel at proofs yet feel “awkward” in everyday writing. The problem is rarely the model itself; more often it comes from three things: different reference points, different task difficulties, and different cost definitions. This article abstracts these scattered experiences into an actionable evaluation and selection method, answering three engineering questions:
- How do you measure a model’s real capability on a class of tasks in a reproducible way?
- How do you find a balance among quality, speed, and cost that fits your business constraints?
- When no single model covers every need, how do you amplify overall output through task orchestration?
1. Where Evaluation Usually Goes Wrong
1. Misaligned reference points. Comparing against the “currently strongest model” is good for judging a capability ceiling; comparing against the “default choice for most tasks” is what answers “what should I hand to it.” A conclusion like “strong at divergence but no clear edge at execution” often comes from putting brainstorming and delivery on the same scale.
2. Substituting chain-of-thought length for accuracy. Longer, more elaborate reasoning is often read intuitively as “smarter,” but longer reasoning also means more intermediate steps and a larger chance of error. For simple tasks, long chains add needless latency and cost. Whether a longer chain is “worth it” depends on whether the answer’s accuracy actually improves.
3. A single experience standing in for a statistical conclusion. Generative models are stochastic. Rerunning the same prompt can produce noticeably different outputs, and sample sizes are often only a handful of cases. Under these conditions, a single observation can show that something “happened,” but not that it is “more reliable.”
4. Attributing prompt and toolchain effects to the model. The same capability often shines more in an agentic environment with tool calling, context management, and automatic verification than in a plain chat window. When you compare across environments, you are really comparing the combination of “model + prompt + toolchain.”
5. Inconsistent cost definitions. Subscription quota share, pay-per-use unit price, and self-hosting depreciation are three completely different cost units. Putting them side by side is meaningless; you must convert them to a common measure, such as “cost per successfully completed task.”
6. Iteration outpaces evaluation. The capability frontier of general models keeps moving, so any ranking has a shelf life. Evaluation conclusions should record the model version and the evaluation date, and should be designed for periodic regression.
2. Step One: Layer the Tasks and Define Observable Metrics
Before selecting a model, grade the tasks first. The same model can have very different value at different layers.
| Tier | Typical tasks | Core metrics | Evaluation method |
|---|---|---|---|
| L1 Open-ended reasoning | Math proofs, solution design, complex attribution | Verifiable accuracy, rigor of steps, identifiability of failures | Automated checks + expert blind review |
| L2 General knowledge work | Summarization, drafting, rewriting, classification, information extraction | First-pass rate, rework rate, number of factual errors, format compliance rate | Reference-based automated scoring + blind-review win rate |
| L3 Agentic execution | Multi-step coding, tool calls, long-workflow automation | Task success rate, step efficiency, tool-call accuracy, human intervention rate | Automated judging in a sandbox environment |
After layering, segment by scenario, because the same task can have very different value density across scenarios. For example, proof lecture notes belong to a “low-frequency, high-value, can-tolerate-longer-waits” scenario where the weight on quality is far higher than on speed. Daily polishing and summarization, by contrast, are “high-frequency, low-per-instance-value, wait-sensitive” scenarios where speed and cost carry more weight.
Evaluation should also cover the needs of two distinct groups at once:
- Developers care about call latency, context capacity, output stability, concurrency, and integration complexity.
- Enterprise users care about data security and compliance, the predictability of unit cost, service availability, and long-term maintainability.
Given this, summarize each candidate model on a scorecard: the quality score comes from the evaluation set, the speed score from load testing, the cost score from a cost model, and the compliance score from a review of the deployment method. Write every score as “value + sample size + evaluation date” to make later regression comparisons easy.
3. Open-Ended Reasoning: How to Evaluate Math-Proof Tasks
A task like “given a proposition, output an English lecture note” looks like it only tests language ability, but it actually involves four challenges: understanding the proposition, finding a correct approach, keeping the argument rigorous, and formatting to specification. One detail in the discussion is worth noting: the proposition has no ready-made proof in the reference source. This shifts the object of evaluation from “reproduction ability” to “reasoning ability.” Borrowing that idea, you can design the following evaluation pipeline.
1. Curate the evaluation samples. Draw from coursework, paper appendices, competition problems, and complex constraint derivations from real work. Make sure the reference materials contain no standard proof that can be copied directly, and record the source, difficulty, and expected time in the sample table.
2. Fix the input and output protocol. Use a unified prompt template, fix parameters such as randomness, and specify the output structure. For example, require the model to give “conclusion, lemmas, proof steps, and a list of results used.”
You are a rigorous math-writing assistant. Please prove the following proposition:<PROMPT>Constraints:1. You may only use the definitions, theorems, and lemmas in the [ALLOWED REFERENCES] list; any result outside the list must be fully proven in the text;2. Every key step must state its justification; no leaps such as "it is obvious that" or "this is easily verified" are allowed;3. If you cannot complete the proof, explicitly state where you get stuck, and distinguish among the following three cases:(a) you have reduced it to a known result but lack the proof of that result;(b) your line of reasoning may be flawed;(c) you suspect the proposition itself does not hold, and provide a counterexample or a direction for one;4. The output structure must be: [Conclusion] [Lemmas] [Proof] [Reference list] [Risk notes].[ALLOWED REFERENCES]: <ALLOWED_LIST>
3. Combine automated checks with human review. Let programs verify what can be computed; leave semantic issues to experts, and ensure reviewers cannot see each other’s scores.
# For illustration of the workflow onlydef verify_proof(answer: str, sample: dict) -> dict:# 1. Reference compliance: check whether any result outside the allowed list is usedused = extract_references(answer) # Extract the [Reference list]violations = used - set(sample["allowed"])# 2. Computational correctness: symbolic or numeric spot-checks on the key equations in answeridentity_ok = check_identities(answer, sample["checker"])# 3. Reasoning closure: manually check for circular reasoning, unproven lemmas, and missed casesreturn {"violations": violations, "identity_ok": identity_ok}
4. Score across multiple dimensions. Have experts score on five dimensions and produce a review sheet in a unified format:
- Understanding of the proposition: Did it restate the proposition accurately, or did it quietly change a condition?
- Reasonableness of the approach: Is the proof route viable?
- Rigor of steps: Are the key steps complete, and can they be checked as “a judgment call + locate the error”?
- Self-consistency: Did it introduce results from outside the allowed list out of nowhere, effectively “skipping the hard part”?
- Clarity of expression: Are terminology, notation, and formatting consistent?
Math proofs have another often-overlooked requirement: when a proposition does not hold, can the model produce a counterexample or a clear negative judgment rather than forcing together a fake “proof”? The evaluation set should deliberately keep a portion of false propositions to test the model’s ability to judge and reject.
5. Multi-round sampling. Run each sample k times and record the proportion of “at least one pass out of k” (pass@k) together with its confidence interval. Open-ended reasoning often needs multiple attempts to land on a correct approach, and single-run pass rates significantly underestimate the potential of these models.
6. Archive the results. Record the pass rate, average time, and typical failure modes (such as circular reasoning, unproven lemmas, or missed boundary cases) so they can serve as the basis for later selection and regression.
4. General Tasks: First-Pass Rate Determines “Effective Cost”
L2 tasks are the most numerous and make up the largest share, and they are also the easiest to fall into the “single-point experience” trap: one output reads well, and it is easy to conclude “that is good enough.” The rigorous approach is:
- Source samples from real work. Sample from historical tickets and documents, preserving the real distribution of difficulty and length;
- Annotate the pass criteria. For each sample, spell out “what counts as acceptable”;
- Standardize randomness. Run each candidate model n times, recording the input and output tokens consumed and the latency each time;
- Combine automated metrics with blind review. Automated metrics include format compliance rate, key-field extraction accuracy, and literal overlap with reference text; blind review has evaluators compare candidate outputs head-to-head and produce win rates.
The observation that “it is several times faster and nearly as smart, so it is hard to find a scenario that requires it” can be explained with the following model. Treat an L2 task as a “draft generation + human acceptance” workflow. Let the quality difference between two models be δ and the speed difference be v (where k denotes “the faster model runs k times faster than the slower one”). Then:
- Measured by conversation time: total time = generation time + editing time;
- Measured by human labor hours: total time = editing time + review handoff overhead × number of editing rounds.
Conclusions:
- If generation time is only a small part of end-to-end time, then the rework time caused by δ is the dominant factor. In that case, the slower model is worth choosing only when its quality lead is clear.
- If the task demands “get it right in one pass” (for example, formal external documents), where editing is costly, the advantage of the slower but steadier model is amplified.
How to judge:
- Measure each model’s “average rework time” on the same batch of tasks;
- If the rework time difference is ≤ (1/v − 1/k) × generation time, the faster model is the better choice;
- If the rework time difference is larger, only then is the slower, more accurate model worth choosing.
A concrete example (all illustrative parameters): suppose the slower model takes 60 seconds per generation with a 70% first-pass rate, and the faster model takes 10 seconds per generation with a 65% first-pass rate, and both have an average rework time of about 3 minutes. Then for every 100 tasks, the end-to-end time is roughly:
- Slower model: 60 × 100 + 180 × 30 = 11,400 seconds;
- Faster model: 10 × 100 + 180 × 35 = 7,300 seconds.
Under these parameters, the faster model is clearly more economical. This conclusion means that in general tasks, “cost-effectiveness” is not a vague sense of “cheaper”; it is jointly determined by the quality gap, the speed multiple, and the rework cost.
5. Agentic Execution: Factor the Toolchain into the Evaluation
When a model moves into an agentic coding tool or an automation pipeline, the standard shifts from “is the answer right?” to “did the task get done, done right, and done efficiently?” Agentic execution should be evaluated in a controlled sandbox so that results are decidable and the process is reproducible. The main metrics are:
- End-to-end task success rate: for example, whether a code change passes the full unit-test suite;
- Step efficiency: the number of tool calls required to complete the task, and the volume of files read and written;
- Tool-call accuracy: whether function names, parameter structure, and parameter types are correct;
- Error recovery: whether the model can fix problems after a build failure or a failing test, based on the error output;
- Human intervention rate: the proportion of cases that need a human to take over or correct;
- Cost per task: the tokens consumed when billed by token, or the quota share consumed when billed by quota.
This kind of evaluation especially needs to control variables. The same model can perform very differently across toolchains (how context is organized, the set of available tools, permission scope, whether code retrieval is built in). So conclusions should be written as “how a given model performs on a given class of toolchain,” not as “a given model works or does not.”
6. Engineering Metrics: Latency, Throughput, and Stability
Beyond quality and cost, engineering metrics directly determine the user experience.
- First-token latency: in interactive products, this largely determines the perceived wait;
- Sustained output rate: measured in tokens per second (TPS), affecting the perceived speed of long documents and long reasoning;
- Total processing time: the longer the reasoning chain, the longer the total time; long-chain reasoning needs streaming output and progress cues;
- Throughput and concurrency: rate degradation and queueing under high concurrency;
- Stability: error rate, timeout rate, and false-positive rate of content filtering during continuous runs.
These metrics must be load-tested under loads close to real business: a fixed input-length distribution, a concurrency curve, and a sustained duration, rather than a single “idle” request. Speeding up is only worthwhile when it means “faster at equal quality,” or when “the gain from higher speed outweighs the quality loss.” If a model stays stable with low variance in long-chain reasoning, it may be a better fit for long-running batch tasks even if its peak rate is not the highest.
7. Deployment: The Trade-Off Between API Calls and Self-Hosting
The discussion noted that some self-hosted inference setups can reach fairly high single-stream output rates on particular hardware configurations, which prompted speculation that “the economic value of self-hosting may extend beyond official subscription revenue.” Whether or not that speculation holds, it points to a common question: how should a business choose between cloud API calls and self-hosting?
Typical features of cloud API calls:
- Ready out of the box, elastically scalable, with no hardware operations to manage;
- Model versions keep upgrading;
- Data leaves your own environment;
- Unit cost grows linearly with usage;
- Rate and context length are constrained by the service-side configuration.
Typical features of self-hosting:
- Data stays entirely in your own environment, making compliance easier to meet;
- You can customize quantization, batching strategy, and scheduling;
- You must handle hardware procurement, operations, and scaling yourself;
- Model upgrades depend on your own cadence;
- The cost structure shifts from “variable cost” to “fixed cost + operations labor.”
You can size the decision with a break-even point. Let c be the blended cloud price per million tokens, f the cost per GPU-hour, and T the deployment throughput (in million tokens per hour). Then:
- To process the same token volume each hour, the cloud costs c × T while self-hosting costs f;
- Break-even monthly volume Q = 730 × f ÷ c (in million tokens; 730 is the average number of hours in a month).
Example: if the blended cost per GPU is $10 per hour and the blended cloud price is $2 per million tokens, then Q = 3,650 million tokens, or about 3.65 billion tokens. This means:
- Self-hosting has a pure cost advantage only when the monthly volume stays above roughly 3.65 billion tokens and resource utilization stays high;
- If actual utilization is only half the break-even point, the effective cost doubles;
- Given business peak-and-trough swings and model iteration, idle and obsolescence risk must also be counted.
So in practice, the choice is often a “hybrid deployment”: sensitive data is handled in your own environment, while elastic peaks and frontier capability are met through general-purpose model services on the cloud. Cloud services such as Baidu AI Cloud typically offer both a range of general-purpose model services and managed deployment, so businesses can configure by task tier.
8. Let Each Model Do Its Best: Draft–Review–Expert Routing
The endpoint of evaluation is not picking the single “strongest model,” but designing a “portfolio”: put the cheap, fast model on high-frequency steps, and reserve high-quality models for high-value or high-difficulty steps. A practical implementation is a cascade call with a threshold and retries:
# For illustration of the workflow only; confirm the calling method and parameters in the docs of your model servicedef solve(task: dict, draft, judge, expert, k: int = 5, gate: float = 0.85) -> dict:"""draft: fast drafting model; judge: review model; expert: heavy-reasoning model"""# 1. Drafting stage: the fast model generates k candidates, trading breadth for depth firstcandidates = [draft.complete(task.prompt, max_output_tokens=task.budget) for _ in range(k)]# 2. Review stage: use a model different from the drafter for blind scoring to reduce same-source biasranked = sorted(candidates, key=lambda x: judge.score(task, x), reverse=True)best, score = ranked[0]# 3. Expert stage: when the review does not meet the bar, pass the failure reasons as feedback to the expert model# Reuse the "multi-sample + review" strategy and cap the number of calls to avoid runaway costif score < gate:for _ in range(k):cand = expert.complete(task.prompt, feedback=judge.review(task, best),max_output_tokens=task.budget * 2)cand_score = judge.score(task, cand)if cand_score > score:best, score = cand, cand_scoreif score >= gate:breakreturn {"answer": best, "score": score, "source": "expert" if score >= gate else "draft"}
Design points:
- Use a different model for review: if the drafter and the reviewer come from the same model, “same-source bias” is likely, where the model tends to endorse output in its own style;
- Structure the review conclusion: outputting a list like “2 results outside the reference list, 1 missed boundary case” guides the next step better than a single score;
- Feed failure reasons back: giving only a score without reasons makes it hard for the expert model to improve in a targeted way;
- Cost ceiling: a cascade multiplies the number of calls, so you must set a budget, timeouts, and a maximum retry count;
- Validate with a small traffic slice first: a cascade is not free; routing thresholds should be set from evaluation data, and you should keep monitoring the “escalation rate” and the “post-escalation pass rate.”
For high-value tasks like “proof lecture notes,” this portfolio is especially effective: the fast model first explores multiple proof routes, the review model checks reference compliance and step completeness, and the heavy-reasoning model steps in only when the review finds problems. Compared with sending every task to the strongest model, this portfolio concentrates resources on the genuinely hard parts while keeping cost under control.
9. Make Evaluation a Reproducible Engineering Process
Scattered subjective impressions cannot support technical decisions; evaluation itself needs to be engineered. A sound evaluation should include at least the following elements:
- Version locking: record the model version, system prompt, sampling parameters, and evaluation-set version;
- Data isolation: the evaluation set must not enter training or fine-tuning data, and it should be refreshed periodically to prevent “score gaming”;
- Statistical rigor: state the sample size explicitly and report confidence intervals for single-run pass rates, for example by using bootstrap resampling to estimate intervals;
- Auditable results: save the inputs, outputs, time, cost, and review comments so they can be replayed;
- Regular regression: rerun the evaluation set after each model iteration and observe metric changes rather than relying on historical impressions.
Below is an illustrative summary of evaluation results:
| Task type | Candidate A (fast) | Candidate B (general) | Candidate C (heavy reasoning) | Key takeaway |
|---|---|---|---|---|
| Open-ended proofs (50 problems × 5 runs) | 18% | 32% | 61% | Heavy-reasoning model leads clearly; suited to high-value tasks |
| Document summarization (100 items × 3 runs) | 89% | 91% | 92% | Differences within the margin of error; prefer the faster one |
| Code repair (80 problems × 3 runs) | 54% | 70% | 79% | General model already meets most needs |
| Average first-token latency | Low | Medium | High | Interactive scenarios must account for latency |
10. Common Pitfalls and a Selection Checklist
Pitfall 1: Looking only at the “first-pass rate.” For open-ended reasoning, pass@k often reflects potential better than a single-run success rate, yet real business can only take one output. Report both during evaluation, and combine them with engineering means like “review + retry” to turn potential ability into stable output.
Pitfall 2: Treating subjective preference as quality. Longer answers, smoother phrasing, and more subheadings do not mean more accurate. Reviews should be as structured as possible, replacing overall impressions with decidable questions such as “is there a factual error, is the citation compliant, are the steps complete.”
Pitfall 3: Ignoring the effect of output length on cost. The longer the chain of thought, the higher the consumption per run. For example, one heavy lecture-note generation can consume a noticeable share of the monthly quota, and costs accumulate quickly with high-frequency use.
Pitfall 4: Ignoring the role of prompt engineering. The same model can perform very differently under different prompts. Evaluations should use standardized prompt templates as much as possible, while still observing the room for prompt tuning.
Pitfall 5: Ignoring data compliance. Tasks involving sensitive data need to prioritize private or dedicated-environment deployment, which directly limits the range of candidate models.
Selection checklist:
- Are the task tiers clear, with an explicit pass criterion for each layer?
- Does the evaluation set come from real work, and does it include samples with “no standard answer” and “false propositions”?
- Does the review use structured criteria, and are reviewers isolated from the candidate outputs?
- Do you report both the single-run pass rate and pass@k, with confidence intervals?
- Have you computed “effective cost” (per-call cost ÷ success rate) rather than looking only at unit price?
- Have you included generation time, rework time, and review overhead in the end-to-end time comparison?
- Have you measured first-token latency, sustained rate, and stability under concurrency?
- Has the deployment method been sized against data compliance and usage scale?
- Have you designed a draft–review–expert cascade, with cost and retry limits?
- Have you built a regular regression mechanism, and are conclusions labeled with version and date?
Conclusion
Judging whether an LLM is “good” ultimately comes back to the engineering question itself: given the task, cost, and latency constraints, which combination can reliably produce acceptable results. No single model can be simultaneously high-quality, low-latency, and low-cost, but through task layering, verifiable evaluation, a cost model with a common measure, and sensible cascade orchestration, you can approach the global optimum. Rather than asking “which model is the strongest,” build an evaluation system that “lets data speak, is reproducible, and can regress”: let each step use the most suitable capability, and let every unit of compute go to the genuinely hard parts.
