LLM Selection in Practice: Three Capability Slots and an Evaluation Framework
Selecting a large language model is often framed as finding the year's top three models, but production engineering requires a task-specific capability mix. This article presents an evaluation framework built around three capability slots: agent task planning and tool use, engineering coding and code repair, and verifiable reasoning with hallucination control. It explains how to align evaluation criteria, avoid overreliance on composite scores, combine offline benchmarks with online canary tests, trace agent runs in sandboxes, test repository-level code repair, and measure factual consistency, refusal accuracy, and human takeover. It also covers cost, latency, observability, and a staged workflow from candidate screening to canary release, helping teams make LLM selection decisions that are explainable, reproducible, and deployable.
From “Top Three on the Leaderboard” to “Top Three for the Scenario”: An Engineering Approach to LLM Selection
Many teams start model selection by asking, “Which three large models have the strongest overall performance this year?” The question looks simple, but it assumes a universal top-three list independent of business context. In engineering practice, a more useful answer is usually not three fixed names but three capability slots: agent task planning and tool use, engineering coding and code repair, and verifiable reasoning and hallucination control. Cost, latency, compliance, and observability are cross-cutting constraints that determine whether a candidate model can actually enter production.
This article therefore does not rank specific products. Instead, it reframes “which three should we choose?” as “which dimensions should we use to select a combination of three capabilities that fits the business?” The approach applies to model evaluation, platform selection, application architecture design, and canary rollout.
1. Align on Evaluation Criteria First: Composite Scores Cannot Replace Task Success Rates
The most common mistake in LLM evaluation is to make a single-point decision based on a composite score. Composite scores are suitable for initial screening, not for deciding production deployment. Developers should distinguish at least the following criteria:
- Composite capability vs. task-specific performance: A composite score reflects average performance, while task-specific evaluation reflects real scenarios. Agent planning, repository-level coding, scientific reasoning, mathematical reasoning, and factual question answering have different failure modes and cannot substitute for one another.
- Offline benchmarks vs. online tasks: Offline benchmarks are reproducible and low-cost but prone to overfitting. Online tasks are closer to real traffic but noisier and more expensive to regress. A practical approach is to build an offline regression set and run small-traffic canary tests online.
- Single-turn answers vs. multi-turn execution: Multi-turn agent tasks should be judged not only by the final answer but also by task decomposition, tool selection, state tracking, error recovery, and total steps.
- Joint criteria for quality, cost, and latency: On the same task set, record success rate, first-pass success rate, average steps, cost per task, P95 latency, and human takeover rate at the same time. Comparing quality without cost can lead to a solution that demos well but is too expensive to run.
- Chinese and cross-lingual comparison: Chinese task sets should cover terminal operations, Chinese semantic understanding, long-document processing, and local business terminology. Cross-lingual comparison helps estimate generalization, but it cannot directly replace Chinese production evaluation.
An operational scorecard can be written as:
overall_score =w1 * task_success_rate+ w2 * first_pass_success_rate+ w3 * factual_consistency+ w4 * tool_call_accuracy- w5 * cost_per_task_penalty- w6 * latency_penalty- w7 * human_takeover_rate_penalty
The weights should not be chosen arbitrarily; they should be derived from the business loss function. For example, customer-service Q&A values factual consistency and refusal strategy more, coding assistants value hidden-test pass rates more, and agent workflows value multi-step success rates and cost ceilings more.
2. Capability Slot One: Agent Task Planning and Tool Use
Agent task planning is one of the most underrated capabilities in current LLM deployment. It is not simply about answering questions. The model must decompose a goal into subtasks, select tools, read returned results, maintain intermediate state, and retry or degrade gracefully when a step fails. Evaluation should focus on:
- Task decomposition quality: Whether subtasks cover the goal and whether there are omissions or redundant steps.
- Tool selection accuracy: Whether the correct category of tool is called at the right time and whether parameters are valid.
- State-tracking capability: Whether context is lost or execution is repeated after multiple turns.
- Error recovery capability: Whether the model can replan when a tool fails, returns an empty result, or returns malformed output.
- Cost and steps: How many turns are required to complete the task successfully and whether the model relies on brute-force trial and error.
Use isolated sandboxes to construct reproducible task sets and record the full call chain. Pseudocode:
function evaluate_agent(candidate, tasks, sandbox):results = []for task in tasks:trace = sandbox.run(candidate, task)results.append({task_id: task.id,success: trace.success,steps: trace.steps,tool_calls: trace.tool_calls,cost: trace.cost,latency_ms: trace.latency_ms,audit_flags: trace.audit_flags})return aggregate(results)
For agent tasks that involve terminal programming, also observe cost per task and recoverability after failure. Some solutions have a high single-run success rate but require many steps and retries, which can make total production cost higher. Others are inexpensive but have weak error recovery and require substantial human takeover. The candidate pool should include both high-success and low-cost options.
3. Capability Slot Two: Engineering Programming and Code Repair
Programming capability should not be evaluated only through code-snippet generation. Real engineering tasks usually involve repository understanding, cross-file modification, dependency constraints, unit-test repair, and terminal operations. Evaluation should cover four layers:
- Function-level generation: Given a signature and description, can the model generate code that compiles and can be tested?
- Repository-level modification: Can it locate relevant files, understand call relationships, and avoid breaking existing interfaces?
- Test-driven repair: After a hidden test fails, can it perform multiple rounds of repair based on the error output?
- Terminal and toolchain operations: Can it execute builds, run tests, read logs, and adjust the plan in a sandbox?
When evaluating, do not only check whether the generated code “looks right.” Check whether hidden tests pass, static checks pass, and the scope of modification is controllable. For enterprise users, also record patch acceptance rate, rollback rate, and human review time. A reasonable regression set should include historical defect fixes, interface changes, boundary conditions, and security constraints, so the model does not simply memorize public benchmarks.
4. Capability Slot Three: Verifiable Reasoning and Hallucination Control
Scientific reasoning, mathematical reasoning, and factual question answering share one property: their answers can be verified. These tasks should prioritize verifiable question banks, structured answers, and automatic scoring rather than subjective ratings alone. Evaluation dimensions include:
- Reasoning correctness: Whether the final answer is correct and whether key steps are traceable.
- Factual consistency: Whether the answer is consistent with the provided materials and whether it contains unsupported extrapolation.
- Refusal and clarification: Whether the model proactively asks for clarification when information is insufficient, rather than fabricating an answer.
- Citation verifiability: In document-based Q&A, whether it can provide evidence that can be located.
- Adversarial robustness: Whether it remains stable under leading questions, conflicting materials, and long-context distractors.
Hallucination control should not be understood as “the fewer answers, the better.” Production systems need calibrated confidence: answer correctly when the system should answer, and refuse or escalate to a human when it should not. Use factual consistency, refusal accuracy, and human takeover rate as a combined set of metrics to avoid a single “hallucination rate” hiding business risk.
5. Cost, Latency, and Engineering Observability
After a model enters production, its cost structure is completely different from the evaluation phase. Developers should build a per-task cost model that includes at least input and output tokens, number of tool calls, number of retries, cache hit rate, and human takeover cost. For high-concurrency scenarios, also monitor P95 latency, throughput limits, and rate-limiting strategies.
Evaluation and canary environments should be as close to production as possible. For example, a cloud platform such as Baidu AI Cloud can provide isolated sandboxes through a container service, object storage for task sets and artifacts, and logging and monitoring/alerting for call chains, latency, exceptions, and cost attribution. These are generic cloud capability categories; the key requirements are reproducibility, observability, and regression capability. Regardless of the infrastructure used, every evaluation should have a version number, a task-set snapshot, and archived results, so that differences after a version change can be explained.
6. Implementation Workflow: From Candidate Pool to Canary Release
A layered selection process is recommended:
- Candidate-pool screening: Use composite evaluation and general task sets to identify solutions that can enter deep evaluation.
- Capability-matrix evaluation: Score the three groups separately: agent planning, engineering coding, and reasoning reliability.
- Cost veto: Set a maximum cost per task and a P95 latency ceiling; eliminate any candidate that exceeds them.
- Small-traffic canary: In real business traffic, roll out by user segment and record success rate, takeover rate, and complaint rate.
- Continuous regression: Run a fixed regression set whenever the model or prompt changes, and retain failed samples for the next optimization round.
Ultimately, “the three best large models this year” is not a static list but a dynamic portfolio: one oriented toward agent planning, one toward engineering coding, and one toward verifiable reasoning and hallucination control, with final tradeoffs determined by cost and compliance constraints. For developers, the real value is not memorizing rankings but building a reusable evaluation framework that makes selection decisions explainable, reproducible through regression, and ready for deployment.
