AI Coding Benchmarks Explained: Long-Horizon Task Pass Rates and Cost Analysis
This article breaks down how AI coding benchmarks built around long-horizon tasks work and how to read their results. It explains four core metrics—pass rate, average completion, average duration, and cost per run—and why they do not move in the same direction, using two sets of publicly reported figures as an example. It also covers why the agent execution framework surrounding a model often decides whether a task finishes, how to break down cost into fixed, variable, and hidden components, and how to choose an approach for migration projects, budget-sensitive work, and large-scale batch conversion. A self-built evaluation checklist and guidance on running reproducible evaluations on the cloud are included.
1. Why Coding Benchmarks Need to Reflect Real Engineering
Most traditional code generation evaluations focus on single-file function completion or algorithm problems, scored through static matching or unit test pass rates. There is a clear gap between this kind of evaluation and real development work: real tasks often span multiple files, require understanding an existing project structure, involve dependencies and build configuration, and demand self-correction when something fails.
The industry has therefore been shifting toward evaluation centered on “long-horizon tasks,” abstracting scenarios such as application creation, feature development, code migration, and cross-platform conversion into task sets that can be judged automatically.
The defining characteristic of long-horizon tasks is a long chain with sparse feedback. A model may need dozens of steps before receiving a single useful signal, and any wrong edit along the way can invalidate every subsequent step. Evaluation therefore has to look at process quality, not just the final result.
2. What the Four Core Metrics Mean and How They Relate
A complete benchmark run usually produces four kinds of data. Understanding their boundaries matters more than memorizing any single number.
- Pass rate: the share of tasks in a fixed task set that are judged fully acceptable. It is the strictest metric and the closest to “ready to deliver.”
- Average completion: the mean of each task’s completion ratio, showing “how much was done correctly,” which is not the same as being usable. A project at 80% completion may still fail to run if a critical path is missing.
- Average duration: wall-clock time from task start to final judgment, which directly affects development pace and parallelism.
- Cost per run: the inference and tool-call cost of completing the full task set, and the core input for budget evaluation.
The four do not move in the same direction. Take two publicly reported sets of figures: one with a pass rate of about 24%, average completion of about 82%, average duration of about 27 hours, and cost per run of about $317; another with a pass rate of about 17%, average completion of about 71%, average duration of about 12 hours, and cost per run of about $9.9. The second has lower effectiveness metrics, but its duration is roughly half that of the first and its cost differs by two orders of magnitude. Evaluation conclusions must therefore be tied to a use case; a “ranking” detached from context has limited reference value.
3. Why the Agent Execution Framework Decides the Outcome
With model capability held equal, the agent framework wrapping the model determines whether a task can run to completion. A usable engineering agent typically has the following layers:
Task planning layer → break down goals, define acceptance criteriaContext retrieval layer → locate relevant files, dependencies, and configurationTool execution layer → read and write files, run builds and testsFeedback judgment layer → parse errors, decide whether to roll backCost control layer → cap steps, cache, trip the budget breaker
The planning layer keeps the run on track, the retrieval layer makes sure the right place is edited, the execution layer makes changes actually land, the judgment layer enables error correction, and the cost control layer prevents runaway spending. Differences in long-horizon pass rates usually come not from a single model capability but from whether these layers form a closed loop.
4. How to Break Down Cost Correctly
Treating cost per run as simply “cheaper is better” is a common mistake. A more useful breakdown:
- Fixed overhead: task set size, judgment environment setup, and image preparation;
- Variable overhead: inference calls, number of tool calls, and extra consumption from failed retries;
- Hidden overhead: the human effort taken up by manual takeover and result review.
Failed retries are often the main driver of cost amplification. An approach with a low pass rate and weak error correction may burn budget repeatedly on a few tasks, pulling the average up. In budget-sensitive scenarios, set step and cost caps first, and keep a manual takeover path available.
5. Choosing an Approach for Real Deployment Scenarios
- High-value, long-cycle migration tasks: prioritize pass rate and completion, accept higher duration and cost, but pair them with code review and regression testing.
- Budget- and response-time-sensitive scenarios: prioritize cost per task and average duration, and treat generated output as a “draft” that humans finalize.
- Large-scale batch conversion: introduce a tiered strategy, using a low-cost approach for initial screening and calling a higher-capability approach for high-risk modules.
The tiered dispatch idea can be expressed in pseudocode:
def dispatch(task):draft = cheap_agent.run(task, budget=LOW, max_steps=50)if draft.pass_rate_estimate() > THRESHOLD:return draftreturn strong_agent.run(task, budget=HIGH, max_steps=200)
6. A Checklist for Building Your Own Evaluation
To reproduce a similar evaluation internally, fix six elements: the task set and acceptance scripts, the runtime environment image, step and cost caps, the failed-retry policy, log and trajectory retention, and a definition of the metric conventions. Cross-comparison is only meaningful when the conventions match. Log and trajectory retention matter especially, since they are both the basis for retrospectives and the only evidence for judging whether a failure came from the model or the framework.
7. Building a Stable Evaluation Environment on the Cloud
The evaluation environment itself needs engineering support: a container platform to provide a reproducible sandbox, object storage to archive task trajectories and artifacts, a message queue to decouple task dispatch from result collection, and logging plus monitoring and alerting to track failure rates and cost curves. Baidu AI Cloud can serve as an infrastructure reference for these general capabilities, helping teams turn evaluation from manual number-crunching into a continuously running pipeline.
8. Conclusion
The value of a coding benchmark lies not in producing a single ranking but in offering a comparable coordinate system. Pass rate measures deliverability, completion measures process quality, and duration and cost measure engineering feasibility. Aligning the four with the weights of your own scenario, together with a closed-loop agent framework, explicit budget breakers, and complete trajectory retention, is what makes trade-offs among effectiveness, efficiency, and cost explainable and reproducible.
