Residual-Guided Model Selection for Terminal-Based Coding Agents
Abstract
A terminal observation does not by itself indicate whether a command produced the outcome an agent expected. We in- troduce 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 rout- ing policies for each of two model pairs on 100 InterCode NL2Bash tasks reserved for routing evaluation. Relative to al- ways 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, respec- tively. The Gemma configuration also solved 37 tasks ver- sus 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.
Create a lesson
Metadata
- Categories
- cs.SE, cs.AI
- Comments
- Accepted to the Workshop on Agentic Software Engineering (AgenticSE) at AAAI 2027
Related papers
SheetCraft: Fine-Tuning Code Agents for Execution-Guided Spreadsheet Reasoning and Construction
Shared title terminologycs.SEZuowei Zhang, Xiaotian Li, Siyuan Li et al.
VeilPRBench: Can Code Review Agents Catch Vulnerabilities in Pull Requests That Resolve Real Issues?
Shared title terminologycs.SEXinhao Song, Xiaofei Yin, Yuxuan Xiao et al.
Don't Over-Engineer It: AI Coding Agents Write Too Much Code, and a Short Prompt Reduces It
Shared title terminologycs.SEJay Desai, Fanyou Wu, Srinivasan H. Sengamedu
ProgramGen: Scalable Environment Construction for Long-Horizon Coding Agents
Shared title terminologycs.SEConghao Xiong, Chaofan Tao, Jierun Chen et al.
Evaluating Code Slop in Long-Horizon Coding Agents
Shared title terminologycs.SEShubham Gandhi, Shyam Agarwal, Nachiket Kotalwar et al.
ReleaseSynth: Scaling Data from Software Evolution for Long-Horizon Coding Agents
Shared title terminologycs.SEMan Ho Lam, Chaozheng Wang, Zongjie Li et al.