LLM Evaluation and Model Selection: Escaping the Trap of Subjective Experience
Choosing a large language model based on a few pleasant conversations is risky. This guide explains why single-interaction impressions produce biased, non-reproducible conclusions, and lays out a systematic evaluation approach across four dimensions: task coverage, output quality and stability, engineering controllability, and cost per successful task. It shows how to build a layered, business-derived evaluation set, control bias in model-based judging, load-test capacity and latency, design retry and fallback chains, and gate releases with continuous production feedback—turning "it feels good" into decisions backed by measurable data.
1. Why “I Tried It a Few Times and It Seemed Good” Isn’t an Evaluation
The most common mistake in judging a model’s capability is treating the impression from a single interaction as a capability conclusion. This kind of judgment suffers from at least three layers of bias:
- Task difficulty bias: A smooth multi-turn conversation may have simply hit one of the model’s strengths (such as general Q&A), while the tasks that actually cause trouble in production are often boundary cases like structured output, long-document retrieval, and code modification.
- Randomness bias: Generative models usually involve sampling randomness, so the same prompt can produce noticeably different quality at different times. If sampling parameters aren’t fixed and the model version isn’t recorded, the conclusion can’t be reproduced.
- Prompt quality bias: A carefully crafted prompt written by an experienced user makes any mainstream model look stronger. This “prompt bonus” doesn’t transfer to the rest of the team.
So the basic prerequisite for professional evaluation is: fixed input, fixed parameters, fixed version, multiple samples, reproducible. As long as any of these is missing, a conclusion can only serve as a reference—not as a basis for model selection.
2. Four Evaluation Dimensions: From Capability to Engineering Constraints
2.1 Task Coverage: First Define “What My Workload Actually Looks Like”
The evaluation set should not come from public general-purpose datasets, but from sampling of real business traffic. A recommended approach:
- Stratified sampling from online logs or the team’s historical tickets, grouped by business type (e.g., Q&A, extraction, rewriting, code generation, multi-step tool calls);
- At least 50–100 items per stratum, and a total scale of at least several hundred, to be statistically meaningful;
- Clearly label the expected behavior, including correct outputs, cases that should refuse to answer, and cases that should ask for clarification;
- Maintain a separate set of “hard cases” (long context, ambiguous instructions, multiple constraints, adversarial inputs)—this is what defines the capability ceiling.
A maintainable evaluation set structure can be simplified as:
eval_set/qa_general/ # General Q&A, tests factual accuracy and instruction followingextraction/ # Structured extraction, tests field-level accuracylong_context/ # Long-document retrieval and cross-section reasoningcode_edit/ # Code generation and repair, judged by unit teststool_call/ # Multi-step tool calls, tests argument correctness and termination conditionssafety/ # Privilege escalation, injection, sensitive content; tests refusal and boundarieshard_cases/ # Multiple constraints, ambiguity, counterexamples
2.2 Output Quality and Stability: Prefer Automatically-Determinable Metrics, Use Subjective Review as a Backstop
The scoring methods suitable for different tasks vary widely, and lumping everything into a single aggregate score is one of the most common mistakes:
- Code and extraction tasks: Use deterministic metrics such as unit test pass rate, field-level precision/recall, and JSON Schema validation pass rate. These metrics can be run an unlimited number of times at low cost with low variance.
- Generation and rewriting tasks: Reference-based metrics (such as similarity based on n-gram overlap) can only serve as a coarse filter. They are insensitive to semantic equivalence and should not be the sole criterion.
- Open-ended answers: Use a combination of “model review + human sampling re-check.” Model review must apply three bias controls: randomize candidate order (to eliminate position bias), remove length cues (to eliminate length bias), and use a judge model from a different family than the candidates whenever possible (to reduce self-preference bias). The review prompt should provide explicit scoring criteria and require structured scores with justifications.
- Stability: Repeat the same input N times (e.g., 3–5 times) and record the mean and fluctuation range of the pass rate. A model that averages 85% but scores only 50% on its worst run is often harder to use in an automated pipeline than a stable 80% model.
For aggregation, layered weighting is recommended rather than a global average:
total score = Σ (layer weight × that layer's pass rate), where layer weight ≈ that layer's share of real traffic
2.3 Engineering Controllability: The Part That Actually Determines Whether You Can Go to Production
This dimension is often completely ignored by experience-based evaluation, yet it directly determines integration cost:
- Structured output capability: Whether it can reliably produce results that conform to an agreed schema, and whether missing fields or extra text are tolerable;
- Context window and long-context performance: The window size is a capacity metric, but the key question is whether mid-section information recall degrades significantly as length increases;
- Streaming output and time-to-first-token: The experience of interactive products is driven mainly by time-to-first-token and throughput, not final quality;
- Concurrency and quotas: The number of requests that can be issued per unit time, queuing behavior under burst traffic, and the return semantics when a quota is exceeded;
- Observability: Whether runtime metrics such as token usage, latency, and retry counts can be obtained for cost attribution.
None of these can be judged by “feel.” They can only be obtained through load testing and long-duration stability testing.
2.4 Cost and Capacity: Shift from “Unit Price” to “Cost per Successful Output”
The industry-standard billing approach meters input and output tokens separately, with the output-side unit price usually higher. This means two models with similar unit prices can still produce bills that differ by several times—the difference comes from prompt length, reasoning-length, retry rate, and failure rate.
The recommended accounting metric is not price per thousand tokens, but:
cost_per_successful_task = total cost / number of successfully completed taskswhere total cost = Σ(input tokens × input price + output tokens × output price)
An estimation utility function (token counts should be based on the provider’s actual tokenizer; for Chinese text, the rule of thumb that “1 Chinese character ≈ 0.5–1.5 tokens” is only a rough order-of-magnitude estimate and must not be used for billing):
def estimate_cost(records, in_price, out_price):total_in = sum(r["prompt_tokens"] for r in records)total_out = sum(r["completion_tokens"] for r in records)success = sum(1 for r in records if r["passed"])cost = total_in * in_price + total_out * out_pricereturn {"cost": cost,"success_rate": success / max(len(records), 1),"cost_per_success": cost / success if success else float("inf"),"avg_retry": sum(r["retries"] for r in records) / max(len(records), 1),}
Pay attention to avg_retry here: retries make cost rise non-linearly. A model with slightly lower quality but very few retries is often more cost-effective than one that is “occasionally brilliant but frequently requires rework.”
3. Capacity and Queuing: Availability Is a Systems Engineering Problem
Even if a model meets the quality bar, request queuing, rate limiting, and timeouts can still make a business unavailable. This part doesn’t belong to model evaluation—it belongs to architecture design and must be handled explicitly:
- Tiered timeouts: Set different timeout thresholds for streaming and one-shot calls, so that long-tail requests don’t exhaust upstream threads.
- Exponential backoff + jitter: On rate limiting or 5xx errors, retry with random jitter added to the backoff interval, to prevent synchronized retries from causing a second wave of impact.
- Multi-model fallback chain: When the primary model is unavailable, switch to a backup model, with a clear expectation of the degraded output quality and appropriate alerting.
- Off-peak scheduling and batching: Offline tasks (batch summarization, label computation) should run during off-peak hours or via an async queue as much as possible, rather than competing with interactive traffic for quota.
- Quota and priority governance: Set quota caps and priorities for different business lines to prevent a single task from exhausting the entire allocation.
import random, timedef call_with_fallback(payload, chain, max_retry=3, base_delay=0.5):last_err = Nonefor client in chain: # chain: primary model -> fallback modelfor attempt in range(max_retry):try:return client.chat(payload) # Unified inference call wrapperexcept RateLimited as e: # Group rate limiting / 5xx / timeouts togetherlast_err = edelay = base_delay * (2 ** attempt) + random.uniform(0, 0.3)time.sleep(delay)except RetryableError as e:last_err = etime.sleep(base_delay * (2 ** attempt))# Non-retryable errors such as bad arguments or content-policy blocks: switch to the next model directlybreakraise AllModelsFailed(last_err)
Fallback must be observable: every switch should be logged, otherwise after an incident you can’t tell whether the model degraded or the pipeline failed.
4. A Decision Pitfall to Avoid: The Sunk Cost of Remaining Quota
A common but flawed motivation for model selection is: “There’s still a batch of unused quota in the account—let’s use it to finish the task.” In economics, this is a classic sunk cost fallacy. Unused quota is a cost that has already been incurred and cannot be recovered; it should not influence future marginal decisions. There is only one correct criterion:
Starting from today, how much additional cost does it take to complete one unit of task, and is this cost lower than the cost per successful output of the alternative?
Put differently, in order to make the quota “look used up,” giving up rate-limiting governance, result validation, and fallback plans often brings higher hidden costs: rework hours, data quality problems, and endless reruns for the ops team. Spending the budget on “completing the most correct tasks with the fewest calls” is far more valuable than “burning through the remaining balance.” Specific optimization techniques include: reusing stable prompt prefixes (enable context caching if the provider offers it), routing tasks by difficulty to models of different tiers, and adding rule-based pre-filtering before calling the model instead of using small-sample judgment.
5. Continuous Evaluation in Production: Feeding Live Data Back
Evaluation is not a one-time activity. It’s recommended to build a minimal closed loop:
- Full instrumentation: Record input, output, latency, token usage, retry counts, failure reasons, and explicit user feedback (upvote/downvote/copy/edit);
- Automatic sampling feedback: Automatically feed low-confidence, low-score, and heavily-edited samples into the evaluation set to form regression cases;
- Pre-release gate: After any model version switch, prompt change, or parameter adjustment, run the full evaluation set and compare against the previous version; if a metric drops beyond a threshold, block the release;
- Layered dashboards: View success rate and
cost_per_successby business type, so that overall metrics don’t mask local regressions.
def gate_release(current, baseline, thresholds):regressions = {k: baseline[k] - current[k]for k in thresholdsif baseline[k] - current[k] > thresholds[k]}if regressions:raise ValueError(f"Metric regression, release blocked: {regressions}")
6. Quick Reference: Common Pitfalls
- Using public leaderboard rankings instead of business evaluation: the distribution on leaderboards often differs greatly from real workloads, and there is a risk of overfitting.
- Measuring only the average and not the variance: automated pipelines are extremely sensitive to worst-case performance.
- Treating subjective review as the sole criterion: you must fix order randomization and scoring criteria, and re-check with human sampling.
- Comparing only unit price and not cost per successful output: ignoring retries, failures, and long outputs will distort the conclusion.
- Treating capacity problems as model problems: queuing and rate limiting are architectural defects that switching models cannot solve.
- Letting remaining quota drive the selection: this is a sunk cost and constitutes no technical justification.
7. Conclusion
Deciding whether a model is suitable for a given business is essentially reproducible engineering measurement on your own workload: define a layered test set, choose automatically determinable metrics, control review bias, load-test capacity and latency, calculate the cost per successful output, and then lock in the conclusion with a release gate. Whether you use model services offered by Baidu AI Cloud or self-hosted inference services built on a container platform, the methodology is exactly the same—upgrade “it feels good” to “proven by data,” and only then does every decision on selection, scaling, and cost optimization rest on a stable foundation.
