AI Coding Benchmarks: Why Long-Horizon Task Pass Rates Double

    New results from AI coding benchmarks show that several models nearly doubled their pass rates on long-horizon coding tasks while average runtime and cost per task dropped at the same time. This article breaks down why these jumps happen—and why they are often amplified by a chain effect of fewer steps and less trial-and-error rather than by raw capability gains. It explains how pass rate, completion, runtime, and cost are each defined, how to normalize comparisons using cost per successful task, and how to build a reproducible evaluation system in your own codebase with isolated sandboxes, controlled toolsets, and quantified metrics. It also covers common pitfalls and the cloud-side infrastructure needed to run large-scale, long-running evaluations.

    A fresh round of results has arrived from several AI coding benchmarks. What stands out is that a number of models improved their pass rate on “long-horizon coding tasks” markedly over the previous generation—some by nearly double—while average runtime per round and average cost dropped at the same time. At the same time, the gap between different solutions in both pass rate and cost is wide. That said, the “doubling” seen on leaderboards often comes from a chain effect: fewer steps and less trial-and-error amplify the impact on pass rate significantly. For developers and technical decision-makers, rather than fixating on a single score, it pays to understand three things: how the pass rate is defined, what drives runtime and cost, and how to build a reproducible evaluation system inside your own codebase.

    1. Long-Horizon Coding Tasks vs. Traditional Code Generation

    Most traditional code-generation benchmarks target function-level or snippet-level problems: given a function signature, a docstring, or a natural-language description, the model produces an implementation in a single shot, and unit tests decide whether it is correct. These tasks have short context and a single path, and the result of one inference largely determines success or failure.

    Long-horizon coding tasks are much closer to real development work and typically involve:

    • Repository-level context understanding: starting from an issue description, locating relevant files, call chains, and configuration in an unfamiliar or large codebase;
    • Coordinated multi-file changes: a single requirement may span the interface layer, the business layer, tests, and documentation;
    • Execution and feedback loops: running builds and tests, reading errors, diagnosing root causes, and repeatedly fixing until everything passes;
    • Long-term stability constraints: no compile errors or regressions, adherence to existing coding conventions, and completion within a limited time and budget.

    Tasks like these often require an AI coding tool to run dozens or even hundreds of steps in sequence, making a decision at each step, and any single misstep can propagate into the final outcome. So “long-horizon” does not measure how long a single model output is; it measures the system’s ability to sustain correct behavior in an open environment and to keep correcting itself based on feedback.

    2. Breaking Down the Core Metrics: Pass Rate, Completion, Runtime, and Cost

    Leaderboards usually report pass rate, average completion, average runtime, and average cost together. The four mean different things and cannot substitute for one another.

    • Task pass rate: the proportion of tasks that fully meet the acceptance criteria (usually, all hidden tests pass) after complete execution of the preset task set. It reflects end-to-end probability of success. To keep each run independent, this metric typically corresponds to a single run (pass@1); if you allow multiple attempts and take the best result, it moves closer to a pass@k measure, which is noticeably higher but also raises total cost and runtime.
    • Average completion: the weighted average of the acceptance items scored within a single task. It measures “how far the solution got” and is independent of “whether it went all the way.”
    • Average runtime: the actual elapsed time from task start to finish, including model inference, tool execution, builds and tests, plus waiting and retries. It approximates how long a user waits.
    • Average cost: the money value of the compute a single task consumes, usually dominated by token usage, and possibly including sandbox machine time.

    The following formulas help clarify how the metrics relate to one another:

    1. pass rate ≈ tasks meeting all acceptance criteria / total tasks
    2. completion ≈ Σ(single-item score × weight) / full score
    3. average runtime ≈ average steps × per-step average time (inference + tool call) + retry and wait overhead
    4. average cost ≈ input tokens × input price + output tokens × output price + sandbox machine time, etc.
    5. cost per success = average cost / pass rate

    When comparing solutions, watch these signals closely:

    • High completion but low pass rate: the task was mostly advanced, but a critical defect always remains.
    • Low runtime and low completion: the model may have judged the task “undoable” or stopped intentionally; this should not be read as higher efficiency.
    • Cost down while pass rate up: usually a sign of reduced unproductive exploration, tighter context, or better cache hits.

    3. Why Pass Rates “Double”: Chain Reliability of Long-Horizon Tasks

    A long-horizon task is essentially a chain of several key decisions in series: locating the problem, choosing a fix strategy, editing code, running verification, adjusting based on errors, and so on. The task only succeeds end-to-end if every step is reliable enough. In a simplified model, let the number of critical steps be n and the per-step correctness be p, with steps independent of one another and any single error causing the task to fail. Then the end-to-end pass rate is approximately:

    1. P(overall pass) = p^n

    Take n = 20 as an example:

    Per-step correctness p End-to-end pass rate P Relative improvement
    0.90 ~12.2% baseline
    0.93 ~23.4% ~1.9x
    0.95 ~35.8% ~2.9x
    0.975 ~60.3% ~5.0x

    (The above is an illustrative calculation under idealized assumptions, not measured data from any model.)

    As the table shows, when per-step correctness improves by only a few percentage points, and the more complex the task and the more steps involved, the end-to-end pass rate can be amplified into multiple-fold growth. Conversely, suppose solution A completes a task in an average of 20 steps while solution B takes 30 steps. At the same per-step correctness, the ratio of their end-to-end pass rates is about (0.9)^10 ≈ 0.35. In other words, with per-step correctness unchanged, raising the average step count from 20 to 30 drops the pass rate to roughly one-third of the original.

    This explains why engineering improvements—better planning, more effective error recovery, more reliable tool calling—can show up on leaderboards as “doubling”-level gains rather than linear ones.

    It is worth stressing that this model ignores correlations between steps; for example, an early error is often inherited or amplified by later steps. In a real evaluation it is better suited to understanding trends than to precisely predicting numbers. This also means that for long-horizon tasks, gains in a single capability do not necessarily translate linearly into leaderboard results, and cutting unproductive steps matters just as much.

    4. Runtime and Cost: From “Per-Task Bill” to “Cost per Success”

    4.1 Lower Average Runtime Does Not Equal Higher Efficiency

    The average runtime of a long-horizon task is made up of four parts:

    • Model inference time: the longer the task, the larger the accumulated context, and the slower each inference.
    • Tool-call time: retrieval, file reads and writes, command execution, and so on.
    • Verification time: builds, compilation, and tests often take a considerable share.
    • Wait and retry time: timeouts, rollbacks after failures, and the like.

    A sharp drop in average runtime may come from clearer model planning, more focused exploration, and fewer unproductive retries—or it may come from stopping early. So runtime must be interpreted alongside completion and pass rate.

    4.2 Cost Drops Often Come from “Doing Less Unnecessary Work”

    In conversational or AI-coding scenarios, each round resends the context accumulated so far back to the model, so historical content is repeatedly counted as input tokens. The more trial-and-error there is, the more the context bloats, and cost can grow faster than the task actually progresses. If a new version improves context management (retrieving on demand, keeping concise summaries, retaining only the necessary changes) and uses more reliable tool calling to cut down unproductive attempts, it can lower cost even as pass rate rises. Even so, per-step price, context length, and caching strategy all affect the final result, so it is not advisable to attribute the outcome to a single factor alone.

    4.3 Normalize Comparisons with “Cost per Success”

    Suppose solution A has an average cost of 100 and a pass rate of 10%, while solution B has an average cost of 50 and a pass rate of 5%:

    • For both, cost per success = 100 / 10% = 50 / 5% = 1000, so the half-cost advantage is fully offset by the halved pass rate.
    • If solution B raises its pass rate to 7.5%, cost per success drops to 50 / 7.5% ≈ 667, about one-third lower than solution A.

    The takeaway: comparing per-task cost alone easily leads to a one-sided conclusion. You should compare three metrics together—pass rate, cost per success, and tail runtime (such as P90)—and then factor in the value of the task.

    5. Building a Reproducible AI Coding Evaluation System

    To reuse leaderboard conclusions in your own projects, the evaluation process must be reproducible and attributable. A typical evaluation system has four parts—a task set, an isolated environment, an AI coding executor, and a scorer—and its core flow can be abstracted as the illustrative code below (simplified for clarity and not bound to any specific model or API):

    1. def evaluate(tasks, solver, repeats=3):
    2. """solver is the AI coding solution under test and must implement a
    3. solve(prompt, workspace) interface. repeats runs the same task multiple
    4. times to estimate stability."""
    5. results = []
    6. for task in tasks:
    7. for _ in range(repeats):
    8. with Sandbox(image=task.image, cpu=2, mem="4GiB", timeout=task.limit):
    9. # 1. Prepare a reproducible workspace: fixed version snapshot,
    10. # locked dependency and build-tool versions
    11. workspace = sandbox.prepare(task.snapshot, pinned=True)
    12. # 2. Execute: the model may only call a controlled toolset,
    13. # with no external network access
    14. trace = solver.solve(task.prompt, workspace, tools=ALLOWED_TOOLS)
    15. # 3. Score: the task passes only if all acceptance tests pass
    16. passed = all(run_test(workspace, t) for t in task.acceptance_tests)
    17. # 4. Regression check: existing tests must not be broken
    18. regression = run_suite(workspace, task.regression_suite).failed == 0
    19. results.append({
    20. "task_id": task.id,
    21. "passed": passed and regression,
    22. "completion": score_checklist(trace, task.checklist),
    23. "elapsed_s": sandbox.elapsed_seconds(),
    24. "cost": trace.input_tokens * PRICE_IN
    25. + trace.output_tokens * PRICE_OUT,
    26. "steps": len(trace.steps),
    27. "failure_stage": classify_failure(trace, passed, regression),
    28. })
    29. return summarize(results) # outputs pass rate, average completion,
    30. # runtime P50/P90, and cost per success

    There are four key design points:

    1. Task source and stratification: tasks should come from real development needs—for example, historical bug tickets, feature requests, or refactoring jobs—each with automatically executable acceptance criteria. Stratify them by change scope and estimated duration (for example, single-file, multi-file, cross-module, hour-level, day-level) so that “many simple tasks and few complex ones” does not inflate the overall pass rate.
    2. Environment isolation and resource limits: run inside a container sandbox with a fixed version snapshot, locked dependency and build-tool versions, and caps on CPU, memory, and runtime. The sandbox should block external network access by default to prevent uncontrolled external dependencies from undermining reproducibility.
    3. Controlled toolset: the AI coding executor should receive only the capabilities it needs—such as code retrieval, file reads and writes, and command execution—and the input and output of every tool call should be recorded in full. This trajectory data is the foundation for later failure attribution and cost optimization.
    4. Randomness and repeated runs: LLM sampling is stochastic, so the same task can produce different results across runs. Repeat each task at least 3 to 5 times, report both the mean and the quantiles (and a confidence interval where necessary), and fix the sampling parameters and version snapshot so that evaluations run at different times can be compared side by side.

    6. Cloud Practice: Making the Evaluation Platform Both Elastic and Controllable

    Long-horizon evaluation often means running many long-running tasks at the same time, which puts three demands on infrastructure:

    • Elastic compute: evaluation tasks cluster around release milestones and need container resources that scale on demand.
    • Reliable state storage: trajectory logs, evaluation reports, and intermediate artifacts must be retained in full.
    • Orchestration and failure recovery: after a task fails or times out, you need automatic retries and checkpoint resume.

    On Baidu AI Cloud, developers can assemble an evaluation platform from general-purpose building blocks:

    • Container service: provides the isolated sandbox runtime.
    • Object storage: persists trajectory logs and evaluation reports.
    • Message queue: decouples task distribution from execution and helps smooth out load spikes.
    • Log service and monitoring/alerting: tracks per-task runtime, token consumption, and cost, and raises alerts promptly on anomalies.

    It is also worth setting up a cost dashboard that aggregates token usage and cost per success by task and by solution, turning evaluation from a “one-off scoring run” into an engineering capability that keeps evolving.

    7. Common Pitfalls and Practical Advice

    1. Treating “pass rate doubled” as “capability doubled”: the chain effect magnifies small improvements. Looking at per-step correctness, average step count, and the distribution of failure stages is far more instructive than looking at the total score alone.
    2. Letting averages mask tail risk: averages are pulled up by the many simple tasks. Report stratified pass rates and tail runtime (P90) separately, so you do not discover after launch that a large share of complex tasks are failing.
    3. Ignoring security boundaries: AI coding tools with file read/write and command-execution abilities can inadvertently pull in unsafe dependencies or leak sensitive information. The evaluation environment should be isolated from production, execution permissions should follow the principle of least privilege, and sensitive credentials must never enter the context.
    4. Replacing internal evaluation with the leaderboard: public benchmarks differ greatly from your own workload. Evaluate continuously on your own codebase, put the evaluation set under version control, and refresh it regularly to prevent models from “overfitting” to fixed problems.
    5. Overlooking the human-in-the-loop step: adding human confirmation points for critical tasks can substantially reduce the risk of wrong changes, and their cost should also be counted in the total cost.

    Overall, progress in long-horizon coding capability is, at its core, systems engineering across planning, verification, and cost control. Behind a doubling of pass rate lie fewer unproductive steps and a more reliable feedback loop. Only by building an evaluation system composed of a stratified task set, an isolated sandbox, a controlled toolset, and quantified metrics—and by continuously iterating with the help of elastic cloud resources and observability—can benchmark scores be truly turned into gains in a team’s delivery efficiency.