A Practical Guide to LLM Selection: Building a Six-Dimension Quantitative Evaluation Framework
Large language models (LLMs) are evolving rapidly, making it difficult to choose the right one based solely on benchmark rankings. A model's performance can vary significantly across different business scenarios. This article introduces a practical framework for evaluating LLMs across six key dimensions—business weighting, pricing, context window, reasoning, coding performance, and language quality—concluding with a reusable selection process to help you find the best model for your specific needs and constraints.
LLM capabilities are evolving rapidly, and relying solely on benchmark leaderboards makes it difficult to determine which model best suits your business. A model that excels in a customer service scenario might perform poorly in code review. Therefore, the goal of model selection is not to find the globally strongest model, but to find the best combination that performs well under your specific scenarios, budgets, and constraints. Below is an evaluation method based on six dimensions, followed by a reusable selection process.
1. Determine Weights Based on Business Scenarios
Different businesses have vastly different needs for model capabilities, which determines the weight distribution across each dimension:
- C-end intelligent customer service: Response speed and cost carry the highest weights; minor differences in reasoning capabilities are usually unnoticed by users.
- R&D coding assistants: Code accuracy and depth of context understanding are core metrics, with room for flexibility on cost.
- Long document analysis and contract review: The context window size directly determines the feasibility of the solution.
- Multimodal scenarios (image-text understanding, document parsing): Multimodal capabilities must be included as a core evaluation criterion.
Therefore, before selecting a model, assign weights to the six dimensions and document the reasoning behind each weight. If this step is skipped, the subsequent evaluation results will be difficult to interpret.
2. Pricing: Calculate Total Cost, Not Just Unit Price
LLM APIs typically price input and output tokens separately. Price differences between models can reach tens of times; a cheap model might cost only a few cents to a few dollars per million output tokens, while flagship reasoning models might cost tens of dollars.
Three points to note when evaluating price:
- Evaluate input and output separately: In scenarios like RAG (Retrieval-Augmented Generation), the input is usually much larger than the output. A model with a low input unit price might be more cost-effective overall.
- Consider caching and batch processing discounts: Many services offer discounts for repeated prefixes and batch tasks, which can significantly reduce costs in high-throughput scenarios.
- Calculate the total bill, not just the unit price: A cheaper model that requires more retries or post-processing might not be cheaper overall.
The following code estimates daily cost:
def estimate_cost(input_tokens, output_tokens, in_price, out_price):"""in_price / out_price: Price per million tokens, same unit"""return input_tokens / 1e6 * in_price + output_tokens / 1e6 * out_price# Example: Single call with 2000 input tokens, 500 output tokens,# Input price 1.0 USD/million tokens, Output price 4.0 USD/million tokens,# Average 100 million daily callsper_call = estimate_cost(2000, 500, 1.0, 4.0)daily = per_call * 1e8print(f"Cost per call: ${per_call:.4f}")print(f"Daily cost: ${daily:,.0f}")
Based on the above unit prices and 100 million daily calls, the single-call cost is about $0.004, and the daily cost is about $400,000. The unit prices here are for demonstration only; please refer to the current price lists of each platform before actual estimation, and confirm whether the billing scope includes cache hits, batch discounts, and failed retries.
3. Context Window: Verify Effective Length First
The context window determines how much content a model can process at once. If the window is too small, long documents must be chunked, introducing extra engineering complexity like retrieval and summarization. If the window is large enough, you can hand the entire contract, full code repository, or multi-turn conversation history directly to the model.
The nominal window is not equal to the effective window. With long texts, a model’s recall ability for information in the middle is often weaker than at the beginning and end, a phenomenon commonly known as “lost in the middle.” When testing, you can use the “needle-in-a-haystack” method:
- Prepare a long text without the answer as the background, setting lengths at levels such as 4K, 32K, 128K, etc.
- Embed a verifiable fact (e.g., a fictional contract number) at the beginning, 25%, 50%, 75%, and the end of the background text.
- Ask the model to answer the fact, repeating each “length × position” combination at least 10 times and changing the background content.
- Calculate the recall rate for each combination and plot a curve by position.
The passing criteria should be set according to business needs. A reference threshold is: recall rate at all positions is no less than 90%, and the difference between the middle section and the beginning/end does not exceed 10 percentage points. If a model exceeds this gap, even with a large nominal window, it is not suitable for directly processing long documents.
4. Reasoning Capability: Segment by Task Difficulty
Reasoning capabilities include mathematical calculation, logical deduction, multi-step planning, and causal analysis. Reasoning models improve performance on complex tasks through chain-of-thought, but they generate more thinking tokens, increasing latency and cost.
In practice, you can arrange it as follows:
- For simple tasks like classification, rewriting, and information extraction, standard models are sufficient; there’s no need to pay extra for reasoning capabilities.
- For complex tasks like code debugging, solution planning, and data analysis, prioritize testing reasoning models.
- You can build a routing layer that uses a lightweight model to judge task difficulty first, then dispatches the task to models of different tiers.
When evaluating reasoning capabilities, record accuracy, average latency, and cost per call simultaneously, rather than just accuracy. Whether a model with a 3-percentage-point increase in accuracy but doubled cost is worth adopting depends on the business’s tolerance for errors.
5. Coding Performance: Build an Evaluation Set with Real Tasks
Coding capability has become one of the most important application scenarios for LLMs. The evaluation should cover the following four capabilities:
- Code generation: Can it write runnable code based on natural language descriptions?
- Code understanding and modification: Faced with snippets from a large codebase, can it accurately locate issues and complete modifications?
- Debugging and refactoring: Is its analysis of error messages accurate, and how good are its fix suggestions?
- Multi-language coverage: Besides mainstream languages, how does it perform with languages your team actually uses?
General leaderboards often differ from a team’s real needs. It is recommended to extract tasks from historical issues and code review records to build your own evaluation set. Each task can be recorded using the following table fields for reuse and maintenance:
| Field | Description | Example |
|---|---|---|
| Task ID | Unique identifier for tracking | CODE-017 |
| Task Type | Generation, understanding/modification, debugging, or refactoring | Debugging |
| Programming Language | Mainstream or niche language | Go |
| Input Material | Requirement description, code snippet, error log | Error log and related functions |
| Pass Criteria | Unit tests pass, no static check errors, etc. | All specified test cases pass |
| Weight | Proportion of this task in the total score | 0.2 |
| Task Source | Historical issues, code reviews, etc. | An online incident in 2025 |
6. Language Quality: Measure Token Counts Empirically
Language quality is not just about whether the model can speak a specific language (e.g., Chinese or other non-English languages), but also includes the following aspects:
- Understanding and appropriate use of idioms, colloquialisms, and internet slang.
- Strict adherence to specific language instructions, such as whether the model consistently follows a format like outputting only JSON.
- Token consumption. Different tokenizers split specific languages differently. The same text might consume significantly more tokens in one model, potentially doubling actual costs.
Regarding token consumption, do not infer costs based solely on the concept of “word segmentation.” It is recommended to use the same set of language-specific samples (e.g., 200 real business texts) to count the tokens for each candidate model, calculate the average token count per sample, and then plug it into the pricing formula from Section 2. For businesses operating in specific language markets, this dimension’s weight should be significantly higher than in general scenarios.
7. Response Speed: Let Load Testing Data Speak
Response speed includes Time to First Token (TTFT) and generation speed (Tokens/s). In streaming output scenarios, a TTFT exceeding two seconds will usually cause noticeable lag for users.
During evaluation, do not rely solely on official nominal values. Instead, conduct load testing under target concurrency and record the following metrics:
- P50, P95, and P99 of TTFT, rather than averages. Averages mask the lag issues of long-tail requests.
- Average generation speed (Tokens/s), noting the distribution of output lengths.
- Test conditions: Input length, output length, concurrency, request region, and testing time.
The performance of the same model can vary greatly under different times and concurrency levels, so the test conditions must match the production environment as closely as possible.
8. Build Your Own Selection Process
It is recommended to proceed with the following five steps:
- Define scenarios and weights: Assign weights to the six dimensions based on your business. For example, a customer service scenario could be set to speed 30%, price 30%, language quality 20%, and the remaining dimensions 20%.
- Build an evaluation set: Collect 50 to 200 real business samples covering typical and edge-case scenarios.
- Automated evaluation: Combine rule validation (is the format correct, can the code run) with model-based evaluation (using a stronger model as a judge). When using model-based evaluation, control two types of bias. First is position bias: you can swap the order of candidate answers and judge twice, taking the consistent result. Second is length bias: explicitly state in the scoring criteria that longer length does not result in extra points. Additionally, 10% to 20% of the results should be manually reviewed each round. If the consistency rate between the judge and human review is significantly low, adjust the scoring criteria or switch the judge model.
- Canary release: Allocate 5% to 10% of real traffic to candidate models to observe online metrics like satisfaction, human handover rate, and error rate.
- Build an adaptation layer: Encapsulate model calls through a unified gateway or adaptation layer so that switching models only requires configuration changes without altering business code.
The scoring phase can refer to the weighting code below. Scores for each dimension should come from measured data and be normalized from 0 to 10, rather than being based on impressions.
# Simplified weighted scoring example, scores are normalized 0-10 resultscandidates = {"model_a": {"price": 9, "context": 8, "reasoning": 7, "coding": 7, "chinese": 9, "speed": 9},"model_b": {"price": 5, "context": 9, "reasoning": 9, "coding": 9, "chinese": 7, "speed": 6},}weights = {"price": 0.2, "context": 0.15, "reasoning": 0.2, "coding": 0.2, "chinese": 0.15, "speed": 0.1}for name, scores in candidates.items():total = sum(scores[k] * weights[k] for k in weights)print(name, round(total, 2))
The running results are model_a 8.05 and model_b 7.6. The gap between the two models stems from price and speed; with different weights, the ranking might reverse. Therefore, the weights themselves need to be confirmed jointly with the business stakeholders.
