[2607.00053] SWE-Router: Routing in Multi-turn Agentic Software Engineering Tasks
Abstract:Large language models (LLMs) embedded in multi-turn agentic harnesses are reshaping software engineering (SWE), but routing every task to a frontier model is wasteful when many issues admit cheap fixes. Existing LLM routers operate on the task description alone, which inherits an information-theoretic Bayes-error floor in agentic settings: a similar issue can hide either a localized typo or a multi-module refactor, and the prompt does not separate the two. We introduce SWE-Router, a value-based temporal approach that lets a cheap model run for a few exploratory turns and reads the resulting partial trajectory before deciding whether to continue cheaply or to escalate to an expensive model. We provide a Bayes-optimality theorem showing that conditioning on the partial trajectory never harms routing and is strictly better whenever exploration is informative. Across the LLM pairs of weak and strong models spanning the contemporary cost--capability frontier, we show that SWE-Router greatly improves the cost efficiency of SWE tasks, while maintaining the majority of the performances of the stronger model. We additionally release a multi-LLM trajectory dataset which allows reproduction of our trajectory-level routing.
SWE-Router: Routing in Multi-turn Agentic Software Engineering Tasks Seongho Son 1 Sangwoong Yoon 2 Jiahua Tang 3 Shuhan Wang 1 Lorenz Wolf 1 Ilija Bogunovic 1 4 Abstract the existing tasks truly require frontier capability. Routing every instance to a frontier model is therefore wasteful…
saved by
related reading
- Training an Agentic Router for Optimal Cost-Performance on SWE Tasks | Applied Computeappliedcompute.com
- 2502.18449arxiv.org
- Composer2.pdfcursor.com
- SWE-1.7: Frontier Intelligence at a Fraction of the Costcognition.com
- Building Effective AI Agents \ Anthropicanthropic.com
- Building Effective AI Agents \ Anthropicanthropic.com
- LLM Powered Autonomous Agents | Lil'Loglilianweng.github.io
- Harness Engineering for Self-Improvement | Lil'Loglilianweng.github.io
- Introducing SWE-grep and SWE-grep-mini: RL for Multi-Turn, Fast Context Retrieval | Cognitioncognition.ai
- Scaling Agentic RL: 365,000+ Environments for SWE, Terminal, and Searchprimeintellect.ai
- Introducing SWE-2: Pushing the Pareto Frontiercognition.com
- RouteLLM: An Open-Source Framework for Cost-Effective LLM Routing - LMSYS Orglmsys.org