LLM Evaluation for Model Selection: From Instruction Following to Long-Text Stability
This article presents a practical framework for evaluating general-purpose LLMs during model selection. It explains how to derive evaluation criteria from business scenarios, covers six core dimensions—instruction following and format constraints, long-text generation stability, reasoning, multimodal understanding, factual accuracy, and cost/latency/availability—and describes how to build reproducible test sets, automate scoring, and analyze results. Readers will learn how to turn subjective impressions into comparable, repeatable data and make selection decisions using per-dimension scores, failure analysis, confidence intervals, and business-weighted trade-offs.
When choosing a general-purpose LLM, many teams still rely on scattered anecdotal experience: a single impressive answer, or a long piece of text that contradicts itself halfway through. Such impressions can be useful reference points, but they cannot replace systematic evaluation. This article takes an engineering perspective and outlines evaluation dimensions, test-set construction methods, and result-analysis workflows to help readers turn “it feels good” into reproducible data.
1. Define Business Scenarios Before Discussing Model Capabilities
Evaluation starts with business requirements, not a general leaderboard. The same model can perform very differently across code completion, customer-support Q&A, and contract summarization. Before evaluation, answer three questions: What form does the input take? Who consumes the output? What is the cost of an error?
For example, Q&A over an internal knowledge base places more emphasis on factual accuracy and citation reliability; marketing copy generation places more emphasis on language style and format diversity; data extraction tasks require output to strictly follow a structured format. Once scenarios are broken down into concrete tasks, each task can be mapped to clear scoring criteria.
2. Core Evaluation Dimensions
2.1 Instruction Following and Format Constraints
Instruction following refers to whether a model can accurately execute multiple constraints in a prompt, such as a word-count range, JSON output, a ban on certain words, or fixed section order. This capability directly determines whether downstream programs can reliably parse the results.
To assess it, write prompts with clear, programmatically verifiable conditions and measure the proportion that satisfy all conditions. When the number of constraints increases from one to five, the decline curve in success rate often reflects real capability better than a single-point success rate.
2.2 Stability of Long-Text Generation
In long-text scenarios, common problems include inconsistent terminology, repeated paragraphs, gradual drift from the original topic, and a noticeable drop in sentence quality in the latter half. These phenomena are often called generation degeneration.
During evaluation, prepare inputs of different lengths, such as 2,000, 10,000, and 30,000 characters, and check three things in the output: whether key entities remain consistent, whether looping repetition appears, and whether the closing paragraphs still align with the task objective stated at the beginning.
2.3 Reasoning and Complex Problem Solving
Reasoning capabilities include multi-step calculation, logical inference, code debugging, and planning problems. In recent years, models that emphasize explicit chain-of-thought have performed strongly on math and coding benchmarks, but they are often slower and more expensive. During model selection, determine whether the quality gain from deeper reasoning justifies the extra latency and cost.
It is advisable to keep both “direct answer” and “step-by-step reasoning” settings, compare the accuracy gap between them, and then combine that with timing data before making a decision.
2.4 Multimodal Understanding and Detail Perception
When inputs include images, tables, or charts, the model needs to identify local details and answer in context. Small text, spatial relationships, colors, and object counts are common inspection points. Evaluation should cover clear images, blurred images, and images containing distracting information, rather than drawing conclusions from standard examples alone.
2.5 Factual Accuracy and Hallucination Control
A model may generate content that appears plausible but is factually incorrect. For scenarios that require factual grounding, check whether the model correctly refuses questions beyond its knowledge scope and whether it faithfully cites the source when reference materials are provided.
2.6 Cost, Latency, and Availability
Beyond quality, record time to first token, end-to-end response time, per-call cost, concurrency limits, and service availability. For high-frequency online services, saving a few hundred milliseconds per call can create a significant difference at scale.
3. Build a Reproducible Evaluation Set
The evaluation set determines the credibility of the results. Consider building it as follows:
- Extract samples from real business logs, covering high-frequency scenarios and edge cases.
- Write reference answers or programmatically verifiable decision rules for each sample.
- Stratify by difficulty and category, ensuring sufficient sample counts in each stratum.
- Reserve a portion of samples as a hidden test set to avoid inflated results caused by prompt-specific tuning.
- Record the model version, parameter settings, prompt version, and evaluation date for each run so results can be reproduced.
There is no universal standard for sample size. For a single task, a few hundred manually validated samples are often more useful than thousands of uncleaned records.
4. Automated Evaluation Example
The code below shows the skeleton of a general evaluation framework. The model call function is implemented by the user; the framework does not depend on any specific service.
import jsonfrom dataclasses import dataclassfrom typing import Callable@dataclassclass EvalCase:case_id: strprompt: strchecker: Callable[[str], float] # Returns a score between 0 and 1def check_json_format(output: str) -> float:"""Check whether the output is valid JSON and contains required fields."""try:data = json.loads(output)except json.JSONDecodeError:return 0.0required = {"title", "summary", "tags"}return 1.0 if required.issubset(data.keys()) else 0.5def run_evaluation(call_model, cases: list[EvalCase]) -> dict:scores = {}for case in cases:output = call_model(case.prompt)scores[case.case_id] = case.checker(output)average = sum(scores.values()) / len(scores) if scores else 0.0return {"per_case": scores, "average": average}
To use it, replace call_model with a function that connects to the actual interface, and write a corresponding checker for each task type. Where possible, checkers should use programmatic rules such as regex matching, field validation, and numeric comparison to reduce subjective bias in manual scoring. For open-ended text, arrange for multiple annotators to score independently and calculate consistency metrics.
5. Result Analysis and Decision-Making
After obtaining scores, do not compare only average values. Also pay attention to the following:
- Dimension-by-dimension comparison: Two models may have close overall scores, but if one clearly lags on format constraints, it may fail structured-output requirements.
- Failure sample analysis: Categorize failure causes and determine whether the problem comes from insufficient capability, prompt design, or the scoring rules themselves.
- Confidence intervals: With small sample sizes, a difference of a few percentage points may be random fluctuation.
- Cost-effectiveness: Divide the quality score by the per-call cost to obtain a metric closer to business decision-making.
Weighted scoring can be used for decisions. For example, for automated data-processing tasks, format compliance could be weighted at 40%, accuracy at 40%, and latency and cost together at 20%. Weights should be determined jointly by the business side and the technical team, not by technical staff alone.
6. Common Pitfalls
First, using a single benchmark score instead of business evaluation. Public benchmarks reflect general capabilities and may not align with a specific scenario.
Second, testing only success cases. Carefully selected demonstration samples cannot reflect average performance; failure samples and edge cases should be actively included.
Third, ignoring version changes. Model providers may update the underlying model, so evaluation results need to be rerun regularly to detect performance drift.
Fourth, over-relying on model self-evaluation. Having a model score its own output introduces bias; key metrics should be validated by programs or humans.
7. Conclusion
The core of model selection evaluation is translating requirements into measurable metrics and ensuring that the testing process is reproducible. Teams can first define business scenarios, then design samples across six dimensions—instruction following, long-text stability, reasoning capability, multimodal understanding, factual accuracy, and cost/latency/availability—execute them at scale with an automated framework, and finally make decisions using per-dimension results and business weights. Regular retesting can promptly reveal model changes and keep technical choices grounded in the latest data.
