ACRouter: Adaptive Model Routing
- ACRouter is an instantiation of the Agent-as-a-Router framework that uses an iterative Context→Action→Feedback→Context loop to address sequential model routing.
- It augments static routing by integrating task-dimension performance statistics, achieving a 15.3% relative gain over heuristic methods.
- Evaluated on CodeRouterBench, ACRouter minimizes cumulative regret in both in-distribution and out-of-distribution settings, balancing cost and performance.
Searching arXiv for the specified paper and closely related routing work. ACRouter is an instantiation of the Agent-as-a-Router framework for coding-task model selection, introduced in "Agent-as-a-Router: Agentic Model Routing for Coding Tasks" (Zhou et al., 22 Jun 2026). It addresses the setting in which real-world users have access to multiple LLMs from different providers, while no single model dominates all coding domains. In that setting, routing each task to the most suitable model becomes a joint performance-and-cost problem. The framework departs from routers that treat dispatch as a static, one-off classification problem, and instead formalizes routing as an iterative Context→Action→Feedback→Context loop. Its central premise is that the main bottleneck in existing routers is an information deficit: augmenting a vanilla LLM router with performance statistics at the task-dimension level yields a 15.3% relative gain and surpasses a heuristic router built on the same dimension-level priors. ACRouter is designed to close that deficit by accumulating execution-grounded experience during deployment, and it is evaluated on CodeRouterBench, a regret-ready streaming benchmark with verified outcomes from 8 frontier LLMs (Zhou et al., 22 Jun 2026).
1. Routing problem and the notion of information deficit
The routing problem is posed over a streaming task sequence , where each task must be dispatched to one of models . In this formulation, routing is not merely a model-ranking problem over a fixed prompt representation; it is a sequential decision process in which later decisions can benefit from earlier execution outcomes.
The motivating claim is that existing routers are constrained less by classifier capacity than by missing information. The reported 15.3% relative gain from augmenting a vanilla LLM router with task-dimension-level performance statistics indicates that performance priors substantially alter routing quality, even before online adaptation is introduced (Zhou et al., 22 Jun 2026). The same result also shows that dimension-level priors alone do not exhaust the available signal, because ACRouter is then constructed to gather execution-grounded feedback during deployment and feed that back into future routing decisions.
This framing places ACRouter between two unsatisfactory extremes. At one extreme are static learners, which route from prompt-side features and precomputed priors. At the other are single-model policies such as always choosing the strongest frontier model. The reported experiments indicate that neither extreme is sufficient once multiple specialists with distinct cost–quality tradeoffs coexist.
2. C–A–F loop formalism and regret objective
ACRouter formalizes routing as a four-stage loop executed at each step :
- Context
- Action
- Feedback
- Context update
The context is defined as
where is the task prompt, 0 is optional metadata such as coding dimension, difficulty, and language, and 1 is the Memory state summarizing prior 2 pairs for 3. The selected action 4 is the index of the chosen model. Feedback is defined as
5
where 6 is the Verifier’s estimated correctness score and 7 is the monetary cost in USD computed from token usage.
The loop is explicitly cast as a contextual multi-armed bandit. The true per-task reward of choosing arm 8 on task 9 is
0
Over a stream of length 1, a policy 2 attains average reward
3
The per-task oracle, defined in hindsight by 4, achieves
5
Performance is measured by cumulative regret: 6 Equivalently, with an outcome matrix 7 whose entries are 8, the reward matrix is
9
and cumulative regret becomes
0
In the reported experiments, 1 (Zhou et al., 22 Jun 2026).
3. System instantiation: Orchestrator, Verifier, and Memory
ACRouter is composed of an Orchestrator, a Verifier, and a Memory module. The overall control flow is: retrieve similar prior cases from Memory, combine them with metadata priors, choose a model through the Orchestrator, execute the selected model, score the result with the Verifier, and write the resulting experience back to Memory.
| Module | Core function | Key specification |
|---|---|---|
| Orchestrator | Selects the model index 2 | Cost-aware Qwen3.5-0.8B fine-tuned on the probing set, ensembled with heuristic rules |
| Verifier | Produces execution-grounded feedback | Sandbox execution, AST checks, in-prompt tests, and LLM-as-Judge for proxy dimensions |
| Memory | Stores and retrieves prior experiences | Vector store keyed by task embeddings, cosine-kNN top 10 with threshold 0.5, FIFO capacity 20 000 |
The Orchestrator takes 3, a DimensionBest prior, and top-4 retrieved neighbors from Memory. Its core policy is a cost-aware Qwen3.5-0.8B LLM fine-tuned on the probing set and ensembled with simple heuristic rules, including preferring the cheaper model when estimated quality is approximately equal. Its output is the chosen model index 5.
The Verifier aggregates execution signals into a scalar score. When code is executable it runs the candidate’s code in a sandbox; it also uses AST checks, in-prompt tests, and an LLM-as-Judge for proxy dimensions. Its aggregation rule is
6
where 7 is the set of tools for dimension 8. The Verifier emits a scalar 9 and the actual cost 0.
The Memory module is a vector store keyed by task embeddings produced by voyage-code-3 or BGE-large. Retrieval is cosine-kNN with top 10 neighbors and similarity threshold 0.5. Storage is an in-place FIFO buffer with capacity 20 000 entries. Each entry logs the embedding of 1 together with 2. The stated purpose of this module is to enable the Orchestrator to condition on actual execution results, thereby closing the feedback loop (Zhou et al., 22 Jun 2026).
4. CodeRouterBench as evaluation environment
CodeRouterBench is described as the first regret-ready streaming benchmark for code routing. It contains approximately 10 111 tasks across 10 coding dimensions:
- Code Generation
- Algorithm Design
- Bug Fixing
- Code Completion
- Code Refactoring
- Data Science
- Multi-Language
- Code Understanding
- Test Generation
- Agentic Programming (out-of-distribution)
The tasks are collected from more than 15 widely used benchmarks, including HumanEval+, MBPP, BigCodeBench, SWE-Bench, LiveCodeBench, DS-1000, and CodeXGLUE. Scoring differs by dimension: 7 dimensions use execution-based pass@1 in a sandbox, while 3 dimensions use proxy metrics plus LLM-as-Judge (Zhou et al., 22 Jun 2026).
The split structure is also central to the benchmark design. The probing set contains 7 080 tasks, divided into 60% train and 10% validation, and is used to build priors and train classifiers. The in-distribution test set contains 2 919 tasks and is used for the main evaluation over 9 single-turn dimensions. The out-of-distribution test set contains 176 Agentic Programming tasks that are multi-step, multi-file, and repository-level; no router sees these at train time.
The model pool comprises 8 frontier LLMs: Claude Opus 4.6, Sonnet 4.6, GPT-5.4, Qwen3-Max, Qwen3.5-Plus, GLM-5, Kimi-K2.5, and MiniMax-M2.7. For each task–model pair, an answer is generated, passed through the Verifier harness, and recorded as 3, yielding the full outcome matrix 4. Router evaluation then simulates a fixed task order, records each chosen model, and computes cumulative regret. Two additional metrics are reported: 5 and 6.
5. Empirical performance on in-distribution and OOD workloads
On the in-distribution evaluation over 2 919 tasks, the per-task oracle attains AvgPerf% 7, CumReg 8, and Perf/\$c_i$9 $a_i \in \{1,\dots,M\}$0, which is the lowest cumulative regret among the reported non-oracle routers (<a href="/papers/2606.22902" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Zhou et al., 22 Jun 2026</a>).</p> <div class='overflow-x-auto max-w-full my-4'><table class='table border-collapse w-full' style='table-layout: fixed'><thead><tr> <th>In-distribution router</th> <th style="text-align: right">AvgPerf%</th> <th style="text-align: right">CumReg</th> </tr> </thead><tbody><tr> <td>Oracle (per-task)</td> <td style="text-align: right">57.00</td> <td style="text-align: right">0</td> </tr> <tr> <td>ACRouter</td> <td style="text-align: right">49.98</td> <td style="text-align: right">205.5</td> </tr> <tr> <td>DimensionBest</td> <td style="text-align: right">47.50</td> <td style="text-align: right">277.4</td> </tr> <tr> <td>LogReg</td> <td style="text-align: right">47.26</td> <td style="text-align: right">284.4</td> </tr> <tr> <td>RouteLLM-BERT</td> <td style="text-align: right">47.22</td> <td style="text-align: right">285.5</td> </tr> <tr> <td>LinUCB</td> <td style="text-align: right">46.84</td> <td style="text-align: right">296.9</td> </tr> <tr> <td>LinTS</td> <td style="text-align: right">46.48</td> <td style="text-align: right">307.4</td> </tr> <tr> <td>Qwen3.5-0.8B–FT</td> <td style="text-align: right">46.41</td> <td style="text-align: right">309.1</td> </tr> <tr> <td>Always-Opus 4.6</td> <td style="text-align: right">43.83</td> <td style="text-align: right">387.1</td> </tr> <tr> <td>Always-Kimi-K2.5</td> <td style="text-align: right">36.66</td> <td style="text-align: right">593.3</td> </tr> </tbody></table></div> <p>Perf/\$ values on the same in-distribution setting show a different ordering: Always-Kimi-K2.5 reports 1, Qwen3.5-0.8B–FT 2, LogReg 3, RouteLLM-BERT 4, LinTS 5, LinUCB 6, ACRouter 7, DimensionBest 8, and Always-Opus 4.6 9. This makes explicit that regret minimization, average performance, and cost efficiency are related but non-identical objectives.
On the 176 out-of-distribution Agentic Programming tasks, the oracle attains AvgPerf% 0, CumReg 1, and Perf/\$f_i$2 $f_i$3, again yielding the lowest cumulative regret among the reported non-oracle routers (<a href="/papers/2606.22902" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">Zhou et al., 22 Jun 2026</a>).</p> <div class='overflow-x-auto max-w-full my-4'><table class='table border-collapse w-full' style='table-layout: fixed'><thead><tr> <th>OOD router</th> <th style="text-align: right">AvgPerf%</th> <th style="text-align: right">CumReg</th> </tr> </thead><tbody><tr> <td>Oracle (per-task)</td> <td style="text-align: right">75.89</td> <td style="text-align: right">0</td> </tr> <tr> <td>ACRouter</td> <td style="text-align: right">62.50</td> <td style="text-align: right">17.0</td> </tr> <tr> <td>Always-Opus 4.6</td> <td style="text-align: right">57.14</td> <td style="text-align: right">26.7</td> </tr> <tr> <td>Qwen3.5-0.8B–FT</td> <td style="text-align: right">55.36</td> <td style="text-align: right">27.2</td> </tr> <tr> <td>LinUCB</td> <td style="text-align: right">49.82</td> <td style="text-align: right">31.1</td> </tr> <tr> <td>LinTS</td> <td style="text-align: right">46.43</td> <td style="text-align: right">35.9</td> </tr> <tr> <td>Random</td> <td style="text-align: right">31.25</td> <td style="text-align: right">50.4</td> </tr> <tr> <td>RouteLLM-BERT</td> <td style="text-align: right">21.43</td> <td style="text-align: right">59.4</td> </tr> <tr> <td>LogReg</td> <td style="text-align: right">19.64</td> <td style="text-align: right">61.8</td> </tr> <tr> <td><a href="https://www.emergentmind.com/topics/quantum-k-nearest-neighbour-knn" title="" rel="nofollow" data-turbo="false" class="assistant-link" x-data x-tooltip.raw="">kNN</a> Retrieval</td> <td style="text-align: right">14.29</td> <td style="text-align: right">66.7</td> </tr> </tbody></table></div> <p>The associated Perf/\$ values on OOD tasks are: kNN Retrieval 4, RouteLLM-BERT 5, ACRouter 6, LogReg 7, LinUCB 8, Random 9, LinTS 0, Qwen3.5-0.8B–FT 1, and Always-Opus 4.6 2. The principal empirical claim is therefore not that ACRouter dominates every scalar metric, but that it minimizes cumulative regret in both the in-distribution and OOD settings.
6. Interpretation, misconceptions, and scope
A recurring misconception in model routing is that the problem can be adequately solved as prompt-only classification. The ACRouter results are presented specifically against that view. The reported gain from adding task-dimension performance statistics, followed by further gains from execution-grounded feedback, supports the argument that the central bottleneck is missing information rather than only classifier choice.
A second misconception is that online adaptation alone is sufficient. Classical bandits such as LinUCB and LinTS do adapt online, but the reported interpretation is that they lack fine-grained context reasoning and therefore still lag ACRouter. Conversely, static learners and heuristic priors can match or slightly beat DimensionBest in-distribution, yet collapse under OOD shift: on the agentic tasks, RouteLLM-BERT drops to AvgPerf% 3, LogReg to 4, and kNN Retrieval to 5, whereas ACRouter remains at 6 (Zhou et al., 22 Jun 2026).
A third misconception is that always using the strongest individual model is either performance-optimal or cost-efficient. The reported results reject that simplification. Always-Opus 4.6 trails ACRouter in cumulative regret in both in-distribution and OOD settings, and it also reports lower Perf/\$ than several alternatives. The stated conclusion is that always choosing the single strongest model is neither performance- nor cost-efficient once multiple specialists exist.
Within the scope of the reported study, the broader significance of ACRouter lies in treating model routing as an iterative decision process with verified feedback rather than a one-off dispatch rule. A plausible implication is that robustness under distribution shift depends not only on prior statistics or online reward updates in isolation, but on maintaining a memory of execution-grounded experience and conditioning future choices on that memory.