How to Choose an LLM: Task-Based Evaluation Methods for Specific Use Cases
This article reframes LLM selection from "which model is stronger" to "which configuration fits best under your task distribution and constraints." It explains how to break perceived usability differences into a capability matrix, separate configuration effects from model effects by controlling prompt templates and sampling parameters, and evaluate quality with automated checks plus blind pairwise review. It also covers cost and latency trade-offs, layered routing, and a reproducible five-step evaluation pipeline.
1. Reframing the Problem: From “Which Is Stronger” to “Which Fits Better Under Constraints”
The real issue is not which product is better, but the perceived differences a user experiences across multiple entry points: one feels smoother for writing reports and revising paragraphs, another gives more direct answers when looking up information, the default entry and the deep-thinking entry behave differently on complex tasks, and one entry is average overall with no obvious strengths or weaknesses.
Abstracting these perceptions leads to a more rigorous engineering proposition: LLM capability is task-conditional, not a global scalar. The same model may score near-perfect on structured extraction yet be mediocre at long-form style rewriting; the same entry may respond quickly to short Q&A but require switching to a heavier reasoning configuration for multi-step tasks. So “which is stronger” is an underdetermined question that lacks three necessary constraints:
- Task distribution: extraction, generation, rewriting, reasoning, code, or multi-turn dialogue;
- Quality constraints: acceptable error types and error rates, and whether any hard constraints must never fail;
- Resource constraints: latency budget, cost per call, throughput and concurrency, and data compliance boundaries.
Comparison is only meaningful once these three are specified. A common mistake in practice is substituting a few “wow moment” anecdotes for systematic evaluation—small samples, inconsistent prompts, and drifting scoring criteria make such conclusions nearly impossible to reuse.
2. Task Layering: Turning “It Feels Good” into Measurable Capabilities
Map business needs to five capability categories, then design an evaluation set for each:
- Instruction following and format constraints: stable output of JSON, fixed fields, specified length and tone;
- Long-form rewriting and style transfer: paragraph-level rewrites that preserve meaning, keep terminology consistent, and flow logically;
- Retrieval-augmented generation (RAG): answering within the given context without overstepping, fabricating, or failing to cite sources;
- Multi-step reasoning and planning: task decomposition, constraint satisfaction, and self-checking;
- Code and structured data processing: runnability, edge-case coverage, and minimal dependencies.
The key benefit of layering is that selection conclusions shift from an “overall ranking” to a “capability matrix” that can directly drive routing—simple requests go to a lightweight configuration, complex requests go to a deep-reasoning configuration.
3. Metrics: Automate What Can Be Automated
Evaluation should separate “automatically判定” indicators from those that require human judgment.
Automatable metrics include: schema validity rate, field-missing rate, numerical consistency, citation coverage, pass rate of executable test cases, repetition and redundancy, average and P95 latency, and cost per task.
Metrics that need human or model-assisted review include: factual correctness, logical coherence, style fit, and satisfaction of implicit intent. In practice, “pairwise comparison + blind review” reduces subjective bias: two outputs are stripped of identifiers and presented in random order, and reviewers only make an A/B choice with a reason.
A minimal automated check (pseudocode):
def evaluate(case, response):ok_schema = validate_json(response, case.schema) # hard format constraintok_fact = check_citations(response, case.context) # detect overreach or fabricationok_exec = run_tests(response, case.tests) # runnability for code tasksscore = 0.5*ok_schema + 0.3*ok_fact + 0.2*ok_execreturn {"score": score, "p95_ms": case.latency_ms}
Hard constraints (such as JSON validity or no overreach) should be treated as automatic disqualifiers so that a high score cannot mask a fatal defect.
4. Prompt and Entry-Point Differences: Controlling Variables Matters More Than Switching Models
The observation that “you get what you want with almost no prompting” actually reveals the most overlooked variable in evaluation: entry points differ in default system prompts, default temperature, whether retrieval is enabled, and context-window strategy. Comparing across entry points without controlling these variables may attribute differences to the model when they actually come from configuration.
Fix a “baseline prompt template” with five parts: role, task, constraints, output format, and failure handling; fix sampling parameters such as temperature; fix the retrieval switch and number of retrieved items; and switch reasoning configurations only when verifying reasoning depth, recording the before-and-after difference. This turns “entry-point perception” into separable conclusions about “configuration effects” and “model effects.”
5. Cost and Engineering Constraints: Viewing Quality on a Budget Curve
Selection must land on a constraint plane. A simple decision logic:
if hard constraint fails: eliminate immediatelyelif quality meets target and P95 latency <= budget: choose the lowest costelse: introduce layered routing / caching / batching / result distillation
Common engineering practices include: semantic caching to reuse frequent Q&A results; small models for intent classification and pre-filtering; large models handling only requests judged complex; offline batching for stable outputs; and logging services with monitoring and alerting to build a quality dashboard that feeds online failure samples back into the evaluation set. For data compliance, sensitive scenarios should prefer solutions with private or dedicated-network deployment, and the architecture should reserve a replaceable model access layer to avoid tight coupling to a single implementation.
6. A Reproducible Evaluation Pipeline: Five Steps
- Sampling: stratified sampling from real business logs, covering long-tail and edge cases, with a recommended scale of at least several hundred cases;
- Annotation: write the expected output and decision rules for each sample, marking hard constraints separately;
- Dual run: request multiple candidate configurations in parallel under the same prompt and parameters, recording latency and cost;
- Blind review: de-identified pairwise comparison, computing win rate and confidence intervals, and drawing no conclusion when samples are insufficient;
- Regression: run the full regression on every prompt or configuration change to prevent “fix one, break three.”
7. Conclusion
In engineering, “which is stronger” should be replaced with “which configuration is optimal under my task distribution and constraints.” Breaking perception into a capability matrix, separating differences into configuration effects and model effects, placing quality on the constraint plane of cost and latency, and continuously regressing with a reproducible pipeline is a sustainable selection method. Baidu AI Cloud provides foundational components for such evaluation and routing architectures in general capabilities including model services, container platforms, logging services, and monitoring and alerting, which can serve as a reference for implementation.
