arXiv:2610.19705cs.CLOct 2026

Manuscript Offprint

arXiv:2610.19705

RouteWeaver: Weaving Mode Selection and Execution into Unified LLM Routing

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

RouteWeaver

Project Website

Hugging Face

1 INTRODUCTION

The growing diversity of large language models (LLMs) has motivated LLM routing as a paradigm for leveraging complementary capabilities, where different models are selected and coordinated according to their strengths, costs, and suitability for each query (Chen et al., 2024a; Ding et al., 2024; Hu et al., 2024; Ong et al., 2025). Depending on how model calls are organized, current routing approaches generally follow three paradigms: single-round routing selects a single model for one-shot execution (Chen et al., 2024b; Feng et al., 2025b; Wang et al., 2026), multi-round routing makes successive model selections conditioned on intermediate outputs (Zhang et al., 2025; Shao et al., 2026), and agentic routing organizes multiple models into structured collaborative workflows (Yue et al., 2025; Feng et al., 2026b). Although routing decisions within each paradigm can adapt to the query, the execution paradigm itself is typically fixed in advance. As a result, the router can adapt which models to use, but not how model calls should be organized for different queries. This raises a natural question: how can we unify these routing paradigms within a single policy that jointly adapts execution mode and model selection to each query?

Unifying these routing paradigms within a single policy is non-trivial. Single-round, multi-round, and agentic routing follow different execution structures and decision processes, requiring a common formulation that accommodates all three while preserving their distinct behaviors. Beyond

∗^{*}Work done during an internship at Nanyang Technological University.

this structural challenge, two learning problems are particularly important. First, different queries may favor different execution modes, yet determining which mode is appropriate requires reasoning about the task before its execution unfolds. A unified router must therefore learn when single-round, multi-round, or agentic execution is most suitable for each query. Second, selecting an appropriate mode alone is insufficient, since each mode demands a different form of model selection and coordination. Single-round routing requires choosing an effective model directly, multi-round routing must adapt subsequent selections to intermediate outputs, and agentic routing additionally organizes models through roles and dependencies. The router must therefore learn not only which mode to use, but also how to execute effectively within the selected mode.

To address these challenges, we propose RouteWeaver, a unified routing policy that learns to select among single-round, multi-round, and agentic execution paradigms and perform model selection within the chosen paradigm. We first introduce a unified routing format that expresses all three paradigms through a common action grammar for mode selection and subsequent routing decisions. To jointly optimize these two levels of decisions, 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 targeted credit assignment to each decision level. We further introduce progressive exploration, which gradually shifts training from externally assigned modes to autonomous selection, allowing the router to first learn how to execute within each mode before deciding when to use it.

We evaluate RouteWeaver on benchmarks spanning mathematics, coding, knowledge, logical reasoning, and factual recall. RouteWeaver achieves 61.4% average accuracy, an 11.03% relative improvement over the strongest baseline, and leads all baselines across the five domains. We further study performance-cost trade-offs and generalization on held-out benchmarks (AIME, GPQA-D, and BBH). With α=0.1\alpha = 0.1, Worker inference cost decreases by 23% with only a 1.0-point accuracy drop, while RouteWeaver achieves 53.7% average accuracy on held-out benchmarks, an 18.28% relative improvement over the strongest baseline. Ablations and routing analyses further validate COMET-GRPO and progressive exploration and reveal adaptive execution choices across tasks. Our main contributions are summarized as follows:

• We formulate unified LLM routing across single-round, multi-round, and agentic execution paradigms, enabling a single policy to adapt both the execution mode and model selection to each query rather than committing to a predefined routing schema.

• We propose RouteWeaver, featuring COMET-GRPO, which decouples credit assignment for mode selection and within-mode execution, together with progressive exploration that gradually transitions the router from learning how to execute each mode to autonomously deciding when to use it for different queries.

• Extensive experiments across mathematics, coding, knowledge, logical reasoning, and factual recall demonstrate the effectiveness of unified routing over existing routers and fixed-mode strategies. Further analyses examine performance–cost trade-offs, routing behavior, and the contributions of the proposed training components.

References (35)