How to Scientifically Evaluate the Real Capabilities of Large Language Models
This article presents a practical engineering approach to evaluating large language models. It explains how to define evaluation dimensions, choose suitable evaluation methods, build business-relevant test sets, run repeatable evaluation workflows, and factor cost and engineering constraints into model selection.
Introduction: Why “Good to Use” Should Not Be Based on Gut Feeling
When a team is about to integrate a large language model, one of the most common questions is: “Is this model good to use?”
The problem is that “good to use” is a highly subjective description with unclear boundaries. Some teams care whether code generation passes on the first attempt. Others care whether long-context understanding is reliable. Still others only care whether inference cost can be reduced to an acceptable level.
If these implicit requirements are not made explicit, any evaluation conclusion will eventually degrade into personal preference.
Scientific evaluation should answer three questions:
- In what scenarios will the model be used?
- What criteria should be used to measure it?
- How can reproducible conclusions be obtained?
Once these three points are clear, model selection becomes an engineering problem rather than guesswork. The following sections discuss evaluation dimensions, evaluation methods, benchmark construction, and cost engineering.
1. Core Dimensions for Evaluating Large Language Models
Evaluating a large language model should not rely on a single metric. Instead, the model should be treated as a multi-dimensional “capability vector.”
1.1 Basic Language Capabilities
This is the most fundamental requirement. It includes grammatical correctness, contextual coherence, multilingual support, and instruction-following ability.
Even if a model has strong domain knowledge, frequent failures in basic tasks such as “understanding instructions” and “outputting in the required format” will dramatically increase engineering costs during deployment.
When evaluating this dimension, focus on whether the model can:
- Strictly follow output format constraints, such as returning a fixed JSON structure
- Maintain contextual consistency across multiple turns of dialogue
1.2 Domain-Specific and Scenario-Specific Capabilities
Different tasks place very different demands on a model.
- Code generation tasks focus on executability and edge-case handling.
- Text summarization tasks focus on information compression and key-point coverage.
- Mathematical and logical reasoning tasks focus on the correctness of multi-step derivation.
The key principle here is: evaluate the model using your own business tasks, not someone else’s conclusions.
A model that performs well on a public benchmark may not fit your vertical domain terminology or unusual data distributions.
1.3 Engineering and Performance Characteristics
Moving from laboratory metrics to production readiness requires crossing an engineering gap. Evaluation should cover:
- Time to first token and overall response time: These directly affect interaction quality.
- Throughput and concurrency: Can the model support peak traffic?
- Context window length: Can the model process long documents in a single request?
- Stability and rate-limiting strategy: Will the system experience queuing, timeouts, or degradation under high load?
In real-world usage, engineering characteristics often matter more than leaderboard scores. A model that cannot handle queuing under load may fail in production despite strong benchmark results.
1.4 Cost and Resource Consumption
The cost of model inference is usually directly related to token consumption.
When evaluating cost, comparing unit price alone is not enough. The total cost of completing the same task should be considered.
A model with a lower unit price may still be more expensive overall if it requires repeated retries or multiple interactions to produce acceptable results.
1.5 Safety and Compliance
This dimension includes:
- Sensitive content filtering
- Output controllability
- Whether user data is used for training
- Whether audit logs are traceable
For enterprise applications, safety and compliance can often be a mandatory entry requirement.
2. Main Evaluation Methods and Their Use Cases
2.1 Public Benchmarks
The industry has a set of public benchmarks used to compare the general capabilities of models.
Their value is that they provide a baseline reference. However, their limitations are also clear: training data may overlap heavily with evaluation sets, causing inflated scores.
Therefore, public leaderboards are suitable for initial screening, but they should not be the final decision basis.
2.2 Automated Evaluation
Automated evaluation uses rule-based checks or “model-as-a-judge” methods to score outputs in batches.
- Rule-based methods are suitable for tasks with clear correctness criteria, such as whether generated code passes unit tests.
- Model-as-a-judge methods are suitable for relatively ranking open-ended generation tasks.
The advantages of automated evaluation are speed, scalability, and regression-friendliness. The drawback is that the scoring dimensions may be simplified.
2.3 Human Evaluation
Human evaluation involves domain experts subjectively scoring output quality. This method is closest to real user experience.
It is suitable for open-ended, creative, or highly specialized tasks.
The disadvantages are high cost, slow speed, and subjectivity. To reduce bias, multiple reviewers are usually needed, along with unified scoring standards.
2.4 Online Canary Testing and A/B Testing
In real traffic, different models or model versions can be compared through traffic splitting.
Decisions can then be made based on business metrics such as:
- Conversion rate
- Task completion rate
- User satisfaction
This is the method closest to production reality, but it requires sufficient traffic and a proper instrumentation system.
3. Building a Business-Relevant Evaluation Set
The evaluation set is the foundation of the entire evaluation system.
A high-quality evaluation set should satisfy the following conditions:
- Close to real scenarios: Test cases should come from actual business requests rather than being artificially constructed.
- Coverage of typical and edge cases: The set should include high-frequency common tasks, as well as abnormal inputs, extremely long inputs, and adversarial prompts.
- Clear evaluation criteria: Each case should define in advance what kind of output is considered acceptable, making automated scoring possible.
- Maintainability: The set should expand as the business evolves, forming a regression baseline to prevent capability regression after model upgrades.
Initially, a few dozen high-quality test cases are enough. Quality matters more than quantity. First establish a complete evaluation loop, then gradually expand the set.
4. Example Evaluation Workflow
The following is a minimal evaluation script showing how to organize a complete pipeline of:
- test case definition
- model invocation
- scoring
- report aggregation
Replace model_client with the actual model invocation wrapper you are using.
import time# 1. Define test cases: input + evaluation dimensionstest_cases = [{"input": "Please implement quicksort in Python and explain the time complexity.","criteria": ["Correctness", "Code executability", "Edge-case handling"]},{"input": "Explain why database indexes can speed up queries, using an easy-to-understand analogy.","criteria": ["Accuracy", "Clarity of expression", "Appropriateness of analogy"]},]def evaluate_response(response, criteria):"""Score a single output by dimension.This can be implemented with rule-based validation or a model judge."""scores = {c: score_by_dimension(response, c) for c in criteria}return {"response": response, "scores": scores}def run_eval(model_client, test_cases):report = []for case in test_cases:start = time.perf_counter()resp = model_client.call(case["input"]) # Call the model under evaluationlatency_ms = (time.perf_counter() - start) * 1000report.append({"input": case["input"],"latency_ms": round(latency_ms, 1),**evaluate_response(resp, case["criteria"]),})return reportdef summarize(report):total = len(report)avg_latency = sum(r["latency_ms"] for r in report) / totalprint(f"Number of cases: {total}, Average latency: {avg_latency:.1f} ms")# Additional metrics can be added here, such as average score per dimension, pass rate, and error distribution.
The value of this skeleton is that it turns evaluation into repeatable and version-controllable code.
Whenever the model is changed or the prompt is adjusted, the evaluation can be rerun to obtain a comparable structured report.
Many cloud platforms, such as Baidu AI Cloud, also provide general capabilities such as model invocation monitoring and logging services. Metrics such as latency, error rate, and token consumption can be integrated into a unified observability system, further reducing the engineering cost of evaluation.
5. Cost and Practical Engineering Considerations
Beyond technical evaluation, teams must also calculate cost.
The real cost is:
Real cost = unit price per call × number of calls required to complete a task × total number of calls
When evaluating cost, three hidden costs deserve particular attention:
- Retry cost: If one output does not meet requirements, multiple retries may be needed, causing token consumption to increase significantly.
- Queuing and rate-limiting cost: Waiting time caused by queuing during peak periods is also a hidden user-experience cost.
- Marginal cost from longer contexts: Long prompts can significantly increase both billing and latency for each call.
A rational approach is to include “average token consumption required to complete the same task” as an evaluation dimension during the evaluation phase. Decisions should be based on overall cost-performance, not unit price alone.
6. Common Pitfalls and Best Practices
Pitfall 1: Relying only on leaderboards.
A high public benchmark score does not mean the model fits your scenario. Best practice is to use your own evaluation set as the primary reference.Pitfall 2: Testing only the happy path.
Testing only ideal inputs can hide many edge-case problems. Make sure to include abnormal and adversarial cases.Pitfall 3: Ignoring regression.
Models are upgraded and prompts are adjusted. Only by turning the evaluation set into a regression test suite can silent capability degradation be prevented.Pitfall 4: Treating selection as a one-time decision.
The model ecosystem evolves rapidly. It is recommended to establish a regular re-evaluation mechanism to keep model selection dynamically updated.
Conclusion
Evaluating large language models should move from subjective impressions to objective, reproducible engineering methods.
Only by breaking down capability dimensions, building business-relevant evaluation sets, combining automated and human evaluation, and incorporating cost and engineering characteristics into the same scorecard can reliable model-selection conclusions be reached.
When evaluation becomes a repeatable process rather than a one-time trial experience, the question of “which model is good to use” finally has an answer that can withstand scrutiny.
