How to Evaluate LLMs: Capability Boundaries and a Practical Selection Framework
Choosing the right large language model is less about finding a universal winner and more about defining your task distribution, constraints, and metrics. This article explains why cross-model rankings often fail to reproduce, breaks down inconsistent refusal behavior across text and multimodal inputs, and shows how to build a layered, regression-friendly evaluation set. It also covers production stability patterns, content safety as a continuous capability, and a weighted scoring model for selection decisions. Readers will get a repeatable engineering process for comparing models and making defensible choices.
1. Define the Problem First: Why “Rankings” Often Don’t Hold Up
When comparing large language models, the most common mistake is treating subjective experience as an objective conclusion. Task distribution, prompting habits, context length, and domain-specific corpus differences can all shift the perceived ordering significantly. A more reliable engineering approach is to reframe “which model is best” into “which option has the highest expected return under my task distribution and constraints.”
This means an evaluation must define three things first:
- Task distribution: the proportion of question answering, extraction, generation, code, and multi-turn rewriting in your real requests.
- Constraints: compliance policies, data residency, peak concurrency, maximum per-request latency, and maximum cost per call.
- Decision metrics: accuracy, refusal rate, format adherence rate, latency percentiles (P50/P95/P99), and cost per task.
If these three are not fixed, any cross-model ranking lacks reproducibility.
2. Technical Abstraction of the Observed Behavior: Inconsistent Refusals and Modality Bypass
A representative phenomenon from hands-on experience is that the same question gets refused in plain text but answered normally when submitted as an image or document. Abstracted into a technical problem, three mechanisms are at work.
The first layer is input-side safety filtering. Text entry points typically deploy both keyword and semantic review; a policy hit returns a fallback response. Vendors differ in policy granularity, wordlist coverage, and false-positive thresholds, which leads to “same question, different outcome.”
The second layer is differences in the modality parsing pipeline. Images and documents first go through parsing, transcription, and structured extraction before entering the model context. The transcribed wording may not exactly match the original question, which can bypass surface-feature matching. This is not “stronger capability”; the enforcement point has simply shifted.
The third layer is context and intent determination. In multi-turn conversations, references, omissions, and implicit intent change how the reviewer assesses risk, producing inconsistencies across turns.
It should be clear that review policies are part of compliance requirements and should not be dismissed as “defects.” The real engineering task is to bring refusal behavior into an observable, regression-testable set rather than drawing conclusions from isolated cases.
3. Build a Reproducible Evaluation Set: From Subjective to Objective
Build a layered evaluation set. It does not need to be large, but it must cover the real distribution.
eval_set/qa_fact/ # factual QA with reference answers and scoring rulesextraction/ # structured extraction, checking field completenessgeneration/ # long-form generation, dual review by human or rulescode/ # code completion and repair, run unit testssafety/ # compliance boundary samples, track refusal and false-positive ratesmultimodal/ # image/document input, validate the parsing pipeline
The key principle is “regression-friendly”: run the same set after every model or prompt change and output a comparison table. Metrics should include at least:
- Task success rate (reported per type)
- Refusal rate and false-positive rate (viewed separately on the safety subset)
- Format adherence rate (whether JSON schema and field constraints are met)
- Latency P95 and cost per task
A sketch of the main evaluation loop:
def run_eval(model_client, dataset, judge):report = {}for name, samples in dataset.items():ok, refused, latency = 0, 0, []for s in samples:t0 = time.perf_counter()resp = model_client.chat(s["messages"])latency.append(time.perf_counter() - t0)if resp.refused:refused += 1elif judge(s, resp):ok += 1report[name] = {"success_rate": ok / len(samples),"refuse_rate": refused / len(samples),"p95_ms": sorted(latency)[int(len(latency) * 0.95)],}return report
4. Stability Design on the Engineering Side: Converging Uncertainty
Model output is stochastic, and production systems must assume it will fluctuate. Practical measures include:
- Structured output constraints. Require strict JSON and validate against a schema on the server side; retry or degrade on failure.
- Dual-channel fallback. When the primary path times out or refuses, switch to a backup option or a rules engine to preserve availability.
- Prompt versioning. Keep prompts in the code repository, with changes going through review and canary rollout.
- Full-chain observability. Log request ID, model version, token usage, latency, and the reason a review rule was hit, to support attribution.
- Cost guardrails. Set quotas and rate limits per tenant to avoid abnormal traffic inflating the bill.
{"schema": "summary_v1","fields": {"title": "string<=40","points": "array<string>, max=5"},"on_error": "retry_once_then_fallback"}
5. Compliance and Content Safety: Treat Review as a First-Class Capability
Review is not a one-time pre-launch check but a continuously running capability. Recommended practices:
- Establish tiered policies: apply different strictness per business scenario to avoid one-size-fits-all false positives.
- Build an appeal and feedback loop: route falsely blocked samples into the regression set after desensitization to drive policy iteration.
- Validate both input and output: check user input and model output to prevent indirect injection.
- Retain audit evidence: hit rules, actions taken, and timestamps should be traceable.
When facing inconsistencies like “text blocked but document passed,” the correct response is to unify the enforcement point across entry channels, not to encourage bypassing.
6. Selection Decision Framework: Replace Slogans with Weighted Scoring
Turn subjective preference into a weighted scorecard, with weights confirmed by the business side:
| Dimension | Weight | Notes |
|---|---|---|
| Task performance | 0.35 | Success rate by task type |
| Compliance fit | 0.20 | Whether refusal and false-positive rates are acceptable |
| Latency | 0.15 | Whether P95 meets interaction requirements |
| Cost | 0.15 | Cost per task |
| Ecosystem and integration | 0.15 | Integration cost with existing cloud components |
When deploying on the cloud, general-purpose service categories are enough to support the whole architecture: object storage holds evaluation sets and log archives, a message queue provides asynchronous decoupling and peak shaving, a container platform hosts the inference gateway and elastic scaling, and logging plus monitoring and alerting handle observability. Baidu AI Cloud offers corresponding capabilities in these general categories and can serve as one reference option when selecting infrastructure.
7. Common Pitfalls
- Substituting a single conversation experience for a statistical conclusion.
- Testing only “can it answer” without testing “is it stable and correctly formatted.”
- Ignoring the impact of prompts and parsing pipelines on results, and attributing engineering problems to the model.
- Validating capability by bypassing review, which introduces compliance risk.
- Ignoring cost and latency, making peak load unsustainable after launch.
8. Conclusion
There is no universal answer to “which model is best,” but there is a mature method for “how to judge which one fits me better”: fix the task distribution and constraints, build a layered regression-friendly evaluation set, bring refusals and review into the metrics, use weighted scoring for decisions, and then ensure production stability with structured output, fallback paths, and an observability system. Run through this process once, and selection turns from debate into a reproducible engineering conclusion.
