Evaluating General-Purpose LLMs: A Practical Framework for Task Success, Cost, and Reliability
This article presents a practical approach to evaluating general-purpose large language models beyond public leaderboard scores. It describes a four-layer evaluation framework based on task success, defines six core assessment dimensions, and explains how to compare subscription and pay-as-you-go pricing as total cost of ownership. It also covers reliability, controllability, model routing, combined workflows, and a selection checklist so teams can make reproducible, regression-friendly model choices under real production constraints.
1. Build the Framework First: Replace “Subjective Feel” with Task Success Rate
A common mistake when comparing general-purpose LLMs is to quote public leaderboard scores directly. Leaderboard question distributions are fixed, prompts are tuned, and scoring tends to favor objective questions, creating a systematic gap from long-tail business needs. A more reliable approach is to define the task set first, then define pass criteria, and only then discuss scores.
A minimal usable evaluation framework has four layers:
- Task layer: extract 50–200 representative requests from real business scenarios, covering both high-frequency simple tasks and low-frequency complex tasks, with a suggested ratio of 7:3.
- Judgment layer: specify for each task an automatically verifiable pass condition (whether it compiles, whether unit tests pass, whether terminology matches the glossary, whether numerical values are correct).
- Constraint layer: record latency, token consumption, failed retries, and the number of content-policy blocks.
- Aggregation layer: calculate a weighted score rather than a simple average.
# Illustration: weighted scoring with constraint penaltiesWEIGHTS = {"multimodal": 0.15,"long_context": 0.15,"code": 0.25,"language": 0.20,"reasoning": 0.15,"freshness": 0.10,}def score(report: dict) -> float:base = sum(WEIGHTS[k] * report[k]["pass_rate"] for k in WEIGHTS)# Stability penalty: higher retry and block rates reduce practical usabilitypenalty = 0.5 * report["retry_rate"] + 0.5 * report["block_rate"]return round(base * (1 - min(penalty, 0.5)), 4)
The constraint layer is critical. The same model may perform well in a demo environment but be completely unusable in production due to rate limits, exhausted quota, or session data policies. If these losses do not enter the score, the evaluation conclusion will be distorted.
2. Breaking Down Six Core Dimensions
Multimodal capability. Do not test only whether the model can recognize something; test structured output quality. Given a UI screenshot, can it reconstruct a component tree that conforms to the specification? Given a chart, can it read the meaning of the axes and provide a value range? The criteria should focus on field completeness and format validity, not on whether the output “looks right.”
Long context. The value of a million-token window depends on effective recall, not nominal length. A standard method is a needle-in-a-haystack variant: insert several conflicting facts at different depths in a long document and observe whether the model cites the correct passage and whether it is distracted by middle sections. Also record first-token latency and cost, because long windows often imply linear or even superlinear overhead.
Code generation. The only credible judgment is execution: compilation passes, unit tests pass, and static checks report no new warnings. For complex text-processing tasks, also measure the first-pass success rate, meaning the proportion that meets acceptance criteria without rework. A common pattern is that one model tier has a high first-pass success rate but a high unit price, while another is cheaper but requires multiple rounds of rework. Real cost should be calculated as “total token consumption × unit price + human rework time.”
Language and terminology compliance. For translation tasks, use dual judgment: the proportion of terms matching a professional glossary, and whether the English follows target-language conventions (articles, singular and plural forms, overuse of passive voice, punctuation habits). An easily overlooked detail is punctuation style: some models tend to use many em dashes and long parentheticals, which should be explicitly constrained in the prompt, for example:
Writing constraints:1. Do not use em dashes; use commas or split into separate sentences.2. See the appendix for the glossary; keep terms not in the glossary in the source language and add a note.3. Output only the translation, with no explanation.
Math and reasoning. Use problem sets with verifiable answers, and record both accuracy and end-to-end time. On problems of the same difficulty, speed differences often affect experience more than accuracy differences, so “correct output per unit time” is more instructive than accuracy alone.
Freshness and retrieval. When real-time information needs to be checked, the evaluation focus shifts from generation capability to the retrieval pipeline: whether verifiable sources are provided, whether citations are consistent with the conclusion, and whether refusals are appropriate. A model without retrieval capability should fail such tasks directly rather than receive compensatory points for fluent generation.
3. Cost and Quota: Convert Subscriptions into TCO
Pay-as-you-go billing and monthly subscriptions have completely different cost structures. Evaluation should normalize both into “total cost to complete a unit of task volume”:
- Subscription: monthly fee ÷ monthly completed tasks, with failed tasks caused by rate limits deducted;
- Pay-as-you-go: input and output tokens are priced separately; in long-document scenarios the input share is very high, so actual consumption after compression and retrieval augmentation must be measured.
From an engineering perspective, cost can be reduced by using pre-retrieval to narrow the context, caching high-frequency prefixes, and routing simple requests to lightweight models. If cloud model services are used, object storage can hold evaluation corpora, message queues can smooth peaks, container platforms can host inference and evaluation tasks, and log services and monitoring/alerting can track failure rates and quota levels, forming a closed loop. Baidu AI Cloud’s general-purpose capability categories in these scenarios (model services, object storage, log services, monitoring and alerting, etc.) can serve as implementation references; refer to the official documentation for specific specifications.
4. Stability and Controllability: The Most Underestimated Dimensions
Different product lines from the same provider may differ more in capability tier than products from different vendors, so “choosing a higher tier” does not equal “choosing the right one.” In addition, check four areas carefully:
- Whether quota and rate-limit policies match business peaks;
- Whether session and history data retention policies meet compliance requirements;
- The strictness of content policies; overly rigid alignment significantly increases false blocks on normal tasks;
- The frequency of service changes; frequent capability or quota adjustments break regression baselines.
An engineering recommendation is to abstract a unified gateway layer that shields specific interface differences and makes models replaceable:
class ModelClient:def chat(self, messages, **kw): ...def embed(self, texts): ...class Router:def pick(self, task): # Route by task type, cost budget, and current quota levelreturn self.registry[task.profile]
5. Combined Workflows: No Single-Model Optimum
Evaluation conclusions are often not “one provider wins everything” but a division of labor. A typical reusable pipeline is:
- Retrieval and fact collection: a channel with real-time retrieval capability produces a fact list with sources;
- Draft generation: a model with rigorous language conventions and few detail errors produces the first draft;
- Refinement and restructuring: a model stronger in creativity and long-form structure polishes the draft;
- Automated validation: glossary, punctuation rules, code unit tests, and numerical checks are all scripted;
- Archiving and regression: write results to the log service and add them to the next evaluation set.
6. Selection Checklist
- For high-frequency daily tasks, prioritize the availability and style fit of free or low-cost tiers;
- For complex text and code tasks, prioritize first-pass success rate over unit price;
- For long-document and multimodal scenarios, actually test effective recall and structured-output validity;
- For strongly real-time scenarios, choose only solutions with a retrieval pipeline;
- For production access, use APIs or developer platforms rather than relying on web UI interactions;
- Re-run the evaluation set quarterly, and base conclusions on data rather than impressions.
Following this framework turns model selection from “who feels stronger” into “who achieves the best task success rate and total cost under given constraints.” The conclusions are reproducible, regression-friendly, and can be updated continuously as models iterate.
