Inference systems · Research feature

Efficient Agentic LLM Serving over SSD-based Sparse KV Storage

A new framework reduces latency in agentic language model serving by predicting and managing key-value cache access on SSDs without additional training.

Adapted from research by Wenhao He, Ping Zhang, Xiaohe Hu and colleagues.

arXiv preprint revision · 2026-09-29 · Attribution & reuse
In this article
Editorial illustration of optical fibers.

Editor’s introduction

The study evaluates Janus, a serving framework designed for agentic large language models using sparse attention and SSD-based key-value storage. It compares performance by measuring time to first token latency across three models and three agentic interaction traces. Janus moves SSD reads away from the inference critical path by predicting KV cache demand using intermediate values generated during earlier inference steps, without requiring retraining. These predictions are used to pre-fetch data, with missed reads fetched before attention execution to maintain output accuracy. The framework also improves SSD efficiency through read coalescing and write packing, reducing fragmented access and interference. Evidence shows Janus achieves up to 3.69 times better latency performance over prior methods, with average improvements of 1.22 to 1.85 times.

Introduction

Large language models (LLMs) have advanced rapidly in reasoning, tool use, and code generation, making autonomous agents one of their most prominent applications. Unlike one-shot generation, an agentic session repeatedly inspects a repository/directory, invokes tools, incorporates their outputs, and revises the solution. Consequently, agentic sessions contain long autonomous loops and increasingly long input contexts. A recent study reports that agentic tasks consume three orders of magnitude more tokens than chatbots, with input tokens dominating the cost. How to efficiently serve these long-running, multi-round sessions has therefore become an important systems problem.

The second outstanding property is repeated interaction. Each agent round appends a new user message, tool result, or model output to a much longer session history, and then performs an append prefill over the new tokens. Recomputing the history at every round would waste substantial GPU cycles. Thus, serving systems often retain the history key-value (KV) cache and reload it when the next append prefill query arrives. Due to the limited space of GPU high-bandwidth memory (HBM), current systems commonly offload KV caches to CPU DRAM. Recent systems further extend this design into a hierarchy spanning GPU HBM, CPU DRAM, and SSDs.

First, sparse attention makes KV demand non-deterministic to the storage layer and shortens the opportunity to overlap KV loading. Specifically, since SSD bandwidth is far below HBM bandwidth, SSD-centric systems prefer initiating KV loads early and overlapping them with model computation. Dense attention makes this prefetch straightforward as all history KV caches will be consumed. In contrast, sparse attention determines the useful tokens only after its indexer processes the current query for KV selection. Waiting for the exact KV selection places SSD reads on the inference critical path. As we will show in §5, such SSD reads may occupy over 30% of the time cost of append prefill. Sparse attention therefore changes not only how many KV caches are read, but also when the serving system can know what to read.

Existing systems do not resolve this mismatch. Mainstream serving frameworks (e.g., vLLM and SGLang) load the full KV history to HBM so every token remains selectable. This approach maximizes compute–I/O overlap but causes redundant loading, wasting bandwidth and HBM capacity. Predictive approaches instead speculate which tokens will be selected and prefetch only those KV caches. Nevertheless, most such designs target the LLM autoregressive decoding phase by exploiting selection similarity between adjacent decode steps, yet our empirical study in §3 reveals agentic workloads exhibit a different bottleneck: nearly all KV reads occur during append prefill, while decode mostly reuses history tokens loaded by append prefill or accesses newly generated tokens in the current round. The few designs that cover prefill either require offline model calibration or expose only a short overlap window that is insufficient for SSD latency (detailed in §3).

The second challenge is the lack of SSD I/O optimization tailored for serving sparse attention LLMs under the agentic scenario. Specifically, we consider two types of I/O issues, which are the non-contiguous I/O and the read-write interference. For one thing, it is common knowledge that SSDs are inefficient for small random accesses, yet serving sparse attention LLMs naturally produces such unfavorable accesses in both directions. On the read path, only the sparsely selected KV will be loaded, resulting in scattered SSD reads. On the write path, LLM serving maintains newly generated KV caches in non-contiguous GPU pages due to the widely adopted paged attention technique, making offloading similarly fragmented. For another, SSDs suffer from the interference of reads and writes as they compete for device-internal resources. Such interference has a larger impact on SSD reads compared to writes, deteriorating read bandwidth by nearly 60% when concurrent SSD writes exist. Nevertheless, agentic workloads exhibit significant read amplification due to the multi-round nature, which drives read volume to be tens of times greater than write volume (detailed in §3). Thus, the read-write interference is a particularly pressing problem for agentic workloads. Unfortunately, these I/O issues are under-explored in current systems.

In this work, we present Janus 11 1 In Roman myth, Janus is usually depicted as having two faces, one looking backward to the past and the other looking forward to the future., an agentic serving framework for sparse attention LLMs under the SSD-centric KV storage paradigm. Janus addresses the uncertainty and limited overlap opportunity introduced by sparse KV selection, and the I/O issues related to SSD performance, keeping most KV loading off the critical path to make SSD-centric KV storage practical for long-running agent sessions.

KV Storage

LLM serving systems retain the KV caches of processed tokens so that subsequent requests can reuse the cached history instead of recomputing it. Because GPU HBM cannot hold the KV caches of many long-running sessions, serving systems commonly offload inactive KV caches to CPU DRAM or SSD and reload them on demand. Sparse attention LLMs additionally retain the indexer keys described above. Both indexer keys and KV caches are persistent session states. However, the loading of indexer keys is deterministic, so it can be prefetched to overlap the loading. In contrast, only the KV caches of selected history tokens are required, making it infeasible to exactly prefetch those KV caches before the indexer module finishes.

GPU-initiated SSD storage. To enhance I/O performance, it is desirable to transfer data directly between GPU HBM and NVMe SSDs, bypassing the CPU. Notably, GPU Direct Storage (GDS) enables peer-to-peer direct memory access (DMA) between HBM and SSD, thereby avoiding a staging copy through CPU DRAM. However, GDS still relies on the CPU to initiate each I/O request. In response to this, GPU-initiated SSD storage systems such as GeminiFS and Tutti expose NVMe queues to the GPU, allowing GPU kernels to submit I/O commands and observe their completion without per-request CPU intervention. The CPU remains responsible for setup and coarse-grained metadata management outside the data path.

In particular, NVMe communicates with GPU kernels through queue pairs, each pair consisting of a Submission Queue (SQ) and a Completion Queue (CQ). To issue an I/O, a GPU kernel enqueues a command in the SQ that describes the I/O request (e.g., the operation, source and destination addresses, and transfer length). The GPU then rings the SQ’s doorbell to notify the NVMe controller. The controller fetches the pending command(s), accesses the SSD, and transfers the data directly between SSD and HBM through peer-to-peer DMA. After the transfer finishes, the controller posts a completion singal to the CQ, which the GPU polls to determine when the requested I/O is done. This queue-based solution allows GPU kernels to submit asynchronous I/O requests and overlap storage access with GPU computation.

Observations and Motivation

Agentic serving differs from conventional multi-turn chat in both its input and output lengths. We first characterize this difference and then present two observations about its impact on SSD-backed sparse-attention serving, which motivate the design of Janus.

Length characteristics of agentic workloads. Conventional multi-turn conversations usually append a short user message and generate a longer model response. Agentic sessions often exhibit the opposite pattern. An appended query can contain the output of a tool, such as a PDF extractor or web searcher, or the result returned by a sub-agent. Such outputs can be much longer than a user message. Meanwhile, an agent decomposes a complex task into multiple steps, and each step often generates only a tool invocation, an intermediate decision, or a short partial result. Agentic workloads therefore commonly combine long inputs, short outputs, and many rounds.

This length asymmetry has two implications for KV storage. First, a thousand-token append query can require a large set of history KV caches during append prefill, whereas the short decode can reuse much of this set. Second, repeated agent rounds can load the history KV caches multiple times over the lifetime of a session. We next quantify these two effects.

Observation 1: Append prefill dominates KV loading. Both append prefill and decoding perform sparse KV selection and may load history KV caches, as described in §2.3. To identify the dominant phase, we record the history KV volume transferred from SSD to GPU HBM during representative agent rounds. We separately aggregate the transfers triggered by append prefill and all decode steps in the same round. Our measurement counts only actual history KV transfers and excludes KV caches already resident in GPU HBM and KV caches newly generated in the current round.

The long-input, short-output pattern explains this concentration. An append prefill computes sparse selections for many appended tokens, and their union brings a broad history working set into GPU HBM. This working set remains resident during the ensuing decode phase. Subsequent decode steps therefore tend to select KV caches already in HBM or KV caches newly generated in the current round, leaving little additional data to load from SSD.

This observation shifts the optimization target from decoding to append prefill. Most existing KV prefetchers focus on decoding and predict future selections from their similarity across adjacent decode steps, which cannot be leveraged in append prefill. There are few predictive prefetchers for append prefill, yet they still fail to provide both lossless execution and a sufficiently long SSD overlap window. InfiniGen performs model-specific offline calibration so that attention scores can be estimated for KV selection. However, it requires specific model tuning and cannot guarantee the output to be lossless. ECHO partitions prefill queries into segments, performs per-segment KV selection prediction, and overlaps the current segment’s prefetching (from CPU DRAM) with the next segment’s prediction. However, this requires the indexer computation could overlap sparse KV reads, which is infeasible for SSD storage since sparse KV reads take longer time than indexer (detailed in §5.2).

Overview

The core of the execution plane is our KV selection prediction (§4.2). When an append prefill request arrives, Janus triggers the prefetching for deterministic KV loading (e.g., indexer keys and KV caches for dense attention layers), and adopts training-free lookahead prediction to facilitate prefetching of KV caches of sparse attention. Specifically, the KV selection of a target layer is predicted a few layers ahead, guided by a model-aligned prediction distance. In addition, to reduce prediction overhead, we develop synchronization-free parallel prediction, which parallelizes prediction while removing cross-GPU synchronization. Based on the prediction results, GPUs trigger predictive reads to prefetch the sparsely selected KV caches. When execution reaches the target layer, its indexer computes the exact KV selection. Janus issues corrective reads for missing KV caches before executing sparse attention in order to preserve lossless model outputs. After append prefill, the request enters decode.

The storage plane provisions SSD I/O optimization techniques tailored for both read and write paths by taking the characteristics of sparse LLM agentic workloads into account (§4.3). For predictive and corrective reads, which involve non-contiguous GPU-SSD reads, Janus applies best-effort read packing to merge adjacent blocks whenever possible. To offload the newly generated KV caches, Janus leverages a CPU-assisted write packing approach, which allows for contiguous CPU-SSD writes without competing model execution on the GPU. Moreover, to maintain read performance for agentic workloads, Janus employs a simple-yet effective phase-aware write capping, which limits background write bandwidth when reads are in flight.

Experimental Setup

Hardware environments. We conduct experiments on one GPU server equipped with 8 H200 GPUs (each with 141 GB HBM), 1TB CPU DRAM, and 8 KIOXIA CD8P-R 7.68 TB SSDs. The GPUs are interconnected with 900 GB/s NVLink, and the other interconnects use PCIe 5.0.

Models. Three frontier open-source LLMs are used in our experiments, which are DeepSeek-V4-Flash, DeepSeek-V4-Pro, and GLM-5.2, containing 284B, 1.6T, and 753B parameters, respectively. Model parameters and KV states are stored in FP8, while indexer keys of DeepSeek-V4 are stored in FP4 following their default option.

Baselines. We mainly compare Janus against Tutti and LMCache. Tutti is an SSD-centric KV storage for LLM serving, which allows GPU to initiate SSD reads and writes without CPU intervention. LMCache is a widely used KV management framework that supports GPU-CPU-SSD hierarchy, but requires CPU to initiate each I/O request. In addition, since both Tutti and LMCache only support loading the full history KV at once, we further consider a variant of Janus, denoted as Janusbase. This variant does not adopt prediction, but trigger sparse KV reads only after the indexer finishes KV selection. All competitors use vLLM as the backend, and we restrict available CPU DRAM capacity to be 16 GB to focus our evaluation on SSD storage. Specifically, we configure LMCache to use SSDs only, as hierarchical storage has much worse performance under the DRAM strict.

Evaluation metrics. Since we focus on the efficiency of append prefill, we mainly report time to first token (TTFT) to demonstrate how Janus accelerates append prefill. We also report time per output token (TPOT) when evaluating Janus in serving to show that our work maintains decode efficiency. All experiments are averaged over five runs.

End-to-end Comparison

Append prefill efficiency. We first assess the time cost of append prefill. For each trace, we cluster append prefill requests with similar history lengths and append-to-history ratios because both dimensions affect the computation and sparse KV reads. We then compare the mean TTFT of all competitors.

As LMCache relies on CPU to initiate GPU-SSD reads and writes, it suffers from the highest TTFT in most cases due to the extra framework-side overhead. Tutti and both variants of Janus support GPU-initiated SSD I/O to eliminate the related overhead. Tutti fetches all history KV while Janusbase loads only the sparsely selected KV. Theoretically speaking, Tutti results in redundant I/O compared with Janusbase. However, we observe that Janusbase has higher TTFT in many cases. This is not surprising: Janusbase leaves all sparse KV reads on the critical path while the redundant loading of Tutti can be partially overlapped with model computation. For Janus, although corrective reads still lie on the critical path, by speculatively prefetching the sparsely selected KV, Janus successfully hides most SSD I/O with model computation, and therefore outperforms all baselines in terms of TTFT latency.

Meanwhile, the TPOT latencies of all competitors differ by approximately 3%, which is reasonable since we do not alter the decode computation. Tutti slightly increases TPOT in some cases, which is because it packs the KV pages on GPUs before offloading them to SSDs and thereby leads to SM contention. In contrast, Janus leverages CPU-assisted write packing to avoid competing SMs with model execution. In short, Janus accelerates append prefill substantially while maintaining decode efficiency.

Sparse-attention LLMs and serving. Research on sparse attention either retrofits dense models with token-, page-, or pattern-level selection, or trains sparse selection into the model itself. Related mechanisms, including IndexCache and model-native IndexShare, reuse selection results across layers. Janus does not alter these algorithms. Instead, it serves models with native sparse selection while preserving their exact outputs.

Several systems manage sparse KV placement between GPU and CPU memory without predicting future demand. Predictive systems instead speculate future KV selections to hide transfer latency. IMPRESS, InfiniGen, SparseServe, and SolidAttention derive sparse access from originally dense-attention LLMs and would change their outputs. Most predictive designs also target decode, where adjacent-step similarity enables prediction. ECHO supports prefetching for prefill of sparse attention, but it provides insufficient overlap for SSD latency, as discussed in §3. Janus provides a longer lookahead for append prefill, corrects prediction misses before attention, and co-designs fragmented SSD reads with background KV writes.

Agentic serving systems. Agentic serving systems exploit request dependencies, tool lifetimes, or session locality to schedule programs and retain reusable KV caches. Workload studies show that agents repeatedly append to long contexts while producing relatively short outputs. Orthogonal to these scheduling and placement policies, Janus optimizes the inference path of each append prefill by discovering and fetching its query-dependent sparse KV caches from SSD.