- What is KV cache?
- Shrink It. Move It. Reuse It. Three Drivers for improving LLM inference performance
- KV cache is becoming an infrastructure problem
- 1. Shrink it: Reduce the KV cache memory footprint
- 2. Move it: Transfer the KV cache efficiently between prefill and decode nodes
- 3. Reuse it: Avoid unnecessary prefill recomputation
- Three drivers, three different bottlenecks
- Frequently Asked Questions
What is KV cache?
A KV cache stores information a large language model (LLM) has already worked out from earlier text, so it can reuse that work when generating a reply. “KV” refers to the keys and values the model calculates for each token. Without a cache, the model would need to process the whole conversation again before responding. With one, it can reuse the stored information and process only the new text.Key takeaways
- Shrink it: A smaller KV cache leaves GPU memory free for more concurrent requests and longer contexts. DriveNets DoseRank, which converts GQA models to MLA without retraining, reduced KV cache size by up to 62.5% in DriveNets testing.
- Move it: In disaggregated inference, the KV cache must travel from the prefill node to the decode node before the first token is generated. DriveNets KVeXpress cut time to first token by an average of 13.4% and raised throughput by 8% compared with Mooncake.
- Reuse it: Reusing a stored KV cache avoids repeating prefill for content the model has already processed. A shared KV cache tier built by DriveNets, AMD and VAST Data delivered about 5× higher throughput and 12.6× lower time to first token than a local-only cache at high concurrency.
Shrink It. Move It. Reuse It. Three Drivers for improving LLM inference performance
Large language model inference is increasingly becoming a systems problem. As models grow, context windows expand, and inference architectures become more distributed, delivering better performance is no longer simply a matter of deploying faster GPUs. The infrastructure surrounding those GPUs increasingly determines how efficiently they can serve tokens.
One of the most important parts of that infrastructure optimization is Key-Value (KV) cache management. Examine how KV cache size, movement, and reuse affect inference performance.
During inference, the KV cache stores the attention state associated with previously processed tokens. This allows the model to continue generating tokens without recomputing the entire preceding context for every new token.
But KV cache is not unlimited. Longer contexts and more concurrent requests increase KV cache memory requirements. When available memory becomes insufficient, the serving system may need to move or discard cached state, recompute it later, or limit the number of simultaneous requests. These trade-offs can increase latency and reduce throughput.
KV cache behavior therefore directly influences three of the most important measures of inference performance:
Time to First Token (TTFT): how long the user waits before generation begins.
Time per Output Token (TPOT): how quickly subsequent tokens are generated.
Throughput: how many tokens or requests the infrastructure can process over time.
Every cluster builder therefore needs to optimize the KV cache. Many techniques exist, but three performance drivers matter most.
Shrink it. Move it. Reuse it.
These are not the only KV cache optimizations available. They are three critical drivers that can materially influence inference performance depending on the workload, model architecture, context length, concurrency level, and serving architecture.
KV cache is becoming an infrastructure problem
KV cache starts in GPU memory. It does not stay there.
Several trends push it out. When context windows grow, a single request holds more state. When concurrency grows, the aggregate working set outgrows what the GPU can hold. When inference is disaggregated, prefill and decode run on separate nodes and the cache has to travel between them no matter how large it is.
The result is a memory hierarchy for KV cache, GPU HBM at the top, host memory below it, shared cache tiers below that and a network connecting all of them.
Managing this distributed hierarchy effectively dictates your system’s performance. Ultimately, solving the KV cache problem requires answering three critical infrastructure questions: how much data you are creating, how fast you can transfer it, and how effectively you can leverage what you already have.
How do KV cache size, movement, and reuse affect inference performance?
Download: The KV Cache Playbook1. Shrink it: Reduce the KV cache memory footprint
Let’s start with the first performance driver, KV cache size.
A larger KV footprint consumes more GPU memory per active sequence, which limits how many requests a GPU can serve at once. Shrinking that footprint from its core can free up room for more concurrency, longer contexts and better use of costly VRAM.
Several techniques can reduce the KV cache footprint, including different attention architectures, quantization, compression and lower-precision representations. Each comes with a downside, most often some impact on accuracy. This article focuses on the attention architectures that compress KV cache while keeping that accuracy impact to a minimum.
One important architectural development is Multi-head Latent Attention (MLA). Most well-known open models today, including LLaMA, Mistral, Qwen, Gemma and GPT-oss, run on Grouped Query Attention (GQA), which already reduces KV cache requirements compared with traditional Multi-Head Attention (MHA) by letting multiple query heads share key and value heads.
MLA takes this further. It compresses the KV cache using low-rank matrices, shrinking its KV cache footprint by approximately 72% compared with GQA in LLaMA-3-8B, as demonstrated in public research.
The potential infrastructure effect is straightforward:
Smaller KV cache > lower memory pressure > greater concurrency and longer contexts > better infrastructure efficiency
So why isn’t everyone shifting to MLA? The issue is adoption. Because a model’s attention mechanism is fixed at training time, moving from GQA to MLA has required retraining from scratch, an investment few teams want to make on models already in production. But there is a solution.
1.1. DriveNets example: DoseRank converts GQA models to MLA without retraining
DriveNets built DoseRank based on proprietary research showing that GQA models can be converted to MLA without retraining. DriveNets turned that foundation into an automated, enterprise-ready pipeline with improved performance, so it can modernize existing GQA-based models and reduce their KV cache footprint without retraining the model or sacrificing accuracy.
In DriveNets testing, this approach can reduce KV cache size by up to 62.5%, depending on the model and configuration.
DoseRank is one option among several for shrinking KV cache. Don’t treat KV cache size as fixed. The model architecture itself can become a place to optimize your infrastructure.
Performance impact: Shrinking the KV cache can reduce HBM pressure and improve the ability to support higher concurrency or longer context windows, which can positively affect throughput and overall serving efficiency.
2. Move it: Transfer the KV cache efficiently between prefill and decode nodes
The second performance driver is how efficiently the KV cache moves between GPUs and nodes.
In many modern inference architectures, the KV cache cannot stay where it was created. Disaggregated inference is the best example. Prefill and decode run on separate compute resources so each task gets the compute it needs. The model builds the KV cache during prefill, and that cache then has to move to the decode node before it can generate the first token.
Conceptually: Prefill GPU >> KV cache transfer >> Decode GPU
For short contexts, this transfer barely impacts total latency. But the KV cache grows with the context. A 100K-token or 1M-token context can produce gigabytes of KV cache that must cross the network before any token reply is generated. At that scale, transfer performance can directly affect response latency and user experience.
For cluster builders, the question is how quickly KV state can move from where it is created to where it is needed. The answer affects TTFT and overall inference throughput.
2.1. The cost of reserving decode memory too early
The KV cache transfer method can impact GPU idle time. Part of the reason is how the cache is stored. Serving engines like vLLM, SGLang and TensorRT-LLM do not keep a request’s KV cache in one place. They split it into small fixed-size pages spread across the decode GPUs, so a single 32K-token request on a 671B model can scatter roughly 50GB of KV cache across the node in many separate pieces.
Moving that fragmented data takes coordination. Mooncake, a widely adopted KV-transfer framework, uses a push-based design. The prefill node writes the KV cache directly into the decode node’s memory using one-sided RDMA. That write needs a destination that is already reserved, so the decode node must set aside its VRAM in advance and hold it idle until prefill finishes and the data arrives. That idle window lowers concurrency and raises Time to First Token, especially in prefill-heavy setups. It is a good example of the kind of KV cache inefficiency operators should watch for when choosing a transfer framework.
2.2. DriveNets use case: KVeXpress vs. Mooncake for KV cache transfer
DriveNets AI Labs developed KVeXpress, an alternative to Mooncake, to make this node handoff more efficient for prefill-heavy inference workloads. It combines three changes to memory allocation and data movement:
- Allocate decode memory when it is needed (Just-in-time decode allocation): delays reserving decode GPU memory until prefill has finished, leaving that memory available to other requests during prefill.
KVeXpress – JIT Decode Allocation - Transfer fewer, larger blocks (Vectorized KV transfer): groups pages that sit next to each other in memory into larger blocks before sending, so the network card moves fewer, bigger transfers instead of many tiny ones.
- Move data on demand (Decode-driven movement): switches the transfer from push to pull, so the decode node pulls the KV cache when it is ready and the prefill node moves straight on to the next prompt.
DriveNets tested KVeXpress on a three-node AMD MI355X cluster with two prefill nodes and one decode node (2P1D). The workload used 64K input tokens and 1K output tokens. The baseline was the best-performing Mooncake configuration measured on the same cluster.
Across the sweep, KVeXpress cut TTFT by an average of 13.4% and end-to-end latency by 5.6% while raising overall cluster throughput by 8%. Individual tokens arrive a little slower (TPOT and inter-token latency rise about 8.5%) because the freed decode VRAM lets the cluster serve more requests at once. But over a full 1K-token response, the faster start more than makes up for it.
| Concurrency | TTFT (ms) ↓ | Inter-Token Latency (ms) ↓ | TPOT (ms) ↓ | E2E Latency (ms) ↓ | Output Throughput (tok/s) ↑ | Total Throughput (tok/s) ↑ | Actual mean concurrency |
|---|---|---|---|---|---|---|---|
| Conc.8 | -15.0% | +1.3% | +1.2% | -4.1% | +5.0% | +5.0% | +0.7% |
| Conc.16 | -24.9% | +5.6% | +5.6% | -12.6% | +15.6% | +15.6% | +1.0% |
| Conc.32 | -5.6% | +11.1% | +11.1% | -1.4% | +5.2% | +5.2% | +3.7% |
| Conc.48 | -8.0% | +16.4% | +16.3% | -4.2% | +6.3% | +6.3% | +1.9% |
| Average | -13.4% | +8.6% | +8.5% | -5.6% | +8.0% | +8.0% | +1.8% |
↓ lower is better ↑ higher is better
The key takeaway is that as context windows grow, KV cache movement becomes part of the inference performance equation.
The KVeXpress results illustrate the value of matching the transfer approach to the workload. Other workloads may benefit from different transfer methods or a different balance of prefill and decode capacity. Cluster builders should evaluate these choices rather than assume the default configuration delivers the best performance.
Performance impact: Faster KV cache movement can reduce transfer-related latency during disaggregated inference and improve TTFT and throughput.
3. Reuse it: Avoid unnecessary prefill recomputation
The third performance driver is KV cache reuse: keeping the KV state the GPU has already computed and using it again instead of recomputing it.
Most inference workloads see the same content over and over. A long system prompt is sent with every request. A RAG service re-reads the same documents. A multi-turn chat or an agentic workflow replays the whole conversation so far on every step. In each case the model has already processed those tokens once.
Without reuse, the GPU repeatedly executes prefill over the same tokens. Building that state is the expensive part of a request. For a 60K-token prompt it can take tens of seconds of pure prefill before the model emits a single word, and the instant the request finishes most systems throw the state away. The next request that shares the same prompt, whether the same system prompt, the same document or the same conversation so far, rebuilds it from scratch.
In DriveNets testing, we have watched an eight-GPU node burn 20 seconds of prefill to answer a question it had already prefilled for a different user thirty seconds earlier. That is compute that could otherwise be used for new work. KV cache offload solves it by keeping the state somewhere cheaper than HBM and handing it back instead of recomputing it. Restoring a cached prefix rather than rebuilding it returns roughly 90% of the GPU time that request would have spent on prefill.
The trade-off is simple:
| Without reuse | Existing context >> GPU precomputation >> KV cache >> Generation |
|---|---|
| With reuse | Existing context >> retrieve reusable KV cache >> Generation |
3.1. Local KV cache has a capacity limit
GPU HBM provides fast access but limited capacity. Host memory expands the local cache capacity, but it is also finite. As context length and concurrency increase, the reusable KV state may exceed both local tiers.
At that point, the system has two options:
Discard cache and recompute or store it in an additional cache tier and retrieve it when needed.
This introduces shared storage and the network into the KV cache hierarchy. In practice that hierarchy has three tiers:
- Tier 1 – GPU HBM: fastest access, smallest cache capacity.
- Tier 2 – Host DRAM / LMCache: larger, node-local cache.
- Tier 3 – Storage: local NVMe or shared storage accessible to multiple serving nodes over the network.
Moving cached state beyond HBM trades access speed for additional capacity. That trade is worth making because reading cached KV state from any other tier is faster than recomputing it on the GPU.
Shared storage adds one more benefit: every node in the cluster can reach the same cache. In benchmark testing of AMD Instinct MI355X clusters using multi-turn coding-agent workloads, at 64 concurrent requests, HBM alone had run out of room and median time to first token reached 61 seconds. Adding a host DRAM tier to the same split prefill/decode configuration cut it to 21.9 seconds. Adding local NVMe read GPU-direct cut it to 11.3 seconds. These tiers delivered roughly 2.8× and 5.4× lower median time to first token, respectively.
3.2. KV cache storage depends on the network
Shared storage sits on the other side of the network. Every KV cache read has to cross the Ethernet fabric between the GPUs and the storage, so the storage is only as fast as the path to it. Under the heaviest load, a well-built networking fabric cuts the wait for the first token significantly.
For cluster builders the rule is simple. The storage and the Ethernet fabric that connects it to the GPUs have to be designed together, so that neither one holds the other back.
3.3. DriveNets + VAST example: shared KV cache offload
This is exactly the principle DriveNets, AMD, and VAST Data set out to prove. Together we built an architecture where reusable KV cache state can span between compute memory, host memory or an external shared cache tier, and we designed the storage and the DriveNets AI fabric together so neither one holds the other back.
Test Setup:
- VAST served as the external shared KV cache tier alongside GPU and host memory and was tested as a CNode/DNode 3×2 configuration that provided the shared persistent data path.
- VAST was mounted over NFSv3 with the Enhanced NFS client and multipathing, spreading reads across multiple CNodes and both interfaces to fill the bandwidth.
- The DriveNets lossless fabric was tuned protocol by protocol so RDMA and TCP each got what they needed. Across the complete DriveNets and VAST data path, a single eight-GPU server sustained 89.8 GB/s of read throughput, about 90% of the dual 400 Gb/s line rate.
- The benchmark ran GPT-OSS-120B with a 120K-token input sequence, TP=8 across eight AMD MI355X GPUs, and concurrency from 100 to 600 simultaneous requests.
Results:
- Throughput (Tokens/Second):
The VAST-backed shared cache delivered about 5× higher throughput than local-only once the working set outgrew local cache, roughly 470K to 508K tokens/s versus below 100K tokens/s
Warm total tok/s vs concurrency: KV cache cliff - Time to First Token (TTFT)
About 12.6× lower TTFT at concurrency 600 than the local-only configuration.
Cold vs warm mean TTFT vs concurrency
Performance impact: KV cache offloading reduces repeated prefill computation and, in this benchmark, improved TTFT by about 12.6× and throughput by about 5×, particularly for long-context, multi-turn, and high-concurrency workloads. Offloading depends heavily on the network, so getting the network right is what turns a promising microbenchmark into more users served per GPU.
Three drivers, three different bottlenecks
Shrink, Move, and Reuse each target a different bottleneck. Shrink reduces the memory footprint, Move speeds data transfer, and Reuse avoids recomputation. They also reinforce one another, since a smaller KV footprint is cheaper to move and to store for reuse, and faster movement makes shared-cache reuse more attractive.
The goal is not to optimize one metric but to improve the inference metrics that matter to the cluster builder, and because the impact of each driver depends on the model, context length, concurrency, architecture, and cache hit rate, no single optimization fits every cluster. The way to find the right mix is to evaluate the cluster end to end against its workload, across the GPU, model, network, and storage, which is exactly where DriveNets focuses.
| KV cache driver | Main bottleneck addressed | Primary performance impact |
|---|---|---|
| Shrink it | Memory footprint | Concurrency, Throughput |
| Move it | Data transfer | TTFT, throughput |
| Reuse it | Recomputation | TTFT, throughput |
Frequently Asked Questions
What limits how many requests a GPU can serve during LLM inference?
The number of requests a GPU can serve during LLM inference is limited largely by KV cache memory. A larger KV cache footprint consumes more GPU memory per active sequence, and longer contexts and more concurrent requests increase that footprint. In DriveNets testing of GPT-OSS-120B on AMD MI355X GPUs, a Multi-head Latent Attention version with a 62.5% smaller KV cache per request kept its throughput from collapsing until 900 concurrent requests, versus 300 for vanilla Grouped Query Attention.
How much does reusing the KV cache speed up LLM inference?
Reusing the KV cache returns roughly 90% of the GPU time a request would otherwise spend on prefill, because a cached prefix is restored instead of rebuilt. In a DriveNets, AMD and VAST Data benchmark running GPT-OSS-120B with a 120K-token input, the shared KV cache delivered about 5× higher throughput than local-only caching once the working set outgrew the local cache, and about 12.6× lower time to first token at concurrency 600.
Why do long prompts slow the first token in disaggregated LLM inference?
Long prompts slow the first token in disaggregated LLM inference because the KV cache built during prefill must cross the network to the decode node before generation starts. A 100K-token or 1M-token context can produce gigabytes of KV cache. In a DriveNets test with 64K input tokens on a three-node AMD MI355X cluster, DriveNets KVeXpress cut time to first token by an average of 13.4% compared with the best-performing Mooncake configuration.
Contents
Sign up to get the latest news and insights.



