Large Language Model Selection Guide: Building a Scientific Evaluation Framework Across Six Dimensions

    This guide explains why choosing a large language model by a single metric, such as leaderboard rankings or word of mouth, often fails in practice. It defines six evaluation dimensions: price, context window, reasoning ability, coding performance, Chinese-language quality, and response speed. For each dimension, it describes how to measure performance, then outlines a repeatable evaluation process with a weighted scoring example. The guide also covers tiered model selection, routing rules, and deployment concerns such as periodic re-testing and data security.

    1. Why a Single Metric Is Not Enough

    When selecting a large language model, teams often rely on word of mouth, leaderboard rankings, or the model they already use. The problem with these approaches is that leaderboards usually measure only general capabilities. They cannot reflect the workload characteristics of a specific business. A model that ranks near the top of a general benchmark may not complete daily code review tasks at an acceptable cost.

    How a model is used in practice also requires evaluation across multiple dimensions. Take software development as an example. A model must read source code, parse error logs, analyze code changes (diffs), call external tools, and revise its conclusions across multiple rounds of reasoning. Each step places different demands on the model, so no single metric covers all of them.

    A more reliable approach is to assess six dimensions at the same time: price, context window, reasoning ability, coding performance, Chinese-language quality, and response speed. These dimensions correspond to cost, input capacity, depth of reasoning, task completion, language suitability, and user experience, respectively.

    2. Definitions and Measurement Methods for the Six Dimensions

    2.1 Price

    LLM services typically charge separately for input and output, usually per million tokens. Output tokens often cost more than input tokens. For some models designed for complex reasoning, the output price can be several times or even dozens of times higher than that of economy models.

    The cost of a single call can be estimated as follows:

    1. Cost per call = input tokens / 1,000,000 × input price
    2. + output tokens / 1,000,000 × output price

    When evaluating price, use the average input and output lengths of real workloads as the baseline, rather than comparing list prices alone. For example, a task that outputs large code patches has a much higher share of output cost than a task that only returns a classification label.

    2.2 Context Window

    The context window determines the maximum amount of information a model can process in one request. In coding scenarios, it affects whether multiple source files, long log excerpts, and complete change histories can fit into a single request.

    The advertised size of a context window and its effective utilization are different. Many models lose recall accuracy for information at the beginning and middle of the context as it approaches the limit. When evaluating, design needle-in-a-haystack tests that place key information at different positions, so you can measure the actual recall rate.

    2.3 Reasoning Ability

    Reasoning ability refers to a model’s capacity for multi-step logical deduction. This includes breaking down problems, keeping intermediate states consistent, and backtracking to correct errors when contradictions appear.

    When measuring reasoning, use tasks relevant to your business rather than general intelligence tests. For example, give the model concurrent code that contains a race condition. Ask it to explain the trigger path and propose a fix. Then verify whether the conclusion is correct, either manually or with a test script.

    2.4 Coding Performance

    Coding performance requires a model to read, locate, modify, and verify code. This dimension can be broken down into the following subtasks:

    • Reading: understanding the structure and call relationships of existing code.
    • Locating: identifying the cause of a problem from an error message or a failing test.
    • Modifying: generating a correct patch that matches the existing code style.
    • Verifying: explaining how the change passes the existing unit tests.

    This dimension is best measured with automatically verifiable metrics, such as the pass rate of tests after a patch is applied, rather than subjective scores.

    2.5 Chinese-Language Quality

    Chinese-language quality covers terminology accuracy, semantic understanding, how natural the output reads, and how well the model follows formatting instructions. In technical documentation, requirements documents, and code comments, consistent terminology directly affects team collaboration efficiency.

    To evaluate this dimension, prepare a set of samples that include technical terms, colloquial expressions, and formatting constraints. Have reviewers with domain experience score the samples against a shared standard, and check that scores are consistent across reviewers.

    2.6 Response Speed

    Response speed is usually described with two metrics. Time to first token (TTFT) measures how long a user waits before the first token appears, which matters most in interactive scenarios. Total latency measures how long the full response takes to generate, which matters more for batch processing.

    Latency varies considerably from request to request, so use percentiles, such as the 95th percentile latency, rather than relying on averages alone.

    3. Building a Reproducible Evaluation Process

    Once the dimensions are defined, you need a repeatable process to produce comparable results. A typical process includes four steps.

    Step 1: Build a task set. Group tasks by business category. Attach an input, an expected output, or a judging rule to each task. The task set should cover common scenarios and edge cases. Where possible, draw tasks from real historical data, and anonymize that data.

    Step 2: Standardize the calling conditions. Tests for different models should use the same system instructions, temperature, and maximum output length. Otherwise, configuration differences will contaminate the comparison.

    Step 3: Record raw data. Save each call’s output, token usage, latency, and judging result, so you can review and recalculate results later.

    Step 4: Calculate a composite score. Normalize each dimension’s metric to the same range, then take a weighted sum. Weights should reflect business priorities. For example, for a batch code review service, quality and cost may be weighted higher than speed. For an interactive assistant, time to first token should carry more weight.

    4. Composite Score Example

    The code below shows how to normalize several metrics and combine them with weights into a single composite score. The model calling function is left for you to implement. Only the parts related to the evaluation logic are shown.

    1. from dataclasses import dataclass
    2. WEIGHTS = {"quality": 0.6, "cost": 0.2, "latency": 0.2}
    3. @dataclass
    4. class EvalResult:
    5. model: str
    6. pass_rate: float # Task pass rate, between 0 and 1
    7. cost_per_task: float # Average cost per task
    8. p95_latency: float # 95th percentile latency, in seconds
    9. def normalize(value, best, worst):
    10. """Linearly map a metric to the 0 to 1 range, where best maps to 1 and worst maps to 0."""
    11. if best == worst:
    12. return 1.0
    13. score = (value - worst) / (best - worst)
    14. return max(0.0, min(1.0, score))
    15. def composite_score(result, bounds):
    16. """bounds holds the (min, max) of each metric, used for normalization."""
    17. quality = normalize(result.pass_rate,
    18. best=bounds["pass_rate"][1],
    19. worst=bounds["pass_rate"][0])
    20. cost = normalize(result.cost_per_task,
    21. best=bounds["cost"][0],
    22. worst=bounds["cost"][1])
    23. latency = normalize(result.p95_latency,
    24. best=bounds["latency"][0],
    25. worst=bounds["latency"][1])
    26. return (WEIGHTS["quality"] * quality
    27. + WEIGHTS["cost"] * cost
    28. + WEIGHTS["latency"] * latency)
    29. if __name__ == "__main__":
    30. results = [
    31. EvalResult("model_a", pass_rate=0.82, cost_per_task=0.031, p95_latency=9.5),
    32. EvalResult("model_b", pass_rate=0.74, cost_per_task=0.006, p95_latency=3.2),
    33. ]
    34. bounds = {
    35. "pass_rate": (0.0, 1.0),
    36. "cost": (0.0, 0.05),
    37. "latency": (0.0, 15.0),
    38. }
    39. for r in sorted(results, key=lambda x: composite_score(x, bounds), reverse=True):
    40. print(r.model, round(composite_score(r, bounds), 3))

    The numbers in this code only demonstrate the normalization logic. They do not represent the performance of any real model. In practice, replace them with your own task set and call data.

    5. From Evaluation Results to Selection Strategy

    The purpose of evaluation is to support decisions, not to produce a ranking. For most teams, a tiered approach to model use is more practical:

    • Complex tasks, such as cross-file refactoring and root cause analysis of difficult defects, should prioritize models with strong reasoning and coding metrics, even at higher cost.
    • Batch tasks, such as log classification, text summarization, and format conversion, should favor models with better cost and speed. The quality requirement for each item in these tasks is relatively manageable.
    • Interactive tasks, such as code completion and Q&A assistants, should focus on time to first token. Caching and context trimming can further reduce actual latency.

    After tiering, you can design routing rules that automatically select a model based on task type, input length, and risk level. The routing rules also need to be calibrated continuously with evaluation data.

    6. Practical Considerations for Deployment

    Model prices, versions, and capabilities change over time. Label each evaluation conclusion with the date its data was collected. Establish a regular re-testing mechanism, for example every quarter or after a major model version update.

    Data security is equally important. Evaluation task sets may contain source code, business logs, and user information. Before sending any of this data to an external service, anonymize it and confirm that it complies with your internal data management requirements.

    Finally, evaluation metrics must align with business goals. If the pass rate is high but the fixes cannot be merged into the main branch, the test set may not reflect real scenarios. In that case, correct the task set first, then compare models.

    Model selection is an ongoing engineering process. Using the six-dimension framework and reproducible data, rather than subjective impressions, helps teams find a balance between cost, effectiveness, and user experience that fits their business.