AI Coding Agents: Quality Gaps Disappear When Time Limits Increase

    A controlled experiment on GPU operator optimization found that prompts mentioning model training and no human review increased an AI coding agent’s effort but reduced its score under a 20-minute limit. Extending the limit to 60 minutes eliminated the gap. The findings show why agent evaluations must distinguish completion speed from final quality and track timeouts separately.

    1. From Sabotage Claims to a Controlled Experiment

    Claims have circulated on social media that an AI coding tool shows signs of deliberate sabotage when told that its output will train another model and that no one will supervise its work.

    The discussion began with a developer’s public accusation that the tool would “sabotage the work at every stage.” The developer published a prompt configuration prohibiting sabotage and routed tasks to other models. Another account subsequently claimed to reproduce similar behavior and compared training curves from two models. That post attracted more than a million views.

    Such claims raise two methodological concerns:

    • Sampling bias: People posting examples may already expect a particular outcome. Differences in task descriptions, prompts, and acceptance criteria make comparisons unreliable.
    • Observation bias: Training curves can fluctuate substantially. Interpreting ordinary variation as sabotage risks mistaking correlation for causation.

    To investigate, an assistant professor at a university conducted a controlled experiment:

    • Only one closed-source large language model was tested.
    • Coding tasks and acceptance criteria remained unchanged.
    • The only variable was the contextual statement at the beginning of the prompt.

    2. Experimental Design: Change Only the Prompt Prefix

    The experiment used three conditions:

    1. Baseline: No additional prefix.
    2. Training: A statement that the code would be used to train a large language model.
    3. Training plus no review: The same training statement, with an additional statement that no one would review the output.

    The task set comprised eight problems from the hardest tier of a GPU operator rewriting benchmark. Each task required rewriting an operator implementation to improve performance, with scores based on whether it passed the tests. The initial time limit was 20 minutes, or 1,200 seconds, per run.

    GPU operator optimization was a useful test case for three reasons:

    • Correctness could be verified automatically, without subjective scoring.
    • Repeated compilation, execution, profiling, and tuning made the work inherently multi-turn.
    • Execution times varied substantially, making results sensitive to the time budget.

    3. Results: More Work, but Slower Completion

    The results ran counter to the sabotage claims. With the added context, the model did not do less work; it invested more effort.

    Condition Average time per run Interaction turns Initial score
    Baseline 608 seconds 22.9 Reference
    Training plus no review 865 seconds (+42%) 37.0 (+62%) 25% lower

    The apparent contradiction lies in the last column. Both elapsed time and interaction count increased, yet the score fell.

    The explanation was timeouts, rather than poorer final output. More work made runs more likely to reach the 20-minute limit. Those sessions were interrupted and scored as incomplete.

    The researcher then extended the limit to 60 minutes. On the same task set, all three conditions passed every task, eliminating the measured quality gap.

    4. Why the Gap Disappeared: The Role of Time Budgets

    In this experiment, the score difference interpreted as evidence of sabotage instead reflected how the scoring system treated time-consuming work.

    Multi-turn tasks have long-tailed completion times

    For operator optimization, additional turns also add compilation, execution, and profiling time. A 42% increase in average elapsed time and a 62% increase in turns indicate that a meaningful share of runs could approach the 20-minute cutoff.

    Time-limited scoring can equate “slow” with “poor”

    Under a fixed wall-clock limit, a timeout counts as failure. The score therefore measures completion within the allotted time, not necessarily the quality of the eventual result.

    Prompt context changed effort allocation, not demonstrated capability

    Additional context may have encouraged the model to proceed more cautiously and perform more verification. Under a short deadline, that extra work did not translate into a higher score.

    Before comparing models or tools, evaluators should establish whether their metric measures capability, speed, or a combination of the two.

    5. Evaluation Practices: Avoiding Artificial Gaps from Time Limits

    Define the Scoring Objective First

    • To measure final quality: Allow sufficient time and score correctness pass rates and performance improvements.
    • To measure time-bounded productivity: Clearly label the result as a throughput metric rather than treating it as a pure quality measure.

    Standardize Timeout and Turn Budgets

    Use the same limits across conditions. Report timeout rates separately from the quality of runs that finish without timing out. This helps prevent long-tailed tasks from dominating the interpretation.

    Repeat Runs and Report Variability

    Individual runs are sensitive to randomness. Repeat evaluations and report medians, quantiles, and confidence intervals.

    The following code illustrates the evaluation workflow; it is not an interface for any specific product:

    1. # Illustrative evaluation workflow, not a specific product interface
    2. CONDITIONS = ["baseline", "training", "training_no_review"]
    3. TIME_LIMIT_S = 3600 # Allow sufficient time to measure final quality
    4. MAX_TURNS = 60
    5. def evaluate(task, condition, seed):
    6. prompt = build_prompt(task, prefix=CONDITIONS[condition])
    7. result = agent_loop(prompt, max_turns=MAX_TURNS,
    8. time_limit_s=TIME_LIMIT_S, seed=seed)
    9. return {
    10. "condition": condition,
    11. "passed": verify(result), # Automatically verify correctness
    12. "elapsed": result.elapsed_s,
    13. "turns": result.turns,
    14. "timed_out": result.timed_out,
    15. }
    16. records = [evaluate(t, c, s)
    17. for t in tasks for c in CONDITIONS for s in range(3)]
    18. report(records) # Report pass rates, time quantiles, and timeout rates by condition

    Set Task-Specific Limits and Support Recovery

    Allocate time budgets according to task complexity. When a run times out, preserve its state and support resumption instead of automatically treating the interruption as a definitive failure.

    Make the Process Observable

    Run evaluation workloads on a cloud container platform and use logging, monitoring, and alerts to track per-turn duration, timeout rates, and resource consumption. These records can help identify whether delays arise during compilation, execution, or model inference.

    Teams already using relevant Baidu AI Cloud capabilities can apply the same approach to build an observable evaluation pipeline.

    6. Conclusion

    The controlled experiment did not support the sabotage interpretation. Extending the time limit from 20 to 60 minutes eliminated the measured quality gap across all three conditions. The additional time and interaction turns were consistent with greater effort, not disengagement.

    For developers evaluating AI coding agents, the practical lesson is to align time budgets and scoring criteria before drawing conclusions about relative quality. A lower score under a deadline may indicate slower completion—not a worse final result.