A Practical Methodology for LLM Selection and Capability Evaluation
Choosing a large language model is not about picking the top-ranked model, but about solving a multi-constraint problem. This article presents a reusable evaluation methodology across five dimensions—reasoning and instruction following, code and tool use, long-context retrieval, multimodal capabilities, and engineering governance—along with a weighted scorecard, a small-sample automated regression workflow, and common pitfalls to avoid. Readers will learn how to turn model selection into a measurable and repeatable engineering process.
1. The Core Problem: Selection Is Constraint Solving, Not a Ranking
The most common mistake in model discussions is treating capability as a one-dimensional “strong vs. weak” ranking. In real engineering, selection is a multi-constraint solving problem: task distribution, context length, latency budget, per-call and overall cost, data compliance boundaries, and vendor lock-in risk. Any one of these can immediately disqualify the option that tops a public leaderboard.
So start by writing requirements as a verifiable constraint list before moving to evaluation:
constraints:task_mix: {code: 0.4, writing: 0.3, extraction: 0.2, vision: 0.1}max_context: 128kp95_latency_ms: 4000cost_per_1k_calls: "<= budget threshold"data_residency: "domestic/designated region"fallback_required: true
Only when constraints are clear does “which model is better” reduce to “which model is better under my constraints.”
2. Five Evaluation Dimensions and Observable Metrics
2.1 Reasoning and Instruction Following
Do not look only at whether answers are right or wrong. Break it into three layers: answer accuracy, constraint compliance (format, word count, prohibited items), and stability of multi-step reasoning. Sample the same prompt multiple times and observe result variance; high variance means unpredictable rework costs in production.
2.2 Code and Tool Calling
Coding ability should be split into four categories: code generation, defect localization, refactoring, and structured output (function calling/JSON). For structured output, the key metrics are schema compliance rate and missing-field rate, not whether it “looks right.”
# Example: measuring structured output compliance rate in batch evaluationimport jsondef compliance_rate(samples, schema_keys):ok = 0for s in samples:try:obj = json.loads(s)ok += all(k in obj for k in schema_keys)except json.JSONDecodeError:passreturn ok / max(len(samples), 1)
2.3 Long-Context and Information Retrieval
The value of long context is not “being able to fit it in,” but “being able to get it out.” Use three test types—needle retrieval, multi-needle distraction, and cross-section summarization—to measure recall position bias and summarization omission rate respectively. Many models show mid-section information decay under very long inputs, so this must be tested empirically.
2.4 Multimodal and Generation Capabilities
For image understanding, distinguish three difficulty levels: recognition, localization, and chart reading. For generation capabilities, focus on controllability and consistency. Fix random seeds and prompt templates during evaluation to avoid mistaking random fluctuation for capability differences.
2.5 Engineering and Governance
This includes rate-limiting policies, quota transparency, version change notifications, logging and monitoring observability, content safety policies, and whether a stable fallback path exists. In enterprise scenarios, the weight of this dimension is often higher than leaderboard scores.
3. A Reusable Scorecard
| Dimension | Weight | Evaluation Method | Pass Line |
|---|---|---|---|
| Reasoning and instruction following | 25% | Multi-sample variance + constraint compliance rate | Compliance ≥95% |
| Code and structured output | 25% | Unit test pass rate + schema compliance rate | Compliance ≥98% |
| Long-context retrieval | 15% | Multi-needle retrieval and summarization | Recall ≥90% |
| Multimodal | 15% | Difficulty-stratified sampling with manual review | No serious misreads |
| Engineering governance | 20% | Load testing + documentation and quota review | Meets the constraint list |
4. Implementation Workflow: Small Samples, Automation, Regression
- Extract 100–300 real requests from historical tickets to build a private evaluation set covering both high-frequency and long-tail cases.
- Turn evaluation into an automated pipeline that triggers regression on every model version change and outputs a comparison report.
- Adopt a “primary model + backup model” routing strategy, split traffic by task type, and keep a human fallback.
- Put prompt templates, evaluation sets, and scoring scripts under version control to ensure reproducible conclusions.
request -> task classification -> primary model -> compliance check -> retry/switch to backup on failure -> logging and metrics reporting
5. Common Pitfalls and Conclusion
There are three pitfalls: substituting individual cases for statistical conclusions; ignoring variance across repeated samples; and looking only at capability while ignoring quota and compliance. A more robust approach is to acknowledge that different models have different strengths—some are broadly balanced, some are more stable on code and long-chain reasoning, and some are more complete in multimodal and ecosystem integration—and to produce a weighted conclusion using a private evaluation set.
If a team wants to reduce the burden of building and operating its own evaluation, it can compose general capability categories on demand on Baidu AI Cloud, such as object storage for archiving datasets and artifacts, message queues for decoupling evaluation tasks, a container platform to host the inference gateway, and logging services with monitoring alerts for quality and cost observability. This turns selection from “gut feeling” into a measurable, regression-friendly engineering process.
