RouteWeaver: Weaving Mode Selection and Execution into Unified LLM Routing

Xiaohan Wang, Haozhen Zhang, Qingyuan Liu, Tao Feng, Wenya Wang

Nanyang Technological University · Huazhong University of Science and Technology · University of Illinois Urbana-Champaign

Published October 19, 2026 · on the feed October 23, 2026 · ▲ 31 · arXiv 2610.19705

The abstract

LLM routing dynamically selects and coordinates heterogeneous language models across diverse tasks. However, existing approaches are largely built around a predefined execution paradigm, such as single-round, multi-round, or agentic routing, which fixes how model calls are organized and limits adaptation to different query needs. We propose RouteWeaver, a unified routing framework that integrates these routing modes within a single LLM policy, jointly learning which mode to use and how to select models within that mode. To jointly optimize mode selection and within-mode execution, we develop COMET-GRPO (COordinated Mode-Execution Training), which decouples the trajectory-level advantage into separate signals for mode selection and within-mode execution, enabling more targeted credit assignment to each decision level. We further introduce progressive exploration, which gradually shifts training from externally assigned modes to autonomous selection, so that the router first learns how to execute each mode before deciding when to use it. We evaluate RouteWeaver across mathematics, coding, knowledge, logical reasoning, and factual recall. RouteWeaver achieves an average accuracy of 61.4%, an 11.03% relative improvement over the strongest baseline, and outperforms all compared baselines in each of the five domains. Ablations show that both COMET-GRPO and progressive exploration are important for adaptive routing; without progressive exploration, the routing policy collapses entirely to single-round execution.

The Brief

2:32

A short podcast summary of the paper. Written and voiced by AI.

Transcript

RouteWeaver. Weaving Mode Selection and Execution into Unified LLM Routing. By Xiaohan Wang and four others, from Nanyang Technological University, Huazhong University of Science and Technology, and one other institution. Published on the nineteenth of October. Its code repository is worked out: about fifty source files, with a readme and a licence.

LLM routing is the practice of dynamically selecting and coordinating different language models across a range of tasks. Existing routers are mostly built around one predefined execution paradigm. It might be single-round routing, multi-round routing, or agentic routing, but whichever it is, it fixes how model calls are organised. A query that would be better served by a different arrangement does not get one, and that limits how well a router can adapt to what each query actually needs.

RouteWeaver folds these routing modes into one framework, governed by a single LLM policy. That policy learns two things together: which mode to use for a query, and how to select models once inside that mode. The choice of paradigm stops being a design decision made in advance and becomes part of what the router decides.

Learning both levels at once raises a credit assignment problem, and the authors answer it with COMET-GRPO, short for Coordinated Mode-Execution Training. It takes the advantage computed over a whole trajectory and decouples it into separate signals, one for mode selection and one for execution within the mode. Each decision level then receives credit that is more targeted to what it actually did.

The second ingredient is progressive exploration. Training begins with modes assigned externally, and gradually shifts toward the router selecting modes on its own. The order is deliberate: the router first learns how to execute each mode, and only then learns when to use it.

RouteWeaver is evaluated across mathematics, coding, knowledge, logical reasoning and factual recall. It reaches an average accuracy of sixty-one point four percent. That is a relative improvement of eleven point zero three percent over the strongest baseline, and it outperforms every compared baseline in each of the five domains. Ablations show that COMET-GRPO and progressive exploration both matter for adaptive routing. The second one matters dramatically: without progressive exploration, the routing policy collapses entirely to single-round execution.

That collapse is the clearest picture of why the curriculum exists. Left to choose from the start, the policy settles on the simplest mode and never learns the others. Teaching execution before selection is what keeps the richer modes in play long enough for the router to discover when they pay off.

The deep dive

6:45

A longer episode, written from the whole paper. Written and voiced by AI.

Transcript

RouteWeaver. Weaving Mode Selection and Execution into Unified LLM Routing. By Xiaohan Wang and four others, from Nanyang Technological University, Huazhong University of Science and Technology, and one other institution. Published on the nineteenth of October. This is the long version: the whole paper rather than the abstract.

A router sits in front of a pool of language models and decides, query by query, which of them should answer. The field has grown three distinct kinds. Single-round routers pick one model and call it once. Multi-round routers call models in sequence, each choice conditioned on what came back. Agentic routers build a small workflow, with models in roles such as planner and verifier, wired together by dependencies. Each kind adapts which models it calls. None adapts how the calls are organized. That bites, because among the paper's ten baselines, multi-round routers are strongest on math, code and knowledge, while single-round routers are strongest on logical reasoning and factual recall. No one paradigm wins everywhere.

RouteWeaver makes the paradigm itself a decision. A single router, a four-billion-parameter Qwen3 model fine-tuned in full, writes its whole process as text. It opens with a mode tag: single, multi or agentic. Then it emits calls naming a Worker and a sub-query, and in agentic mode also a role and references to earlier outputs. The environment runs each call and inserts the Worker's output as an observation, and the router ends with an answer. Single-round is exactly one call, multi-round two to four in sequence, and agentic up to eight, run in parallel layers. The pool holds six frozen Workers, which the router sees only as anonymous IDs with capability descriptions, never names or prices. Training is reinforcement learning with eight rollouts per query, rewarded for correctness and, optionally, for low Worker cost.

COMET-GRPO splits that advantage in two. Within the group of rollouts for one query, rollouts are sorted by the mode they chose. The mode advantage measures how the average reward of that mode compares with the whole group's average. The inner advantage measures how this particular rollout compares with the average of its own mode. Both are divided by the same group-wide standard deviation, so they sit on one scale. The appendix notes the useful identity: the two add up exactly to the ordinary GRPO advantage. The total signal is unchanged. What changes is where it lands. The mode advantage is applied only to the tokens of the mode tag, and the inner advantage only to everything after it: Worker choices, roles, references, sub-queries and the final answer. Each of the two losses is then averaged over its own token count, because the mode tag is a handful of tokens against far more execution tokens; averaged together, mode selection would carry little weight merely for being short. When cost is in play, a fixed weight called alpha mixes the task and efficiency versions of each advantage.

The second piece, progressive exploration, is a schedule for who chooses the mode. A router choosing from the first step could settle early on one mode and starve the others of practice. So training runs ninety steps in three phases. For the first twenty-five, every query is forced: its mode is assigned externally, spread across the batch, and the router only learns to execute it, under plain GRPO on the task reward. Between batch twenty-five and batch seventy-five, the probability of forcing a query falls linearly from one to zero, while a small penalty keeps the batch-averaged score of every mode above a floor. After that, the router chooses alone.

Across nine benchmarks in five domains, RouteWeaver averages sixty-one point four percent accuracy. The strongest baseline, the multi-round Router-R1, reaches fifty-five point three, a relative gain of eleven point zero three percent, and RouteWeaver leads in every domain. The comparison that tests the thesis most directly, though, is the ablation, because it shows what each component prevents. Swap COMET-GRPO for ordinary GRPO and accuracy falls to fifty-eight point eight, while mode usage collapses toward multi-round, which takes eighty-two percent of queries. Remove progressive exploration and accuracy falls further, to fifty-five point six, and the policy sends every query to single-round execution.

Each component, removed, lets one mode swallow the others. The full model instead spreads its queries across all three modes, and the split follows the task: ninety-nine percent of logical reasoning queries go agentic, while ninety-six percent of recall queries go single-round. On held-out benchmarks, AIME, GPQA Diamond and BBH, it averages fifty-three point seven against forty-five point four for Router-R1. On cost, an alpha of zero point one cuts Worker cost by twenty-three percent for one point of accuracy.

There is no limitations section. The conclusion names only future work, richer execution structures and tool-augmented environments, and the ethics statement adds that errors from Worker models may propagate across multiple calls. What the evidence does not show is mostly about measurement. Each evaluation question gets one system rollout, and the appendix concedes that because Workers sample, evaluation is not fully deterministic; no error bars or repeated runs are reported. Knowledge and Reason each rest on a single benchmark of one hundred and twenty questions. Cost leaves out the router's own compute and uses fixed reference prices, not what was paid. And everything is one router size against one pool of six Workers.

The idea to carry away is that how a query is answered is a routing decision too, and the same policy that picks the models can learn it, provided training keeps the two decisions apart. Split the credit, so the mode tag is judged by how its mode fared and the execution by how it fared within that mode. Delay the choice, so every mode is practised before any is preferred. Leave out either, and the router does what the ablations show: it settles on one way of working and stops looking.

Paper Quest · 7 chapters · about 41 min

Play this paper

Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.

Chapter 1 🧩 · The problem

Every router here has already made one choice for you: how its calls are arranged. That is the wall.

You run a system that sends each incoming question to one of several language models. Some questions need one quick call; others need several calls in a row, or a team of models with roles.

The road ahead

  1. 1 · The problem ~7 min Routers can choose which models answer a question, but each is stuck with one fixed way of arranging the calls.
  2. 2 · What came before ~3 min
  3. 3 · The key idea ~9 min One router policy picks the execution mode and the models within it, trained with split credit and a gradual handover of mode choice.
  4. 4 · Choose your own research ~3 min
  5. 5 · Build the method ~8 min Write every mode in one format, train first with assigned modes, then gradually let the router choose modes itself.
  6. 6 · The experiment ~6 min You’ll guess: When RouteWeaver was trained without progressive exploration, letting the router pick modes from the start, what happened to its choice of modes?
  7. 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Join free to play the whole quest ›

Free, with Google or an email address. Your stars and progress are kept.

KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.