arXiv(opens in a new tab)cs.CLAug 2026Cited by 4 papers on PaperVantage

Manuscript Offprint

arXiv:2608.25523

TOPAS: Workflow-Aware Prefix-State Scheduling for Multi-Agent LLM Serving

Hongqiu Ni, Han Tian, Chi Zhang, Guopeng Li, Haisheng Tan

Hongqiu Ni*, Han Tian*, Chi Zhang†, Guopeng Li* and Haisheng Tan*

*University of Science and Technology of China, China

†Hefei University of Technology, China

Abstract—Prefix caching introduces a fundamental tradeoff in multi-agent large language model (LLM) serving: retaining a long system-prompt key-value (KV) cache for an agent accelerates future calls, yet it reduces the GPU memory available for batching concurrent requests. In multi-stage workflows, existing schedulers tend to prioritize either immediate prefix locality or overall workflow progress. However, under a shared KV cache budget, optimizing either objective in isolation can prolong task-level job completion time (JCT) through downstream delays or frequent prefix replacement. To strike a balance, we here propose TOPAS, a Task-Oriented Prefix-Aware Scheduler that jointly decides which agent prefixes to keep in the cache and which requests to schedule for execution. TOPAS scores candidate post-decision states by trading off the expected reduction in each task's longest remaining service path against the near-term benefit of downstream prefix reuse, accounting for the costs of prefix movement and preemption. A task-level aging mechanism is also incorporated to prevent starvation. We implement TOPAS within the SGLang framework and assess its performance on three synthetic DAGs and two MetaGPT software-development workflows. Compared with the best-performing baseline for each workload and metric, TOPAS reduces the mean/p99 JCT by up to 39.8%/49.4% on the synthetic workloads, while lowering mean JCT by 9.8% on MetaGPT-SOP and mean/p99 JCT by 22.0%/26.6% on MetaGPT-TL.

I. INTRODUCTION

Multi-agent LLM applications tackle complex tasks via interdependent requests generated by role-specialized agents [20], [32]. Each request contains an agent-specific static prefix whose KV cache is reusable across requests from the same agent in different tasks. Serving systems such as SGLang maintain cached KV pairs in a radix tree, where requests sharing the same agent prefix traverse the static path and each appends its own request-specific dynamic content. Retaining this cache in GPU memory—referred to as prefix residency—eliminates redundant prefill computations, yet it contends with concurrently executing requests for the limited KV budget. Long system prompts further amplify both the reuse benefit and the residency cost. Consequently, request scheduling influences not only task progress but also the overall serving capacity of the GPU.

Mainstream inference frameworks such as SGLang focus on optimizing batching, prefix caching, and KV cache management [11], [37]. Their schedulers primarily operate at the request level, ranking ready requests using engine-local information. Although well suited for per-request execution optimization, this request-level view offers only an indirect reflection of the inter-request dependencies and program-level progress that the orchestration layer monitors.

Recent efforts aim to bridge this abstraction gap through distinct strategies. Parrot and Autellix incorporate application dataflow or program-level progress into request scheduling [13], [16], whereas KVFlow leverages workflow context for prefix-cache placement [18]. These systems primarily optimize application progress, cache availability, or resource placement, while prefix residency remains largely separate from request admission. This decoupling can leave heterogeneous prefixes co-residing in the cache—reducing the feasible concurrent batch size—or provoke repeated prefix evictions and reloads as execution shifts across agents.

An inherent conflict exists between end-to-end progress against prefix reuse. Consolidating requests from the same agent allows fewer resident prefixes to support a larger batch, yet it can stall upstream execution while downstream tasks remain pending. Conversely, prioritizing workflow progress tends to trigger frequent agent switching, sacrificing reuse and incurring significant prefix-movement overhead. Consequently, a scheduler must reconcile prefix locality with holistic progress, rather than optimizing either objective in isolation.

We therefore pose the following question: How can a serving system coordinate prefix residency and request admission throughout workflow execution to minimize task-level job completion time (JCT) under a constrained GPU-memory budget? We formalize this problem as online prefix-state scheduling. At each scheduling point, the scheduler jointly decides which agent prefixes to retain and which ready requests to admit, subject to a shared KV cache budget. This joint decision determines the current batch capacity, immediate task progress, and the set of prefixes most likely to be reused by subsequent workflow steps.

To solve this problem, we propose TOPAS, a Task-Oriented Prefix-Aware Scheduler whose key novelty lies in treating prefix residency as an explicit workflow-level scheduling decision, jointly optimized with request admission, rather than as an indirect byproduct of request ordering and cache eviction. To our knowledge, TOPAS is the first multi-agent LLM scheduler to jointly optimize prefix residency and request admission for task-level JCT under a shared KV budget. TOPAS conducts a hierarchical search to construct post-decision GPU states, each specifying a resident-prefix set and a compatible allocation of admitted requests. It selects the optimal state via a JCT-oriented utility that trades off anticipated reduction in each task's longest remaining service path and near-term prefix reuse, accounting for the costs of prefix movement and preemption. Our contributions are summarized as:

  • We formalize the online prefix-state scheduling problem, which jointly selects resident agent prefixes and admitted requests under a shared KV cache budget. Our diagnostic analysis reveals that heterogeneous prefix co-residency reduces dynamic batch capacity, while locality-first and progress-first policies fail in complementary leading to bad performance.

  • We introduce TOPAS, an online scheduler that jointly determines prefix residency and request admission via a JCT-oriented utility function. This utility balances expected reductions in tasks' longest remaining service paths and near-term prefix reuse. A task-level aging mechanism is also incorporated to prevent starvation.

  • We implement TOPAS atop SGLang and evaluate it on three synthetic DAG workloads and two MetaGPT workloads. Compared with the best-performing baseline per workload and metric, TOPAS reduces mean/p99 JCT by up to 39.8%/49.4% on the synthetic workloads; lowers mean JCT by 9.8% on MetaGPT-SOP; and achieves mean and p99 JCT reductions by 22.0% and 26.6%, respectively, on MetaGPT-TL.

References (38)