How to Benchmark Top LLMs: A Cost-Effective Evaluation Framework
This article shares a systematic approach to comparing top large language models after spending roughly a thousand yuan on a hands-on evaluation. It covers controlling variables before testing, designing a task set with real discriminative power, combining automated metrics with blind human review, calculating the true cost beyond per-token price, and reusable prompt templates. Readers will learn a repeatable engineering method for choosing models by scenario and running monthly re-evaluations.
1. Why a Paid Head-to-Head Evaluation Is Worth It
When teams adopt LLM capabilities, they often decide based on scattered impressions: a feature feels good in a trial, so they migrate everything; one unsatisfactory answer, and they dismiss the model entirely. The problem is that the sample is too small and the scenarios too narrow, so the conclusions do not transfer. Spending about a thousand yuan on a systematic comparison is not really buying “answers” but three assets: a reusable task set, a quantifiable scoring rubric, and an explainable cost model. These assets get used repeatedly throughout a project, and their marginal return far exceeds the one-time cost.
Note that this article does not evaluate any specific vendor or product. It abstracts the process into a general engineering method. Your absolute scores will vary depending on when you test and how you access the models, but the framework remains stable and usable.
2. Controlling Variables Before Evaluation
The most common mistake in model comparison is failing to isolate variables. Fix the controllable variables first:
- Sampling parameters: keep temperature, max output length, and stop conditions identical; lower the temperature when you need stable reproduction.
- Context construction: keep the system prompt, few-shot examples, and the number and order of retrieved snippets exactly the same.
- Input length tiers: group short inputs (a few hundred words), medium inputs (a few thousand words), and long inputs (tens of thousands of words) separately, so long-context ability is not masked by short tasks.
- Output parsing: use the same parser to extract structured fields; log parsing failures separately as engineering issues rather than deducting from model capability scores.
A sample evaluation driver structure:
cases = load_cases("taskset.jsonl") # each row has id, input, expected_schemadef run(case, client, cfg):resp = client.chat(system=SYS_PROMPT, user=case.input, **cfg)return parse(resp, case.expected_schema)report = {}for name, client, cfg in candidates:rows = [run(c, client, cfg) for c in cases]report[name] = aggregate(rows) # quality score + token usage + latency
3. Task Set Design: Making Scores Discriminative
The task set determines the ceiling of your evaluation. Using only open-ended prompts like “write a poem” makes results heavily dependent on subjective preference; using only multiple-choice questions fails to measure real engineering ability. A four-layer mix is recommended:
- Instruction-following layer: tasks with format constraints, field constraints, and prohibition constraints, testing whether the model can “follow orders.”
- Reasoning and code layer: give a function with defects and ask the model to locate the problem, provide a fix, and write test cases.
- Long-context layer: embed several facts in a long document to test retrieval and resistance to distraction.
- Stability layer: repeat the same task multiple times and observe output variance; high variance means the model is hard to constrain in production.
About 10–20 cases per category are enough to create effective differentiation. Keeping the total around a hundred cases keeps cost controllable while providing sufficient statistical significance.
4. Scoring Rubric: Breaking Subjective Feelings into Computable Items
Use a dual track of “automated metrics + blind human review.” Automated metrics include structural validity rate, field missing rate, code executability rate, unit test pass rate, fact hit rate, and redundancy. For blind human review, hide the model identity and score 1–5 on correctness, completeness, readability, and constraint adherence, then take the weighted average.
Total = 0.35*correctness + 0.25*constraint_adherence + 0.20*completeness + 0.10*readability + 0.10*latency_stability
Adjust the weights by business scenario: raise the weight of executability for coding scenarios; raise the weight of constraint adherence and readability for external-facing documentation.
5. Cost Accounting: Look Beyond Unit Price
Real cost = input token cost + output token cost + retry cost + manual rework cost. A model with a slightly higher unit price but a high first-pass rate often has a lower total cost. Record token usage and retry counts for each task, and compare using “cost per unit of valid output,” that is, total cost divided by the number of tasks that pass acceptance. If you use general cloud capabilities, combine logging services and monitoring alerts to aggregate usage, so you do not discover budget deviations only at month-end.
6. Reusable Prompt Template
Role: You are a senior backend engineer.Task: Fix the concurrency defect in the code below.Constraints:1) Output only one JSON object with fields root_cause, patch, tests;2) Do not add third-party dependencies;3) patch must be a directly applicable diff snippet;4) If information is insufficient, set need_more_info to true and explain what is missing.Input: <paste code and error message here>
The key to the template is not polished wording but fixing the “output contract” so that evaluation can be automated and online responses can be parsed.
7. Conclusion and Implementation Advice
The core conclusion from spending about a thousand yuan is this: differences in model capability are real, but the evaluation method and engineering constraints matter more for success. A three-step path is recommended: first, build a 50-case task set tailored to your own business and get automated scoring running; then, assign different capability tiers by scenario, routing simple tasks to a low-cost channel and complex tasks to a high-quality channel; finally, incorporate prompt templates, scoring sheets, and a cost dashboard into regular iteration, re-evaluating monthly. If you need elastic compute and unified operations, you can run the evaluation pipeline on a container platform on Baidu AI Cloud and use object storage to save task sets and results, achieving a reproducible and auditable evaluation loop.
