Work

Residual-Guided Model Selection for Terminal-Based Coding Agents

Year: 2026
Type: preprint
Abstract: A terminal observation does not by itself indicate whether a command produced the outcome an agent expected. We introduce ARFA, which records expectations before command execution and uses a weighted execution residual to select the model for the next reasoning turn. We compare six routing policies for each of two model pairs on 100 InterCode NL2Bash tasks reserved for routing evaluation. Relative to always using the slow model, ARFA reduced mean wall-clock time per attempt by 21.5% with Gemma and 14.4% with Qwen, solving 37 versus 28 tasks and 42 versus 41, respectively. The Gemma configuration also solved 37 tasks versus 26 for an expectation-completeness gate. Compared with learned observation-only routing, Gemma solved more tasks but took longer, while Qwen solved one additional task at nearly the same mean time. Further model-pair experiments show that fewer slow-model calls need not reduce mean task time. In a separate development ablation with one cross-family pair, structured handoff used less time and fewer tokens than bounded visible history, with 28 versus 29 tasks solved.
Source: arXiv
Language: English
Open Access status: green
OpenAlex ID: W7242543144
Cites: 6
Cited by:
Related to: