A small-first coding cascade cut compute while keeping task success
Reducing Inference Cost of Coding Agents with Timeout Cascades · arXiv:2611.24324
In plain words
The paper studies whether coding agents can save computing effort by trying a smaller model before a larger one. It tests code changes on SWE-bench Verified, where a task is solved only if the final patch passes that task’s specified tests.
The proposed cascade gives GLM-4.7-Flash a time limit, then starts GLM-4.7 from the original task if the first attempt fails or runs out of time.
In simulations using recorded attempts for 466 tasks, the cascade lowered summed GPU-hour cost while keeping the task resolution rate at least as high as using GLM-4.7 alone.
The research
Using a large coding model for every issue can spend compute on tasks a smaller model might solve. This study tests whether letting the smaller model try first can reduce that cost without lowering the share of tasks solved, while showing the tradeoff in longer task runtimes.
A timeout cascade gives a smaller coding model the first attempt, then restarts failed tasks on a larger model to reduce measured compute cost.
The study compares the cascade with using GLM-4.7 alone by simulating both from recorded attempts on 466 SWE-bench Verified tasks with complete traces. A task counts as resolved only when its final patch passes all specified tests.
At a 120-minute first-stage limit, the cascade lowered summed GPU-hour cost while its resolution rate was slightly higher than the large-model-only baseline.
The result supports the approach on this simulated task set, though it does not establish that the small model’s apparent complementary successes are repeatable.
Each model–task pair was run once, and the hybrid comparison used one model pair on one benchmark. The cascade also took longer per task than using GLM-4.7 alone.
What the evidence shows
- A small first attempt
The timeout cascade is a method that starts coding tasks with GLM-4.7-Flash and turns to GLM-4.7 after failure or timeout. Its premise is that a smaller model may handle routine tasks while the larger one remains available for harder work.
The study evaluates this on SWE-bench Verified, a set of repository coding tasks scored by whether each final patch passes all specified tests.
- A narrower gap on easy tasks
The smaller model still trails on easy tasks, but the gap is narrower there than on hard tasks. This pattern suggests a first attempt can be more useful on easier work, while harder tasks more often need the larger model.
- Hard tasks widen the gap
On hard tasks, GLM-4.7-Flash resolved 2%, compared with 36% for GLM-4.7, using the same patch-passing criterion. The small model’s weakness is therefore concentrated more heavily in the hard group.
That contrast supports escalation after a small-model attempt rather than replacing the larger model across all tasks.
- Lower cost in simulation
In a simulation replaying recorded attempts, the 120-minute cascade lowered summed GPU-hour cost without reducing the share of tasks whose patches passed the specified tests.
This supports the cost-saving idea on the 466 tasks with complete traces, under the assumption that fallback restarts from the original task state.
- Savings come with extra time
The timeout rule came close to an idealized router that used the benchmark’s difficulty labels to choose a model. This suggests elapsed time captured much of the useful routing signal in this simulation, though the comparison relies on labels that a real router would need to predict.
Deep
- Original paper authors
- Boxi Zhou, German Sviridov, Dmitrii Ustiugov, Haris Javaid
- Submitted to arXiv
- License
- CC BY 4.0