Evaluating LLM Performance in Real-World Development Projects
A practical framework for assessing large language models in development work: why subjective impressions are unreliable, how to define evaluation goals, build representative test sets, define quantitative metrics across quality, stability, efficiency, and cost, and implement automated evaluation pipelines with human review, regression testing, and compliance checks.
Why “It Feels Strong” Is Not a Reliable Evaluation
In day-to-day development work, many people evaluate a model by trying it on one or two real tasks and then concluding it is “impressive” or “not good enough.” While such hands-on experience has some value, it comes with clear limitations.
First, personal experience is heavily influenced by task selection. The types of tasks a developer commonly works on determine which capabilities they can observe. Someone who frequently writes scripts may overestimate the model’s coding ability, while those focused on long-document analysis may care more about context window size and information extraction stability.
Second, prompt style changes outcomes. The same model can produce significantly different results depending on prompt structure, number of examples, and constraints. If someone only tries a single prompt format, it is difficult to judge the model’s true ceiling.
Third, psychological expectations amplify impressions. When encountering a new model, people tend to remember impressive responses while overlooking failures. Social media comments are often humorous, exaggerated, or extreme — they spread emotion effectively but should not be treated as a technical basis for decisions.
Therefore, evaluating a model requires converting subjective impressions into measurable, repeatable metrics.
Define Evaluation Goals First
Before evaluating, a team needs to answer three questions.
- What is the business scenario? Common scenarios include code generation and review, requirement document summarization, customer support Q&A, structured data extraction, and multi-turn dialogue. Different scenarios demand different core capabilities.
- What defines success? For code generation, success might be “the percentage of output that passes unit tests.” For data extraction, it might be “field-level accuracy.” For Q&A, it might be “the percentage of answers that are factually correct with valid citations.”
- What are the constraints? These include acceptable response latency limits, per-task cost budgets, whether data is allowed to leave the organization, and whether output format must conform to a specific structure.
Once goals are clearly defined, evaluation has direction. Without them, teams risk debating over irrelevant metrics.
Build a Representative Evaluation Set
The test set is the foundation of the entire evaluation. Its quality determines whether conclusions are trustworthy.
Sampling Principles
Evaluation samples should come from real business data — for example, historical support tickets, production logs, or actual requirement documents. Public datasets can also be used, but they must be checked for distributional alignment with your business context.
Samples should cover a range of difficulty levels: easy tasks, moderate tasks, and edge cases. Including only easy samples produces inflated results; including only extremely difficult ones underestimates the model’s value in everyday work.
Sample size matters. For binary pass/fail metrics, a few dozen samples produce very wide confidence intervals and unstable conclusions. In practice, each key scenario needs at least several hundred samples to reliably distinguish subtle differences between two models.
Annotation Guidelines
Each sample should contain an input, a reference answer or scoring rubric, and necessary metadata. Here is a generic data structure:
{"id": "task-0001","category": "code_generation","difficulty": "medium","prompt": "Write a function that takes a list of integers and returns the list with duplicates removed while preserving original order.","reference": {"type": "unit_test","tests": ["assert f([1,2,1]) == [1,2]", "assert f([]) == []"]}}
For open-ended questions, reference answers are rarely unique. In such cases, write scoring rubrics that list required points, prohibited errors, and bonus criteria. Have multiple annotators score independently, compute inter-annotator agreement, and then merge results.
Define Quantitative Metrics
It is recommended to organize metrics into four categories: quality, stability, efficiency, and cost.
Quality Metrics
- Task pass rate: the proportion of samples whose output meets the scoring criteria.
- Factual error rate: the proportion of answers containing verified false statements.
- Format compliance rate: the proportion of outputs that downstream programs can parse correctly.
- Refusal rate: the proportion of questions the model should answer but declines. This must be interpreted alongside safety requirements.
Stability Metrics
- Consistency across multiple runs of the same input, measuring variance caused by randomness.
- Regression differences between model versions, identifying whether a new version breaks existing capabilities.
Efficiency Metrics
- Time to first output token, reflecting perceived response speed.
- Median and 95th percentile end-to-end latency, useful for batch processing and high-concurrency scenarios.
Cost Metrics
The cost per successful task is calculated as follows:
Cost per successful task = cost per call × average number of calls ÷ task pass rate
This formula matters because a model with a low unit price but low pass rate may require many retries, making it more expensive in the end.
Implement Automated Evaluation with Code
The following example shows the basic structure of an evaluation pipeline. The model_fn is a wrapper around the model under test, and judge_fn is a scoring function. Both should be implemented by your team based on your own interfaces and tasks; this example does not reference any specific service.
import timefrom statistics import mean, mediandef run_evaluation(model_fn, testset, judge_fn):records = []for item in testset:start = time.perf_counter()try:output = model_fn(item["prompt"])error = Noneexcept Exception as exc:output = ""error = str(exc)latency = time.perf_counter() - startscore = 0.0 if error else judge_fn(output, item["reference"])records.append({"id": item["id"],"category": item["category"],"score": score,"latency": latency,"error": error,})return summarize(records)def summarize(records):scores = [r["score"] for r in records]latencies = [r["latency"] for r in records]errors = [r for r in records if r["error"]]return {"pass_rate": mean(scores),"latency_p50": median(latencies),"latency_max": max(latencies),"error_rate": len(errors) / len(records),}
Several points matter in this code. First, exceptions must be recorded and factored into results — they cannot be silently skipped, or an unstable API will appear to have an inflated pass rate. Second, latency statistics should include failed samples to reflect the true waiting cost. Third, summary results should be broken down by category to prevent overall averages from masking weaknesses in specific task types.
Human Evaluation and Blind Testing
Automated scoring cannot fully cover semantic quality — such as whether an explanation is clear or whether a reasoning chain is coherent. Human evaluation is needed here.
A double-blind setup is recommended. Reviewers see only an ID and the content, not which model produced it. Each output is scored independently by at least two reviewers across dimensions including correctness, completeness, clarity, and actionability, using a unified five-point scale with written criteria for each level.
After review, compute inter-reviewer agreement using a metric such as Cohen’s kappa. If agreement is low, the scoring rubric is not clear enough and must be revised before re-evaluating. Only when review results are stable are differences between two models worth discussing.
Stability and Regression Testing
Model capabilities are not fixed. When a service provider adjusts parameters, updates versions, or changes safety policies, previously stable tasks can fluctuate. Therefore, evaluation should be integrated into the continuous integration pipeline.
Specific practices include:
- Maintaining a fixed core regression set that runs automatically after every model change.
- Setting pass-rate thresholds for critical tasks, blocking release when thresholds fall below target.
- Explicitly recording sampling parameters such as temperature to ensure reproducibility.
- Running the same input multiple times to observe output variance, especially for structured-output scenarios.
Data Security and Compliance
Evaluation processes involve business data, and this is often overlooked. Teams need to confirm: does the test data contain personal information or trade secrets? Is sending data to an external service allowed? Are sensitive contents retained in logs?
For sensitive data, perform anonymization or desensitization before it enters the evaluation pipeline. Credentials such as API keys should be stored in environment variables or a dedicated key management service — never written into code or evaluation reports.
Cost-Performance Trade-offs
In production systems, a single model is rarely the optimal solution. A more common approach is routing requests by task difficulty: simple tasks go to a fast, cheap model, while complex tasks go to a more capable one.
Before implementing a routing strategy, validate the routing rules using the evaluation set. For example, compute pass rates across task types for different models to identify categories where a low-cost model is already sufficient, then set routing conditions accordingly. Routing rules should be reviewed periodically, because both task distributions and model capabilities change over time.
Deployment Checklist
When completing a model evaluation, verify the following items one by one:
- Business scenarios and success criteria are defined in writing.
- The evaluation set is drawn from real data and covers a range of difficulty levels.
- Sample size per task type is sufficient to support conclusions.
- Metrics across all four categories — quality, stability, efficiency, and cost — are computed.
- Human evaluation uses blind testing with acceptable inter-reviewer agreement.
- Data security and compliance requirements are confirmed.
- The evaluation process is integrated into regression testing and can be rerun regularly.
Only when the above checklist is complete can a team’s conclusions withstand scrutiny and provide a reliable basis for model selection, cost control, and risk management.
