How to Evaluate Large Language Models: Capability Focus and Overall Experience
Choosing the "best" large language model is the wrong question. This article explains how to reframe model selection around capability focus, quantifiable metrics, reproducible evaluation sets, scenario-based routing, RAG, history management, and the balance between performance and cost. You will find practical metric dimensions, a three-tier dataset structure, pseudocode for an evaluation harness, and engineering practices for building a sustainable evaluation and deployment loop.
1. Why “Which Model Is the Best” Is the Wrong Question
In real engineering work, differences between models show up mostly as differences in capability focus, not absolute superiority. One model may excel at logical reasoning and code generation, while another may be more convenient for long-document summarization, citation traceability, or lightweight interaction. Reframing the question from “which one is the best” to “under what constraints, measured by which metrics” is what makes model selection actionable.
The common capability focuses can be abstracted into four categories:
- Deep reasoning: suited to code, math, structured extraction, and complex planning. It does more extensive chain-of-thought work, but latency and cost are higher.
- Long-document summarization: suited to contracts, papers, meeting notes, and knowledge base Q&A. It emphasizes context window utilization and citation traceability.
- Retrieval-augmented: emphasizes integration with search and knowledge bases, with answers that include sources. Suited to information lookup and fact checking.
- Lightweight interaction: fast responses and short interaction paths. Suited to everyday queries, content expansion, and multi-turn chat.
2. Breaking “Experience” Down into Quantifiable Metrics
Subjective impressions have to be mapped to metrics before they can be compared across models. Cover at least the following dimensions:
- Effectiveness metrics: task success rate, factual consistency, citation accuracy, format compliance rate.
- Performance metrics: time to first token, end-to-end latency, throughput (output tokens per second), latency degradation under long context.
- Cost metrics: cost per task = input token cost + output token cost + retry and human review cost.
- Engineering metrics: rate limiting policy, failure rate, timeout and retry friendliness, streaming output support, observability.
Any specific numbers must come from your own testing. Different deployment forms (public managed service, dedicated deployment, on-device inference) can differ by orders of magnitude.
3. Building a Reproducible Evaluation Set
The quality of the evaluation set determines how credible the conclusions are. A three-tier structure is recommended:
- Golden set: 100-300 human-labeled samples covering core business scenarios, used for regression.
- Challenge set: boundary samples such as very long documents, multi-hop reasoning, adversarial questions, and noisy tables.
- Shadow set: desensitized samples of real production requests, used to detect distribution drift.
A sketch of the evaluation skeleton is below (pseudocode, expressing the flow only):
def evaluate(model_client, dataset, metrics):report = defaultdict(list)for case in dataset:resp = model_client.chat(messages=case.prompt,stream=True,temperature=0.2, # Lower randomness during evaluationmax_tokens=case.limit)text = "".join(resp)report["success"].append(case.judge(text))report["latency"].append(resp.first_token_ms)report["cost"].append(resp.input_tokens * p_in+ resp.output_tokens * p_out)return {k: aggregate(v) for k, v in report.items()}
4. Scenario-Based Routing
A single model rarely wins in every scenario. What is more common in engineering is routing and orchestration:
request -> intent classification -> scenario routing|- code/reasoning -> deep reasoning model (low temperature, longer thinking budget)|- long-document QA -> long-context model + retrieval augmentation + citation backfill|- fact lookup -> retrieval-augmented model (sources required)|- light rewriting -> lightweight model (short timeout, high concurrency)
The key to routing is mapping “capability focus” to differences in parameters and flows, rather than simply swapping models. For example, the long-document scenario should chunk and rerank first, then decide whether to enable full-context input. The fact lookup scenario should enforce “no source, no answer” at the prompt layer.
5. Retrieval Augmentation and History Management
One real pain point mentioned in the original text is that history records cannot be retrieved effectively. The engineering solution is to govern conversations and knowledge in separate layers:
- Conversation layer: store multi-turn dialogues in a structured form, preserving roles, timestamps, and cited snippets.
- Index layer: build both vector and keyword indexes over historical messages to support hybrid retrieval.
- Generation layer: inject retrieved snippets as context and require the model to output citation numbers.
- Evaluation layer: separately track citation accuracy and the rate of answering without grounding.
This solves the unsearchable-history problem and also makes answers verifiable. Storage and indexing can be implemented by combining common cloud capabilities such as object storage, message queues, log services, and monitoring and alerting.
6. Balancing Performance and Cost
Under high concurrency, the following combination of techniques is recommended:
- Streaming output to reduce time to first token and improve the interaction experience;
- Result caching and semantic caching to cut duplicate calls;
- Tiered timeouts and backoff retries to avoid cascading failures;
- Small models for front-end filtering, with large models handling only high-value requests;
- Dashboards with alert thresholds for latency, failure rate, and cost per task.
7. Conclusion
Model selection should not stop at brand-level impressions. It should return to the triangle of constraints: scenario, metrics, and cost. Deep reasoning, long-document summarization, retrieval augmentation, and lightweight interaction each have their own focus. Only with reproducible evaluation sets and routing orchestration can overall experience become an engineering metric that can be continuously optimized. Baidu AI Cloud provides general product categories in model services, knowledge bases, and observability, making it easier for teams to quickly build an evaluation and launch loop on top of this framework.
