Engineering Guide: Horizontal Evaluation and Selection of General LLMs
This guide explores the systematic evaluation and engineering selection of general Large Language Models (LLMs). It covers defining task boundaries, establishing tiered metrics from language quality to engineering operability, understanding quality drift under constraints, and constructing diverse evaluation sets. By implementing offline evaluation, canary releases, and weighted decision-making, teams can transform subjective experiences into a reproducible pipeline for reliable, long-term model selection.
1. Problem Background: Evaluating LLMs Beyond Single Experiences
When teams interact with multiple general LLMs simultaneously, they often encounter two contrasting types of subjective feedback. The first is “language quality degradation” in long-form generation, characterized by repetition, logical disconnection, terminology drift, or formatting instability in the latter half of the output. The second is “expression optimization under constraints,” where structured output becomes more stable and parsable under strict formatting, safety, and procedural constraints. These are not contradictory; they reflect the model’s raw generation capability versus its constrained capability. The goal of engineering evaluation is not to assign a single total score to a model, but to answer: under specific task domains, constraint intensities, cost budgets, and compliance boundaries, which combination of capabilities is more reliable, observable, and replaceable.
Therefore, horizontal evaluation should adhere to three principles. First, define task boundaries before discussing model pros and cons. Second, distinguish between “raw capability” and “constrained capability” to avoid mixing the effects of templates, prompts, and safety policies with the model’s foundational abilities. Third, unify offline metrics, online performance, manual reviews, and cost/latency into a reproducible evaluation pipeline.
2. Defining Evaluation Boundaries First: Scores Without Boundaries Are Meaningless
Before starting an evaluation, the following boundary conditions must be clearly defined:
- Task Domain: Open-ended Q&A, summarization/rewriting, code generation, structured extraction, multi-turn customer service, or complex planning. Different tasks have vastly different requirements for factual consistency, format adherence, and reasoning chain stability.
- Input/Output Format: Plain text, tables, structured data, multimodal inputs, etc. Whether the output requires strict fields, citations, length limits, or executable code.
- Language and Domain: Mixed languages, professional terminology, industry jargon, long-tail entities. Terminology accuracy must be included in the evaluation set.
- Context Scale: Short-text Q&A and long-document analysis have completely different requirements for attention stability, retrieval augmentation, and segmentation strategies.
- Deployment and Compliance: Whether data leaves the designated zone, whether private deployment is required, whether logs are auditable, and how sensitive content boundaries are defined.
- Cost and Latency Targets: Time to first token, full response time, concurrent throughput, retry rate, manual review ratio.
These boundaries should be solidified into evaluation configurations rather than scattered across individual experiences. Otherwise, the “easy to use” conclusions drawn by different teams will be incomparable and irreproducible.
3. Tiered Metrics: From Language Quality to Engineering Operability
It is recommended to divide metrics into five tiers, each with explicit collection methods and judgment criteria.
| Tier | Core Question | Suggested Metrics | Collection Method |
|---|---|---|---|
| Basic Language Quality | Is the output coherent, accurate, and stable? | Repetition rate, factual consistency, terminology accuracy, format validity rate, long-form coherence, crash rate | Golden set + manual review + automated rules |
| Instruction Adherence & Constraints | Does it execute according to format, length, role, and boundaries? | Field completeness rate, format validity rate, constraint conflict rate, refusal boundary accuracy, multi-turn state retention rate | Constraint set + adversarial set |
| Reasoning & Knowledge | Is it verifiable? Does it express uncertainty? | Verifiable task accuracy, citation consistency rate, error propagation rate, uncertainty expression rate | Annotated set + cross-validation |
| Engineering Metrics | Can it stably support online traffic? | Time to first token, completion latency, throughput, failure rate, retry rate, version drift alerts | Stress testing + online monitoring |
| Safety & Compliance | Does it meet business and regulatory boundaries? | Sensitive content interception rate, unauthorized request rejection rate, audit field completeness rate, data residency compliance | Safety set + audit checks |
Among these, “language quality degradation” should focus on observing repetition, factual drift, and format corruption in the latter half of long outputs. “Expression optimization under constraints” should observe whether excessive refusals, template rigidity, or decreased information density occur under strong constraints. These two must be tracked separately and cannot be masked by a single average score.
4. Technical Explanation of Language Quality Drift and Constraint Trade-offs
Language quality drift typically stems from multiple overlapping factors: decoding strategies causing the accumulation of low-probability repetitions; attention decay and unstable position extrapolation in long contexts; context pollution leading the model to adopt incorrect premises; conflicts between safety alignment and formatting templates causing the model to oscillate between “adhering to constraints” and “complete expression”; and silent version updates causing performance changes under the same prompt. During evaluation, controlled comparisons should be conducted on the same batch of samples: fixing the prompt, decoding parameters, and constraint intensity, while separately testing “raw generation” and “constrained generation,” and recording version snapshots.
The pseudocode example is as follows:
function evaluate_candidate(candidate, suite, constraint_level):records = []for case in suite:output = candidate.generate(prompt = case.prompt,constraints = merge(case.constraints, constraint_level),decode = {temperature: 0, max_length: case.max_length})records.append(score_output(case, output))return summarize_with_confidence(records)
The evaluation report should at least include: constraint level, format validity rate, information completeness rate, repetition rate, refusal rate, manual readability score, and failure cases. Only by treating the intensity of “shackles” as an independent variable can we determine whether the model lacks foundational capability or if the constraint design is flawed.
5. Building Evaluation Sets: Balancing Golden, Regression, and Adversarial Sets
High-quality evaluation sets should be sampled in layers:
- Golden Set: High-value samples annotated by business experts, covering core tasks and terminology, serving as a stable baseline.
- Regression Set: Historical failure cases, boundary cases, and version drift cases, used to prevent iterative regression.
- Adversarial Set: Includes ambiguous inputs, conflicting constraints, ultra-long contexts, inductive questions, and format traps, used to test robustness.
- Long-Tail Set: Low-frequency entities, rare combinations, and cross-domain terminology, to avoid inflated average scores.
- Online Shadow Set: Desensitized samples drawn from real traffic, periodically fed back into offline evaluation to narrow the gap between offline and online performance.
Annotation protocols must clarify double-blind reviews, multi-person reviews, and consistency coefficients. Automated scoring must be periodically calibrated with manual scoring. To prevent data contamination, use time splits, private holdout sets, and version snapshots, recording prompts, constraints, decoding parameters, evaluation dates, and random seeds.
6. Execution and Decision-Making: Offline Evaluation, Online Canary, and Weighted Selection
For execution, a three-stage approach of “offline batch evaluation — canary release with small traffic — full-scale observation” is recommended. The offline stage focuses on coverage and reproducibility; the canary stage focuses on failure rates, latency, and manual intervention rates under real traffic; the full-scale stage continuously monitors quality drift, cost anomalies, and safety alerts. Statistically, confidence intervals and sample sizes should be reported to avoid drawing definitive conclusions from a few dozen samples.
During selection, set hard thresholds first: eliminate candidates that fail compliance, data residency, safety boundaries, availability, and replaceability. Then apply weighted scoring to those that pass:
Total Score = Σ weight_i × normalized_score_iCost per task = input_cost + output_cost + retry_cost + manual_review_cost + latency_waiting_cost
Weights should be determined by business goals, not vendor marketing. Simultaneously, design fallback strategies and multi-model routing: when the primary model experiences format failures, latency spikes, or safety alerts, it can switch to a backup path. All call logs should enter a logging service, quality metrics should be integrated into monitoring alerts, and evaluation samples stored in object storage for traceability. This reduces single-point dependency and allows selection conclusions to continuously update with version iterations.
7. Common Pitfalls and Conclusion
Common pitfalls include: substituting business evaluation with leaderboards; replacing multi-turn tasks with single-turn Q&A; focusing only on average scores instead of failure distributions; ignoring version drift and prompt coupling; ignoring cost, latency, and manual review; and simply viewing safety constraints as a “decline in capability.” A more robust approach is to establish tiered metrics, controlled comparisons, version snapshots, and online canary mechanisms.
In summary, evaluating multiple general LLMs should return to engineering principles: under clear boundaries, quantify language quality stability, constraint adherence, reasoning consistency, cost/latency, and safety compliance, then implement decisions through weighted scoring and fallback mechanisms. Only by transforming subjective experiences into a reproducible evaluation pipeline can model selection achieve long-term maintainability.
