TRANSMISSION // 2612.04727v1
Can AI Coding Agents Know When to Use a Slower Model?
Source published
ARFA records what an agent expects a terminal command to do, compares that with the result, and uses the comparison—along with other checks—to choose the next model. Tests found time savings in some settings, but trade-offs varied across model pairs.

A terminal command’s output only makes sense in context: silence may be normal, or it may violate an agent’s expectation. A preprint tests whether recording expectations before a command helps an AI coding agent choose which model should reason next.
Why compare expectations with results?
A coding agent works in a loop: it proposes a command, receives the terminal’s response, then decides what to do next. The response alone may not reveal whether things went as planned. Empty output, for instance, could be expected after a quiet check—or a surprise if the agent expected to see a list.
Chang Zhou, Zhaoling Chen and Qian Zhang introduce ARFA, a method that gives the response a reference point. Before a command runs, the model records what it expects, including whether the command should succeed and whether it should produce output. After execution, a controller compares those expectations with the observed result. ARFA selects the faster model only when the mismatch score is low and additional eligibility checks pass; otherwise, it selects the slower model. These checks include whether the expectation was sufficiently complete and whether required execution information could be parsed. The controller performs the comparison without an extra model call.
A matching result does not prove that the agent’s plan is correct. An agent can get exactly the outcome it predicted while pursuing the wrong goal. The residual measures agreement on selected signals, not overall task progress.
Testing the routing strategy
The researchers first checked whether residual scores tracked judgments about when more reasoning was needed. Three models ran 100 InterCode NL2Bash tasks, which ask agents to translate natural-language requests into shell commands. The resulting 300 trajectories included 790 commands. Human-reviewed labels assessed whether the proposed continuation remained appropriate after the agent saw the command result. The labels were produced with AI assistance; the authors call them provisional and note that separate reviewer judgments are unavailable.
They then compared six routing policies for each of two model pairs on 100 reserved tasks. The policies included always using the faster or slower model, a learned router using observations but not recorded expectations, a gate checking whether expectations were complete, and random routing. The reserved tasks were not used to fit the router or select its thresholds, though earlier standalone model runs had included those task IDs. Each task-policy condition was run once, so uncertainty estimates capture variation across tasks, not variation from repeating the same task.
What the tests found
Against always using the slower model, ARFA lowered mean wall-clock time per attempt by 21.5% for the Gemma pair and 14.4% for the Qwen pair. It solved 37 rather than 28 tasks with Gemma, and 42 rather than 41 with Qwen. The Gemma comparison also favored ARFA over the expectation-completeness gate: 37 tasks solved versus 26. With Qwen, both approaches solved 42 tasks, while the gate had lower average time and token use: 170.8 versus 176.1 seconds and 2,811 versus 3,029 tokens per attempt.
Compared with learned observation-only routing, results again differed by model pair. For Gemma, ARFA solved more tasks—37 versus 30—but took longer on average. For Qwen, it solved one additional task and took nearly the same time. These findings do not establish that one routing approach is best in general; they show different trade-offs for the tested pairs and policies.
Other experiments underline why counting calls to the slower model is not enough. In development runs with Llama and Phi pairs, ARFA reduced slow-model calls but mean task time increased. A separate handoff test found that passing structured information about the prior plan, command and expectations used less time and fewer tokens than passing bounded message history. It solved 28 tasks versus 29 with that history, while making slightly more total calls on average. The uncertainty range does not establish equivalent success.
What remains uncertain
The study is limited to InterCode NL2Bash shell-command tasks. Transfer to repository-level coding, other interfaces and longer tasks remains untested. All routing comparisons used prompts that asked models to state expectations, so the experiments do not isolate the extra cost or behavioral effect of asking for them. The work does not measure energy use, and timing results may not carry over to different hardware or serving setups.
The authors report unadjusted statistical tests across multiple comparisons. The offline reasoning-demand labels have additional limitations, including unavailable separate reviewer judgments. Online task outcomes, by contrast, use the benchmark’s evaluator. The reported uncertainty intervals reflect differences across tasks, not the variability that repeated runs might produce on the same task.
The work is an arXiv preprint; the supplied source does not establish whether it has also undergone peer review. Its results concern specific experimental setups, rather than demonstrating that expectation-based routing will improve coding agents in everyday use. Longer tasks, repeated runs and tests without expectation elicitation could help clarify when the approach is useful.
- AI coding agents
- model routing
- terminal agents
- execution feedback
- language models
- arXiv preprint
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
Trace-guided delegation for AI agents
Shared method: Both papers study runtime allocation between a faster or cheaper model and a more capable lead/slow model during agent work. ARFA uses command-outcome residuals to choose the next reasoning model; partial routing uses trace-derived subtask quality and cost guidance for delegation. The routing signals and decision granularity differ, so their results do not directly compare.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2612.04727v1 — Original paper
Excerpt reference:
static/papers/2612.04727v1.md:79-172
Basis: Paper text
Source file SHA-256:cfda6cc92dd31eb765140ae88f963cca214fad070fb5c0a8f08e89327db7a4da2611.33402v1 — Original paper
Excerpt reference:
static/papers/2611.33402v1.md:95-223
Basis: Paper text
Source file SHA-256:72c910823fd339be5f05c66cd4271208ec64540008c537442024b814a956a11c
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Can scientific software help train terminal AI agents?
Source published
Shared keywords: terminal agents
Robot-coding agents need better failure diagnosis, not just more feedback
Source published
Shared keywords: ai coding agents, execution feedback
A smaller training loop to study AI reward hacking
Source published
Shared keywords: terminal agents
When Does an AI Training Critic Help?
Source published
Shared keywords: language models
Choosing when one AI model is enough—and when to ask several
Source published
Shared keywords: model routing