TRACE-Router: A Task-Level Adaptive Online Routing Framework for Agentic AI

Existing LLM routing mechanisms are primarily designed for single-call, latency-focused decisions, making them poorly suited for agentic AI workflows that require quality assessment over extended task horizons. We introduce TRACE-Router, a framework that elevates routing decisions from individual API calls to task-level supervision units (Task-SU), aligning routing policies directly with final task outcomes. TRACE-Router employs a contextual game theory model for initial model assignment at task entry, locks the backend model for the duration of execution, and updates routing policies solely based on task-level rewards—optimizing the accuracy-latency trade-off holistically. On tau2-Bench, TRACE-Router outperforms latency-matched model interpolation baselines by 7-8 points in accuracy; on Terminal-Bench, it achieves a 7.1-point accuracy improvement over the strongest single-model baseline while reducing latency by 36%. Consistent Pareto improvements are also observed across WebArena and SWE-bench.

Background and Context

The widespread deployment of large language models (LLMs) in enterprise applications has shifted the primary engineering challenge from model capability to efficient resource allocation. As organizations integrate multiple models to balance cost and quality, routing mechanisms have become critical infrastructure. However, existing routing architectures suffer from a fundamental design flaw: they are optimized for single-call, latency-focused decisions. This approach treats each API invocation as an isolated event, ignoring the reality that agentic AI workflows operate over extended horizons where the final quality is determined by the cumulative outcome of a long sequence of steps. In these complex scenarios, intermediate outputs do not define success; only the terminal result matters. This misalignment between the routing decision unit and the actual supervision unit prevents systems from correctly attributing final feedback to specific routing choices, thereby hindering the optimization of overall workflow performance.

To address this structural gap, researchers have introduced TRACE-Router, a framework that elevates routing decisions from individual API calls to task-level supervision units (Task-SU). By aligning routing policies directly with final task outcomes, TRACE-Router ensures that the system learns to optimize for the end-to-end quality of agentic tasks rather than local, step-by-step efficiency. The framework operates on the principle that routing strategies must evolve based on global task success, not immediate response times. This shift allows the system to handle the inherent complexity of multi-step agent interactions, where the value of a specific model choice is only revealed after the entire workflow concludes. Consequently, TRACE-Router provides a new paradigm for managing LLM deployments in environments where accuracy and latency must be balanced across long-duration processes.

Deep Analysis

TRACE-Router employs a sophisticated contextual game theory mechanism to manage the initial assignment of models when a new task enters the system. Upon task entry, the framework analyzes the contextual features of the request and utilizes a contextual bandit model to make a one-time decision regarding which backend model should handle the workload. Crucially, once this assignment is made, the system locks the backend model for the entire duration of the task execution. This "admission-then-lock" strategy eliminates the overhead and state inconsistencies associated with frequently switching models during a workflow. By maintaining a consistent model context, TRACE-Router avoids the latency penalties that often arise from dynamic re-routing mid-task, ensuring that the agent operates within a stable computational environment throughout its lifecycle.

The core innovation of TRACE-Router lies in its strategy update mechanism, which relies exclusively on terminal rewards. Unlike traditional systems that may attempt to estimate task complexity or optimize based on intermediate metrics, TRACE-Router waits for the task to complete and then updates its routing policies based solely on the final outcome. This approach allows the system to learn which models perform best in specific types of long-horizon workflows without requiring explicit complexity estimation. By directly linking policy updates to task-level rewards, the framework dynamically adapts to changing workloads, automatically identifying the optimal model for different task categories. This holistic optimization of the accuracy-latency trade-off enables TRACE-Router to achieve superior performance in complex, multi-step agentic tasks where traditional single-call routers fail to capture the full picture of model utility.

Industry Impact

The introduction of TRACE-Router has significant implications for both industrial deployment and the open-source research community. For enterprises, the framework offers a method to optimize the efficiency of existing LLM deployments without the need for retraining base models. In the context of increasingly prevalent agentic applications, this capability allows companies to significantly reduce the costs associated with running complex AI workflows. By improving the accuracy-latency balance, TRACE-Router enables organizations to maintain high service quality while minimizing computational expenses. This is particularly valuable in sectors such as customer service, code generation, and data analysis, where agents must perform sustained, multi-step operations with high reliability.

For the open-source community, TRACE-Router establishes a new research direction by shifting the focus from single-call optimization to task-level global optimization. The framework encourages researchers to explore routing algorithms that leverage long-cycle feedback, moving beyond the limitations of immediate latency metrics. Furthermore, by avoiding the need for explicit task complexity estimation, TRACE-Router simplifies system design, making it easier to integrate into existing AI infrastructure. This reduction in architectural complexity lowers the barrier to entry for implementing advanced routing strategies, fostering broader adoption of intelligent model management techniques. The framework serves as a foundational tool for developing more efficient and reliable large-scale AI systems that can adapt to the evolving demands of agentic workloads.

Outlook

Empirical evaluations of TRACE-Router across three mainstream agentic benchmarks demonstrate its consistent ability to improve the trade-off between accuracy and latency, reaching non-dominated Pareto frontier points. On the tau2-Bench, TRACE-Router outperforms latency-matched model interpolation baselines by 7 to 8 percentage points in accuracy, highlighting its effectiveness in complex reasoning tasks. In the Terminal-Bench, the framework achieves a 7.1-point accuracy improvement over the strongest single-model baseline while simultaneously reducing latency by 36%. These results underscore the framework's potential to enhance task completion quality while lowering response times and computational costs. Ablation studies further confirm the importance of the delayed feedback mechanism, validating that direct policy updates based on terminal rewards are superior to explicit complexity estimation methods.

As agentic technologies continue to mature and penetrate diverse industries, the demand for adaptive routing mechanisms that can optimize entire workflows will grow. TRACE-Router positions itself as a key component in building efficient, reliable, and economical AI systems. By enabling dynamic model selection that adapts to task characteristics and optimizes global performance, the framework facilitates the transition of AI applications from merely "usable" to "efficiently usable." Future developments in this area will likely focus on expanding the contextual bandit models to handle even more complex multi-agent interactions and integrating TRACE-Router with emerging hardware accelerators to further reduce latency. The success of TRACE-Router suggests that task-level optimization will become a standard practice in the next generation of LLM infrastructure.

Sources