MARS: Efficient, Adaptive Co-Scheduling for Heterogeneous Agentic Systems

Yifei Wang, Hancheng Ye, Yechen Xu, Cong Guo, Chiyue Wei, Qinsi Wang, Dongting Li, Tingjun Chen, Hai "Helen" Li, Danyang Zhuo, Yiran ChenarXiv 2026

TL;DR

Traditional LLM serving engines are optimized for short, independent text generation tasks, making them highly inefficient for long-lived AI agents that alternate between generating text and running code or tools. MARS is a novel co-scheduling system that treats GPU inference and CPU tool execution as a unified pipeline, dynamically managing memory and scheduling to slash agent latency by up to 5.94×.

What Problem Does This Paper Address?

When you interact with an AI agent (like a coding assistant), the workflow isn't a simple one-shot question and answer. Instead, the agent enters a multi-turn loop: it plans a step, invokes a tool (like a Python sandbox or a file editor), inspects the output, and repeats.

As shown in Figure 1, this introduces two major shifts that break standard LLM serving engines like vLLM or TGI:

  1. Temporal Shift: Sessions don't end after one generation. They pause during tool execution and resume later. The engine faces a dilemma: keep the Key-Value (KV) cache in memory for a fast resume (which wastes space while the tool runs) or evict it (which forces an expensive recomputation of the prompt history later).
  2. Spatial Shift: Agents handle massive contexts (entire code repositories, long execution logs) and rely heavily on host CPUs to run tools.

Naively batching these requests causes long prompt processing ("prefills") to block short, interactive responses (Head-of-Line blocking). Furthermore, congestion on the CPU side can leave the expensive GPU sitting idle, waiting for tool outputs.

Figure 1. Agentic workloads induce both temporal and spa- tial shifts. Together, these shifts create dynamically mis- aligned GPU and CPU demand across concurrent requests.

Methods

MARS abandons the traditional request-oblivious paradigm in favor of a globally orchestrated, resource-aware architecture. It consists of three core pillars:

  • Unified Information Stream: A low-overhead telemetry path that bridges the gap between the GPU and CPU. It tracks execution boundaries (e.g., when a tool starts or ends) and monitors hardware pressure (like available KV cache blocks and CPU tool backlogs) in real time.
  • External Control Plane: This module features a Global Load Balancer that dynamically reorders incoming requests based on resource pressure (e.g., prioritizing smaller requests normally, but favoring GPU-heavy ones during CPU spikes to let the host catch up). An External Admission Controller uses an Additive Increase Multiplicative Decrease (AIMD) control loop to throttle request admission before the system thrashes.
  • Internal Agent-Centric Scheduler: Operating inside the data plane, a Priority-Aware Coordinator uses a Multi-Level Feedback Queue to prioritize short, interactive continuations over massive, compute-heavy prefills. Crucially, it aligns KV cache eviction policies with these priorities. Meanwhile, an Opportunistic Co-Scheduler avoids binary "admit-or-evict" choices by dynamically shrinking prefill token chunks to fit whatever memory is currently free.
Figure 4. MARS architecture overview.

Datasets

The authors evaluated MARS using a hybrid workload pool sampled from five diverse, established agent and long-context benchmarks:

  • SWE-bench (software engineering tasks)
  • GitTaskBench (repository-level git tasks)
  • Terminal-Bench (command-line interface interactions)
  • RepoBench (code auto-completion)
  • $\infty$Bench (extreme long-context tasks)

These were categorized into four distinct Input Length Regimes (ILR-1 to ILR-4), with mean prompt sizes scaling from 125K to 263K tokens to test the system under intense context pressure.

Key Insights and Ideas

  • Throughput is a Lie for Agents: Traditional systems boast high token throughput while delivering terrible agent performance. If an engine constantly evicts and rebuilds KV caches, it wastes GPU cycles on recomputation. MARS introduces Dynamic SLO-Aware Goodput—the rate of requests completed within a latency budget normalized by task difficulty—as a truer metric for agent usability.
  • Strategic Memory Reclamation: Instead of continuous, indiscriminate cache churning, MARS applies a deliberate actuation strategy. It aggressively reclaims memory during initial arrival spikes to absorb load, but strictly suppresses evictions once contention eases to protect active workflows.
Figure 3. KV cache eviction dynamics and multi-turn responsiveness. (A) The rate of KV block removals over the normalized execution progress of the workload. (B) The average Time to First Token (TTFT) per round across differ- ent latency percentiles.

Key Results

  • Massive Latency Reductions: Tested on NVIDIA H100 and H200 GPUs with models like Qwen3-Coder-30B and GPT-OSS-120B, MARS reduced mean end-to-end latency by 1.44× to 5.94× compared to baselines like vLLM and Continuum.
  • Goodput Preservation: Under heavy workloads where baseline systems collapsed to near-zero goodput, MARS maintained stable, high completion rates.
  • Real-World Speedups: Integrated as the backend for the OpenHands open-source coding agent framework, MARS accelerated end-to-end task completion times by up to 1.87× in a realistic, sandboxed deployment environment.
Figure 2. Token throughput vs. Dynamic SLO-Aware Good- put. While baselines sustain high token throughput, they experience complete collapse as load increases while MARS successfully maintains high request completion rates.

Limitations and Future Work

While highly effective, MARS currently operates as a node-local orchestration plane. Scaling its dual-pressure telemetry and KV cache management to distributed, multi-GPU clusters remains an open challenge due to the network overhead of migrating KV caches. Additionally, MARS assumes sequential agent loops (like the ReAct framework) and does not yet natively optimize complex, non-linear execution graphs like Directed Acyclic Graphs (DAGs) seen in multi-agent collaborations or Tree-of-Thoughts prompting.

Summary updated

BibTeX
@misc{wang2026mars,
  author = {Yifei Wang and Hancheng Ye and Yechen Xu and Cong Guo and Chiyue Wei and Qinsi Wang and Dongting Li and Tingjun Chen and Hai "Helen" Li and Danyang Zhuo and Yiran Chen},
  title = {{MARS: Efficient, Adaptive Co-Scheduling for Heterogeneous Agentic Systems}},
  year = {2026},
  eprint = {2604.26963},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.26963},
}
Figure