Evaluating Large Language Models in Practice: From Hands-On Trials to Engineering-Driven Selection
A practical framework for evaluating large language models: how to define evaluation goals, build a small test set, score models across six dimensions, manage subscription quotas, handle rate limiting with exponential backoff, and turn evaluation data into a reliable selection decision.
1. Start with a Common Trap
Many developers have run into this situation: a subscription is about to expire, and the account still holds a large amount of remaining credits or quota. Since the credits cannot be cashed out or carried over, the natural urge is to burn through them quickly. That motivation skews judgment — usage volume gets mistaken for quality, while the actual quality of the tasks gets ignored.
When evaluating a large language model, keep two things separate: how well the model performs on your specific tasks, and whether its resource consumption is reasonable. The method below applies to any general-purpose LLM, regardless of vendor.
2. Define Your Evaluation Goals First
Before evaluating, answer three questions:
- What is the primary use case? Code completion, documentation writing, data processing, or knowledge Q&A — different task types demand different evaluation priorities.
- How often will it be used? Multiple calls per day versus occasional use determines whether a long-term subscription is worth it.
- What is the cost of failure? Wrong code introduces defects, while a wrong summary only hurts reading efficiency. Each tolerates different levels of inaccuracy.
Write your goals as verifiable statements, e.g., “Convert an API document into test cases within ten minutes, with a pass rate of at least 80%.” Without verifiable goals, evaluation degrades into subjective scoring.
3. Build a Small Evaluation Set
The set doesn’t need to be large — 30 to 50 samples are usually enough to surface the main issues. Cover four categories:
- Common tasks: high-frequency daily scenarios, ideally around 60% of the set.
- Edge cases: incomplete inputs, vague requirements, or contradictory constraints.
- Long-input tasks: material exceeding several thousand words, to test how well key information is retained.
- Automatically verifiable tasks: answers a machine can judge, making quantified statistics easy.
For each sample, record the input, the judging criteria, and its category. For open-ended tasks, judging criteria matter more than reference answers, since these tasks rarely have a single correct output.
4. Design Evaluation Dimensions
Score the model across six dimensions, each on a 1–5 scale:
- Correctness: does the output meet the judging criteria?
- Instruction following: are constraints on format, word count, language, etc. honored?
- Consistency: do repeated runs of the same prompt produce consistent results?
- Latency: time from sending the request to receiving the complete response.
- Availability: how often queuing, timeouts, or rate limits occur.
- Unit cost: quota or money consumed per successful task.
Unit cost is the most easily overlooked. A model with slightly better answers that consumes three times the quota may not be more cost-effective over the long run.
5. An Automated Evaluation Example
The following script shows the basic structure of an evaluation framework. call_model is a placeholder — replace it with the actual call logic for your service.
import timefrom dataclasses import dataclassfrom typing import Callable@dataclassclass Case:prompt: strcategory: strcheck: Callable[[str], bool] # returns True if the case passesdef call_model(prompt: str) -> str:"""Placeholder: replace with your actual model invocation logic."""raise NotImplementedErrordef run_suite(cases: list[Case], repeat: int = 3) -> dict:report = {}for case in cases:passed, latencies = 0, []for _ in range(repeat):start = time.perf_counter()answer = call_model(case.prompt)latencies.append(time.perf_counter() - start)if case.check(answer):passed += 1stat = report.setdefault(case.category, {"total": 0, "passed": 0, "latency": []})stat["total"] += repeatstat["passed"] += passedstat["latency"].extend(latencies)return report
The repeat parameter serves two purposes: computing the pass rate, and observing how results vary for the same input, which measures consistency. Output is aggregated by category, making it easy to compare a model’s behavior across different task types.
6. Managing Quotas and Costs
Subscription quotas typically come with billing periods and expiration dates. Consider these practices:
- Review usage mid-cycle. If remaining quota clearly exceeds what the remaining time requires, put it toward real work instead of scrambling to burn it.
- Schedule high-value tasks during periods with ample quota, and delegate repetitive, low-value work to local scripts or rule-based tools.
- Set usage alerts. Adjust promptly when consumption exceeds the planned rate.
- Cache results for identical queries to avoid repeated requests.
Last-minute quota dumping rarely produces anything useful. Rather than firing off purposeless requests just to use up credits, convert the quota into a clear evaluation record that informs your next selection decision.
7. Handling Queues and Rate Limits
When the service throttles or queues requests, retrying immediately worsens congestion. A better approach is exponential backoff with jitter.
import randomimport timedef call_with_backoff(prompt: str, max_retries: int = 5) -> str:for attempt in range(max_retries):try:return call_model(prompt)except Exception:if attempt == max_retries - 1:raisedelay = min(2 ** attempt, 30) + random.uniform(0, 1)time.sleep(delay)
A backoff cap prevents waits from growing indefinitely, and random jitter prevents many clients from retrying simultaneously. For batch jobs, put requests into a queue and submit them gradually within a concurrency limit.
8. Reaching a Selection Decision
After the evaluation, organize results into a table listing pass rate, average latency, unit cost, and dominant failure modes per task category. Then factor in task priorities to draw conclusions.
Your conclusion should answer three questions: which task types this model is worth using for, which task types need an alternative, and whether to keep or renew the subscription. Only conclusions grounded in data make selection reliable. The real value of evaluation is helping the team see its own needs, resources, and risks clearly.
