From Code Generation to Task Delivery: A Practical Guide to Evaluating LLMs
As LLM evaluation shifts from measuring single-point abilities like code completion toward whether models can actually deliver complete development tasks, public leaderboard scores no longer predict real-world developer experience. This guide explains how to build a reproducible evaluation set from your own repositories, decompose a "task delivery engine" into four capability layers (semantic alignment, task planning, in-environment execution, and result delivery with self-verification), and design metrics that go beyond a single completion rate to capture root causes. It also covers task layering from L1 to L4, environment isolation and observability, common failure modes and mitigations, and how to turn evaluation results into practical R&D workflows, including verifiable task descriptions, automated verification gates, layered routing, and clear human-AI boundaries.
1. Shifting the Evaluation Frame: From Code Generation to Task Delivery
Over the past two years, model evaluation has mostly focused on single-point capabilities: the hit rate of function completion, the accuracy of single-file question answering, the correctness rate on algorithm problems. These metrics are easy to run offline in batches, but they struggle to predict how developers actually experience a model inside a real repository. The reason is straightforward—real development tasks have a completely different shape. They often span multiple files and modules, are constrained by existing code conventions, build systems, and test suites, and require that the changes themselves build, pass regression tests, and can be reviewed.
As a result, the focus of evaluation has naturally shifted: instead of only looking at “what the model wrote,” we look at whether it can “get something done.” The criterion moves from “does it look like it was generated well” to “was the task delivered”—does the code build, are all tests green, does it introduce regressions, and does it satisfy the acceptance criteria agreed upon in advance. This shift also explains why the impression of “high leaderboard score but not actually usable” appears so often: leaderboards measure peak capability, while developer experience depends on the average and the stability of capability.
2. Decomposing the “Task Delivery Engine”
To pinpoint where a model falls short on task delivery, you can break its capabilities into four layers:
- Semantic alignment: Extracting decidable acceptance criteria from vague or even contradictory requirements, and proactively flagging ambiguity rather than filling gaps with assumptions.
- Task planning: Decomposing a goal into ordered subtasks, identifying dependencies and the order of changes, and determining which files are off-limits.
- In-environment execution: Reading the repository, editing files, running commands, observing errors, and correcting based on those errors—forming a multi-round “edit–verify–fix” loop.
- Result delivery and self-verification: Producing a summary of changes, verification evidence (commands and results), remaining risks, and follow-up recommendations, so a person can review at low cost.
Only when all four layers connect do you get an end-to-end “requirement → finished product” loop. In practice, the most common failures do not occur in the generation step, but in planning omissions (forgetting to update callers and configs in sync) and missing verification (declaring completion without running tests after editing).
3. Building Your Own Test Set: Making Conclusions Reproducible
3.1 Task Sources and Selection Criteria
It is advisable to prioritize historical issues from your own repositories as the corpus, because they naturally come with “reference answers” and acceptance evidence. When selecting tasks, apply four principles:
- Automatically judgeable: Test cases exist, or acceptance conditions can be scripted (build succeeds, an API response conforms to its contract, script artifacts match).
- Real engineering complexity: Involves at least two files and includes side-effect surfaces such as configuration, dependencies, or data migration.
- No answer leakage: The prompt does not contain specific function names, line numbers, or patch fragments.
- Reproducibility: Can be stably rebuilt under fixed dependency versions, excluding network jitter and randomness.
3.2 Task Layering
| Level | Typical Form | Key Observation Points |
|---|---|---|
| L1 | Single-point bug fix, local logic completion | First-pass success rate, precision of edits |
| L2 | Cross-file feature implementation | Completeness of planning, interface consistency |
| L3 | Cross-module refactoring, dependency upgrades | Regression introduction rate, judgment of impact scope |
| L4 | Building a small runnable app from scratch | End-to-end loop, self-verification ability |
The purpose of layering is to avoid “the average score masking the weak spots”: a model that performs excellently at L1 but frequently introduces regressions at L3 poses a far higher risk when used directly for refactoring scenarios than its score suggests.
3.3 Environment Isolation and Observability
The quality of the evaluation environment itself often affects the credibility of conclusions more than the choice of model. A practical combination typically includes:
- Using a container platform to spin up a disposable environment for each task, pinning dependency versions, preloading build caches, and setting timeouts and resource quotas;
- Using object storage to archive the full logs and build artifacts of each run for later traceability;
- Using a log service to aggregate structured output, and monitoring and alerting to track day-to-day drift in task failure rates;
- Running all tasks in isolated snapshots to avoid state contamination.
In a general-purpose cloud platform environment like Baidu AI Cloud, all of these capabilities map to standard product categories (container platform, object storage, log service, monitoring and alerting), so building the evaluation pipeline does not require any private deployment.
4. Metric Design: Completion Rate Is the Result, Process Metrics Are the Cause
A single “task completion rate” cannot guide optimization. It is recommended to collect at least the following six categories of metrics:
- Strict task completion rate: Counts as complete only when build, tests, and contract validation all pass;
- First-run build rate: The proportion of tasks that build successfully on the first round of changes, reflecting one-shot correctness;
- Regression introduction rate: The proportion of newly failing test cases, measuring risk spillover;
- Average number of interaction rounds: Reflects planning quality—more rounds mean higher token and time costs;
- Manual intervention rate: The proportion of tasks that require manual correction;
- Per-task cost and wall-clock latency: Used for trade-offs between cost and experience.
The judging script can stay minimal (illustrative):
def judge(run_dir, spec) -> dict:checks = {}checks["build"] = run(spec.build_cmd, cwd=run_dir) == 0checks["tests"] = run(spec.test_cmd, cwd=run_dir) == 0checks["contract"] = check_api_contract(run_dir, spec.contract)touched = diff_files(run_dir)# Key anti-gaming check: forbid passing tests by editing themchecks["scope"] = touched <= set(spec.allowed_paths)checks["no_test_edit"] = not (touched & set(spec.test_paths))score = sum(checks.values()) / len(checks)return {"score": score, "passed": score == 1.0, "checks": checks}
The no_test_edit and scope checks may seem trivial, but they are the foundation of evaluation credibility. Without such constraints, opportunistic behaviors like “deleting assertions, skipping cases, or commenting out checks” would significantly inflate the score.
5. Common Failure Modes in Practice and Mitigation Strategies
- Lost in the middle over long context: Constraints get diluted in long sessions. Mitigation: harden hard constraints into a convention file inside the repository, so the model can re-read them each round, instead of relying on a one-time verbal instruction.
- Hallucinated APIs and parameters: Fabricating APIs that do not exist based on impression. Require the model to search for and cite real definitions before calling, and back this up with static analysis and type checking.
- Editing only tests, not implementation: Already handled in the previous section via change-scope validation; if necessary, add manual spot-checks on implementation-file diffs.
- Retrieval quality sets the ceiling: If repository indexing and symbol search cannot cover cross-language call chains, the planning layer will inevitably have omissions. The evaluation should treat “the probability of retrieving the required context” as a separate observation item.
- Large refactors without rollback: Use a separate branch or snapshot for each attempt, discarding failures to avoid polluting the main evaluation set.
- Ignoring implicit engineering conventions: Conventions such as error-handling strategy, logging standards, and directory layering need to be given explicitly in the task description.
6. From Evaluation Results to R&D Process Implementation
6.1 Writing “Verifiable Task Descriptions”
The quality of a task description is strongly correlated with delivery quality. A recommended template:
Goal: <one-sentence description of the observable outcome>Acceptance:- Build command <cmd> must return 0- All test cases matching <pattern> must pass- Files under <paths> must not be modifiedConstraints: <code style / error handling / logging conventions / compatible versions>Context: <key entry points of the relevant modules and existing implementation>Prohibited: <no new dependencies, no changes to public interface signatures ...>
6.2 Automating the Verification Loop
Set build, unit tests, static analysis, dependency and license scanning, and sensitive-information scanning as delivery gates; if any one fails, reject the change. All gate results flow into a unified log service and monitoring/alerting, so that “a drop in pass rate for a certain category of tasks” can be detected within hours rather than at a post-release retrospective.
6.3 Layered Routing and Cost Governance
Build a routing strategy based on the layered evaluation results from Part 3: route L1 tasks to a lightweight model to minimize latency and cost, and route L3/L4 tasks to a more capable flagship model with mandatory human review. The evaluation set is not just a selection tool; it should also serve as the data source for routing rules, recalibrated with each version update.
6.4 Human-AI Boundaries and Compliance
Final responsibility for architectural decisions, security boundaries, and external interface compatibility should still rest with humans. It is also recommended to keep traceable records: archive a four-part set of the original prompt, task description, change diff, and verification evidence, which both facilitates auditing and forms an incremental source of corpus for the next round of evaluation.
7. Conclusion
Public leaderboards can serve as a starting point for initial screening, but they cannot replace hands-on evaluation close to your own codebase. Reproducible evaluation sets, strict result judgment, and layered process metrics together turn “is it good to use” from a subjective impression into a measurable, comparable, and continuously improvable engineering conclusion. For a team, the real payoff is not picking the “strongest model,” but solidifying evaluation, routing, verification, and human-AI collaboration into stable processes—this is the key step from code generation toward task delivery.
