TL;DR
Researchers from AMD and NTU Singapore demonstrate that you can slash the inference costs of AI coding agents by up to 16.4% overall—and 33% on easy tasks—without losing any accuracy. By using a "timeout cascade" that attempts tasks with a small, cheap model first and only escalates to a massive model if the first attempt fails or takes too long, they nearly match the performance of complex, learned task routers with a fraction of the engineering effort.
What Problem Does This Paper Address?
AI coding agents (like Devin or OpenHands) are transformative but incredibly expensive to run. A single task might involve hundreds of model calls, long execution traces, and significant GPU time. Currently, the industry standard is to use the most powerful (and expensive) model available for every task to maximize the "resolve rate."
However, not every bug fix requires a 400B+ parameter monster. Many tasks are routine. The authors address the inefficiency of this "one-size-fits-all" approach, investigating whether smaller, "sub-40B" models have become capable enough to handle the easy stuff, and how to intelligently hand off the hard stuff to larger models without a massive engineering overhead.
Methods
The authors evaluated 36 open-weight models released between mid-2024 and early 2026. They used a standardized agent scaffold called mini-swe-agent and served models on AMD Instinct™ MI300X GPUs.
The core contribution is the evaluation of two hybrid architectures:
- Timeout-based Cascade: Every task starts on a Small Language Model (SLM). If the SLM fails (produces an invalid patch) or reaches a pre-defined timeout, the system performs a "cold restart" on a Large Language Model (LLM).
- Difficulty-aware Task Router: A hypothetical system that predicts task difficulty upfront and routes "Easy" tasks to the SLM and "Hard" tasks to the LLM.
Datasets
The study uses SWE-bench Verified, a subset of 500 real-world GitHub issues filtered for human-confirmed difficulty and correctness. The authors categorized these tasks into Easy (<15 min human resolution), Medium (15 min - 1 hr), and Hard (>1 hr) based on the dataset's metadata.
Key Insights and Ideas
- The "Credible" Small Model: Sub-40B models have evolved from near-zero performance to resolving over 60% of tasks on SWE-bench Verified. Models like
Qwen3.5-35BandGLM-4.7-Flashare now viable "first-stage" agents. - The Difficulty Gradient: The performance gap between small and large models isn't uniform. Small models are highly competitive on easy tasks but fall off a cliff on hard ones (resolving only 2% vs. the large model's 36% in some tests). This "structured gap" is exactly what makes cascading profitable.
- Time as a Proxy for Difficulty: The most surprising finding is that execution time itself is a great router. Tasks that an SLM can solve tend to be solved quickly. If an SLM is spinning its wheels, it's a strong signal that the task is too hard, making a simple stopwatch more effective than a complex machine-learning classifier.
- Model Complementarity: Interestingly, the hybrid systems sometimes outperformed the large model alone. In some cases, the large model "over-engineered" a fix that failed tests, while the smaller model provided a simpler, passing patch.
Key Results
Using a cascade of GLM-4.7-Flash (30B) and GLM-4.7 (355B):
- Cost Savings: Achieved a 16.4% reduction in total GPU-hour costs across the entire benchmark. On "Easy" tasks, the savings reached 33.5%.
- Accuracy Preservation: The cascade maintained (and slightly exceeded) the 71.2% resolve rate of the large-model-only baseline.
- Simplicity Wins: The timeout cascade achieved nearly the same cost reduction (16.4%) as an "oracle" router with perfect knowledge of task difficulty (17.9%), but without the need for training or deploying a separate classifier.
Limitations and Future Work
- Latency Tradeoff: Cascading reduces cost but increases wall-clock time for hard tasks because they are essentially run twice (once on the SLM until timeout, then on the LLM). This makes the approach best suited for asynchronous workflows (background PR reviews) rather than interactive chat.
- Cold Restarts: The current study assumes the LLM starts from scratch. Future work could explore "warm" handoffs where the LLM inherits the SLM's partial work or reasoning traces.
- Model Pairs: The simulation focused heavily on the GLM family. While the authors expect the trend to hold, different model families might exhibit different "complementarity" effects.
- Single-Run Variance: Agent evaluations are notoriously noisy. The authors acknowledge that some of the "accuracy gains" might be due to run-to-run variance and suggest multi-run validation for future studies.
Summary updated