How to Scientifically Evaluate Large Language Models: Capability and Cost-Effectiveness
This article presents a practical framework for evaluating large language models (LLMs), with the goal of building a repeatable model-selection process. It explains why public benchmark scores should be used only as a first filter, and why teams should build their own private evaluation sets that reflect real business usage. It also shows how to assess capability across multiple dimensions, how to estimate inference costs and hidden overheads, and why cost-effectiveness matters more than the listed per-token price. In addition, it covers scaling laws and sparse architectures such as Mixture of Experts (MoE), the trade-offs between open-source and hosted API models, and a reusable evaluation workflow that teams can apply as models continue to evolve.
Introduction: Why You Should Evaluate Before You Adopt
Whenever a new LLM is released, the technical community tends to split in two. Some are impressed by parameter counts or leaderboard rankings. Others complain that it’s too expensive or doesn’t live up to the hype. These debates are usually less about whether the model itself is good or bad, and more about the lack of a shared evaluation method. When evaluation lacks focus, conclusions become inconsistent.
For engineering teams, model selection affects long-term inference costs, user experience, and operational complexity. A quantifiable and reproducible evaluation process therefore matters more than chasing any single headline release.
This article sets aside specific products and treats “how to evaluate an LLM” as a general engineering problem. It covers three areas: capability evaluation, cost estimation, and real-world validation.
1. Capability Evaluation: Don’t Rely on a Single Benchmark Score
Benchmarks: Useful References, With Limits
Public benchmarks, such as standard datasets for general reasoning, code generation, math problem solving, and multilingual understanding, are the most direct evaluation tool. They provide a common point of comparison for different models. However, they have two clear limitations:
- Data contamination: a model may have already seen the test data during training.
- Distribution mismatch: the benchmark data may not match your real-world workload.
Leaderboard scores should therefore serve as an initial filter, not as the final basis for a decision.
Build a Private Evaluation Set That Fits Your Business
A more reliable approach is to build a private evaluation set tailored to your use case. The process typically involves:
- Sampling typical inputs from real business logs;
- Having humans annotate the expected outputs or scoring criteria;
- Covering edge cases and long-tail problems.
The evaluation flow can be sketched as follows:
# Simplified LLM evaluation flowtest_cases = [{"input": "Sample user question 1", "expected": "Expected answer or scoring criteria"},{"input": "Sample user question 2", "expected": "Expected answer or scoring criteria"},# ... more samples covering typical and edge-case scenarios]def evaluate(model_client, cases):scores = []for case in cases:response = model_client.generate(case["input"])score = judge(case["expected"], response) # rule-based or human scoringscores.append(score)return sum(scores) / len(scores)print(evaluate(my_model, test_cases))
Assess Multiple Dimensions, Not a Single Point
Capability is composite. At a minimum, a model should be assessed on the following dimensions:
- Instruction following: whether it strictly adheres to the required format and constraints;
- Long-text understanding: recall and reasoning consistency over long contexts;
- Multi-turn conversation stability: whether it maintains context and stays consistent with its assigned role;
- Hallucination rate: how often it invents facts;
- Stability and latency: P50/P95 response times.
A high score on a single dimension cannot hide weaknesses in others. Problems such as broken conversations across turns or forgotten content in long documents often surface only in real business use.
2. Cost Estimation: Putting a Number on “Is It Expensive?”
Most complaints about cost stem from a lack of quantitative analysis. LLM inference costs are mainly driven by token usage. Input and output tokens are typically counted separately, and their unit prices often differ.
A Basic Cost Model
An approximate total cost formula is:
Total cost = input tokens × input unit price + output tokens × output unit price
Note that output tokens are usually priced higher than input tokens. For applications that mainly generate long-form output, total costs can increase significantly.
Don’t Overlook Hidden Costs
Beyond unit prices, the following also need to be taken into account:
- Additional token consumption from retries and failed requests;
- Token inflation from context concatenation (conversation history accumulates across turns);
- Concurrency and rate-limiting policies during traffic peaks;
- Engineering effort required for migration and adaptation.
Judge by Cost-Effectiveness, Not Unit Price
The right metric for comparison is the overall cost per completed unit of work, rather than the price per million tokens alone. A cheaper model can end up costing more overall if it needs more retries or longer prompts to achieve the same result. For example:
def cost_effectiveness(task_cost, task_quality):# Cost per unit of quality; lower is betterreturn task_cost / max(task_quality, 1e-6)
3. Scale and Architecture: Is More Parameters Always Better?
Diminishing Returns From Parameter Scale
The industry has widely observed a scaling law relationship between parameter count and capability. However, the growth is often non-linear, while training and inference costs rise sharply. Going from tens of billions of parameters to the trillion level does not necessarily bring a proportional improvement in capability for the added cost.
The Rise of Sparse Architectures
To balance capability and cost, sparse architectures such as Mixture of Experts (MoE) are increasingly used. These models have a large total parameter count, but each inference pass activates only a subset of the experts. This preserves model capacity while keeping actual compute overhead under control. When evaluating such models, focus on the activated parameter count rather than the total parameter count, because the activated count is closer to the real inference cost.
4. Open Source vs. Closed Source: Trade-Offs Under Different Constraints
- Open-source models: they can be deployed privately, so data never leaves your environment, and they can be fine-tuned. However, your team is responsible for operations, scaling, and security hardening.
- Hosted APIs: they are quick to integrate and require no infrastructure management. However, you are limited by the provider’s rate limits, pricing, and data compliance policies.
If data sovereignty and long-term costs are your main concerns, privately deployed open-source models are a common choice. If fast launch and rapid validation are the priority, hosted services are more lightweight. The two approaches are not mutually exclusive. Many teams adopt a hybrid strategy: private deployment for critical scenarios, and cloud services with elastic capacity for other workloads.
When deploying in the cloud, you can use general-purpose cloud capabilities to build evaluation and inference pipelines. For example:
- Object storage can archive evaluation data and logs.
- Message queues can smooth out traffic spikes.
- Container platforms can host elastic inference services.
- Logging, monitoring, and alerting services can continuously track P95 latency and error rates.
Cloud platforms such as Baidu AI Cloud generally offer these types of general-purpose capabilities, making it easier for teams to combine them and build solutions as needed.
5. Practical Recommendations: A Reusable Evaluation Workflow
- Define the task and acceptance criteria: decide what “good” means before selecting a model;
- Build a private evaluation set: base it on real data, make it reproducible, and cover edge cases;
- Score across dimensions: measure capability, cost, latency, and stability separately;
- Start with a small-scale canary: validate with limited traffic before gradually ramping up;
- Keep monitoring: after launch, use monitoring and alerting to track quality drift and cost fluctuations, closing the loop.
Conclusion
Whether a new model lives up to the hype should not be decided by leaderboard rankings or emotional complaints about price. It should be answered by a rigorous evaluation process. Break capability down into measurable dimensions, express costs as reproducible formulas, and factor architecture and deployment options into the trade-offs. Once the evaluation logic is clear, model selection becomes far less stressful. For developers, chasing every new model release is less worthwhile than building a reusable evaluation methodology that is updated as models evolve.
