How to Systematically Evaluate the Real Value of LLMs in Development Work

    This article presents a repeatable framework for evaluating large language models in software development tasks. It covers defining task scenarios, building a de-identified evaluation set, measuring accuracy, stability, latency, cost, and failure rate, writing a batch evaluation script, tracking quota usage, and interpreting results to support model selection and daily usage decisions.

    1. Why Systematic Evaluation Is Necessary

    Many developers form judgments about models from scattered experiences: one code generation attempt is impressive, while another question-and-answer interaction misses the point. Such impressions are easily influenced by individual examples, are hard to reproduce, and are difficult to compare. A model’s value depends on its accuracy, stability, response speed, and calling cost for specific tasks. Only by measuring these dimensions separately can you answer the question: “Is this model suitable for my work?”

    Systematic evaluation has three goals. First, confirm whether the model can consistently complete the target task. Second, quantify input and output to determine whether the calling cost is reasonable. Third, create a repeatable basis for comparison so that decisions can be made across different models and different prompt versions.

    2. Define Task Scenarios First

    Before evaluation, define the task. Common development-related scenarios include:

    • Code generation: write a function or script based on a requirements description; the result can be verified with unit tests.
    • Code review: identify defects or security risks in code; the result needs to be compared against a known issue list.
    • Document processing: summarize API documentation or change records; the result needs to cover key information points.
    • Structured extraction: extract fields from logs or ticket text; the result can be precisely judged with rules.
    • Question answering and retrieval: answer questions based on an internal knowledge base; the result needs to cite the correct source.

    For each scenario, specify the input format, output format, and success criteria. For example, “the generated SQL can execute on the test database and return the same result set as the standard answer.” Such criteria can be judged automatically by a program and are far more reliable than “it looks acceptable.”

    3. Build an Evaluation Set

    The evaluation set is the foundation of the entire evaluation. Samples should come from real work as much as possible and be properly de-identified by removing keys, user data, and internal addresses. The number of samples does not need to be large at the beginning, but it should cover different difficulty levels.

    It is recommended to divide samples into three layers by difficulty: easy samples test basic capability, medium samples reflect the main workload of daily work, and hard samples expose boundary problems. Each layer should include normal inputs as well as inputs with non-standard formats, missing information, or ambiguity, because such cases are common in real usage.

    The evaluation set should be stored in JSON Lines format, with one sample per line, making it easy to add, remove, and version:

    1. {"id": "sql-001", "difficulty": "medium", "prompt": "Write a query that counts the number of orders for each department in the last 30 days", "pattern": "GROUP BY"}
    2. {"id": "extract-004", "difficulty": "easy", "prompt": "Extract the error code from the following log: [2026-11-20] ERR_TIMEOUT 503", "pattern": "ERR_TIMEOUT"}

    The pattern field is used for rule-based judgment. Samples that can be judged by rules should use rules first; only content that truly cannot be judged automatically should be sent to manual review.

    4. Design Evaluation Metrics

    A single accuracy rate is not enough to explain the situation. It is recommended to measure at least five dimensions:

    1. Accuracy: the proportion of samples that pass rules or tests. This is the most core metric.
    2. Stability: the proportion of consistent results when the same input is run multiple times. For tasks that need to enter automated workflows, stability is more important than occasional high-quality output.
    3. Response latency: record total elapsed time and pay attention to the median and maximum. The maximum value often determines whether users can accept the result.
    4. Calling cost: count the input and output length consumed by each sample, convert it to quota or fees, and calculate the average cost per valid result.
    5. Failure rate: the proportion of non-content errors such as timeouts, rate limiting, and queue failures. This reflects service availability and is different from model capability, so it should be counted separately.

    Among these, “cost per valid result” is more useful than “cost per call.” A cheap solution that requires repeated retries may actually cost more.

    5. Write a Batch Evaluation Script

    Manual testing one by one is slow and hard to reproduce. A script can execute the evaluation consistently. The following example only describes the process structure; the model calling part needs to be implemented according to the SDK or HTTP interface used by the team.

    1. import json
    2. import re
    3. import statistics
    4. import time
    5. def call_model(prompt: str) -> str:
    6. """Unified model call entry point; implement according to the service interface used."""
    7. raise NotImplementedError
    8. def load_cases(path: str) -> list[dict]:
    9. with open(path, encoding="utf-8") as f:
    10. return [json.loads(line) for line in f if line.strip()]
    11. def run_once(case: dict) -> dict:
    12. start = time.perf_counter()
    13. try:
    14. output = call_model(case["prompt"])
    15. ok = re.search(case["pattern"], output) is not None
    16. except Exception:
    17. output, ok = "", False
    18. latency = time.perf_counter() - start
    19. return {"id": case["id"], "ok": ok, "latency": latency, "output": output}
    20. def run_eval(cases: list[dict], repeats: int = 3) -> list[dict]:
    21. # Repeat each case to measure stability
    22. results = []
    23. for case in cases:
    24. runs = [run_once(case) for _ in range(repeats)]
    25. pass_count = sum(r["ok"] for r in runs)
    26. results.append({
    27. "id": case["id"],
    28. "pass_rate": pass_count / repeats,
    29. "latencies": [r["latency"] for r in runs],
    30. })
    31. return results
    32. def summarize(results: list[dict]) -> dict:
    33. rates = [r["pass_rate"] for r in results]
    34. latencies = [t for r in results for t in r["latencies"]]
    35. consistent = sum(1 for r in rates if r in (0.0, 1.0))
    36. return {
    37. "avg_pass_rate": statistics.mean(rates),
    38. "consistency": consistent / len(rates),
    39. "median_latency": statistics.median(latencies),
    40. "max_latency": max(latencies),
    41. }
    42. if __name__ == "__main__":
    43. cases = load_cases("eval_set.jsonl")
    44. print(summarize(run_eval(cases)))

    Several design points in the script are worth explaining. Each sample is executed repeatedly, and consistency measures whether the result is the same every time. Exceptions are caught and recorded as failures, and they are counted in accuracy, so timeouts and rate limiting will genuinely lower the result instead of being hidden. Latency retains all sample data so that percentiles can be calculated later.

    6. Plan Quota to Avoid Last-Minute Waste

    Many platforms’ calling quotas have an expiration date. When quota is about to expire, concentrated usage often leads to two problems: first, tasks are rushed to completion before the deadline, and quality is not guaranteed; second, queuing becomes severe, and quota cannot be consumed even though it has not been used up.

    A more reliable approach is to establish a usage ledger in advance, recording the task type, consumption, and result quality of each call. After accumulating several weeks of data, you can estimate the average consumption of each task type and arrange quota accordingly. An example ledger is shown below:

    Date Task type Calls Quota consumed Adopted
    11-18 Code generation 12 380 7
    11-19 Document summarization 5 150 5
    11-20 Log extraction 30 210 28

    The “Adopted” column in the ledger is critical. It directly reflects the model’s effective output on that task and is more informative than simply counting calls.

    Quota management should also follow two principles. First, prioritize quota for high-value, verifiable tasks, such as code generation with test coverage. Second, set a cap for low-priority exploratory use to avoid arbitrary calls just to “use up” the quota.

    7. Interpret Results and Make Decisions

    After obtaining evaluation data, do not look at only one number. Here are common ways to interpret results:

    • High accuracy but low consistency: the model has sufficient capability, but its output fluctuates widely. This can be improved by fixing parameters, optimizing prompt structure, and adding validation steps.
    • Medium accuracy but high consistency: the model consistently makes mistakes on a certain type of problem. This usually means the task definition or sample labeling needs adjustment, or the model’s capability is genuinely insufficient.
    • High accuracy but long latency: suitable for offline batch processing, not for interactive scenarios.
    • Low cost but high failure rate: calculate the real cost after retries before deciding whether to adopt it.

    When selecting a model, use the same evaluation set to compare different options, including APIs from different providers, locally deployed open-source models, and traditional rule-based methods. Rule-based methods are often both cheap and precise for structured extraction tasks and should not be ignored just because a model is more “intelligent.”

    8. Common Pitfalls

    First, testing only demo samples. The selected samples are usually ones the model is good at, so evaluation results will be inflated. The evaluation set should include historical records of failure cases.

    Second, ignoring prompt versions. Small changes to a prompt can significantly affect results. Every comparison should record the prompt version number to ensure the experiment is reproducible.

    Third, treating occasional success as capability. A single success does not represent stability. Repeated testing and consistency metrics can distinguish the two.

    Fourth, ignoring data security. Evaluation samples and model outputs may contain internal information. Before using external services, confirm the data processing terms and de-identify sensitive fields.

    9. Conclusion

    The core of evaluating large models is turning “it feels useful” into measurable metrics. Define task scenarios, build an evaluation set from de-identified real samples, measure five dimensions—accuracy, stability, latency, cost, and failure rate—and then use a ledger to manage quota. This creates a reusable process. It can help teams make model selection decisions and help individuals use models more deliberately, reducing quota waste and last-minute rushed usage.