System speeds up llm agents by smarter scheduling and decoding
JS$^2$: Joint Scheduling and Speculative Decoding for Efficient Agentic LLM Inference
Artificial Intelligence
Summary
Large language models (LLMs) that act as agents perform tasks by making multiple calls to the model, often mixed with using external tools. The authors found that when many requests come in, the main slowdown is waiting in queues rather than the model’s speed itself. They created JS², a system that actively plans which tasks to work on first based on how many steps remain, and decides when to speed up model output by guessing likely next words (speculative decoding). This joint approach reduces waiting times and improves overall task completion speed without hurting peak delays or throughput.
What this means in practice
- •For ai infrastructure teams: Improve responsiveness and throughput of LLM-powered agent services by reducing inference queue delays and balancing decoding speed.
- •For cloud service operators: Optimize GPU resource utilization when hosting LLM agents with dynamic workloads and reduce overall task completion times.
Authors
Zijian Wen, Liangkun Chen, Jiamin Cao, Ennan Zhai, Songjun Huang, Xu Chen, Xiaoxi Zhang
Abstract
LLM-powered agents execute tasks through interdependent LLM calls interleaved with tool executions, making end-to-end Job Completion Time (JCT) a central serving objective. Our measurements reveal that the dominant LLM inference bottleneck shifts from decoding latency at low concurrency to queueing delay at high concurrency. Speculative Decoding (SD) accelerates decoding but may degrade performance under heavy load. Dynamic arrivals and intermittent tool executions cause batch-size fluctuations in online agent serving. Existing Adaptive Speculative Decoding (ASD) approaches rely on reactive feedback, incur overhead when speculation is disabled, and offer limited upper-layer control. Agent-level scheduling mitigates queueing delays but overlooks the load-dependent effectiveness of SD. Our key insight is that prioritizing tasks with fewer remaining LLM requests reduces queueing delays and shortens high-batch periods, creating additional SD opportunities. We present JS$^2$, a bottleneck-aware LLM serving system that jointly optimizes SD and agent-level scheduling. JS$^2$ enables externally controllable, iteration-level switching between native SD and non-SD paths using separate CUDA Graphs, minimizing disabled-SD overhead while preserving ASD compatibility. It estimates remaining steps using explicit plans, prompt-derived execution states, and hierarchical matching of historical trajectories. JS$^2$ coordinates remaining-step-aware scheduling with load-adaptive SD selection based on offline profiling and near-future load estimation. We implement JS$^2$ on vLLM and SGLang and evaluate it across three LLMs, four workloads, three workflows, two GPU platforms, and two real-world serving traces. JS$^2$ achieves up to a 2.10$\times$ speedup in average JCT over the best baselines, while maintaining comparable tail latency and throughput. Our code is available at https://github.com/Wenz0101/JS2.