How LLM KV Caching Affects Chip Performance
This article explains how KV caching in multi-turn LLM workloads shifts the bottleneck from compute to memory bandwidth and capacity. It compares distributed memory pooling with local two-tier storage, traces the performance gap to I/O scheduling that is unaware of conversation structure, and outlines chip-oriented optimizations such as session-level cache granularity, compute-storage co-scheduling, tiered placement, capacity planning aligned with chip memory, and observability. Readers will learn why adding peak compute alone does not improve multi-turn inference and how to narrow the gap of the two-tier approach.
1. Where the Problem Starts: Multi-Turn Dialogue Spends Compute on Repeated Work
Multi-turn conversational workloads behave very differently from single-turn question answering. Every generation step needs the Key/Value tensors from all previous turns. Without caching, the historical context has to be recomputed again and again, and the overhead accumulates quickly as the conversation grows. Industry measurements show that in real conversational traffic, the average number of turns per user can exceed twenty, and redundant computation can account for roughly ninety percent of the total compute. In other words, most of the chip’s compute is not producing new content — it is recomputing old context.
This puts two kinds of pressure on the chip at the same time. On one side, attention and projection computations keep the compute units busy. On the other, reading and writing the cache continuously competes for memory bandwidth. When compute is saturated by work that produces nothing new, raising a chip’s peak compute does not improve the experience linearly; it may simply leave the chip idle while bandwidth and capacity become the real limits.
2. Two Caching Approaches and Their Limits
The industry has two main ways to reuse KV data.
The first is a distributed memory pool, which uses a high-speed network to combine remote memory into one large pool. It offers good latency, but it requires dedicated networking and hardware investment. The deployment barrier and cost are high, and vertical industries and small teams often cannot afford it.
The second is local two-tier storage, with host memory as the fast tier and solid-state drives as the slow tier. It offers large capacity at low cost and is the mainstream choice for cost-sensitive scenarios. The basic structure is straightforward: the chip side handles computation, and KV tensors are loaded from the fast or slow tier on demand.
The problem is that under real workloads, this approach performs noticeably worse than the ideal state where all KV data stays resident in the fast tier: response latency can be several times higher and throughput drops by about half. A gap this large suggests the bottleneck is not the storage medium itself, but the scheduling mechanism.
3. Root Cause: The Compute Engine and the Storage Layer Know Nothing About Each Other
Breaking the two-tier design apart shows that the problems concentrate in two components that operate independently.
The first is I/O scheduling that works blind. The storage layer moves data using generic caching policies. It does not know whether a given KV segment will actually be used in the next turn, nor when the conversation will end, so a large amount of bandwidth is wasted on useless transfers while the data that is truly needed waits in line.
The second is an eviction policy that does not understand conversation patterns. Generic LRU-style policies only look at the last access time, whereas the defining feature of conversational workloads is that the KV data of the same session is reused across consecutive turns and becomes invalid as a whole once the session ends. Evicting at the granularity of individual tensors scatters a session’s cache, so the next turn hits many small, fragmented misses and the number of I/O operations is amplified.
Combined, the two create a vicious cycle: the more fragmented the eviction, the more misses occur; and the more misses occur, the more bandwidth blind scheduling wastes.
4. Chip-Oriented Optimization Ideas
1. Use the Session as the Cache Granularity
Raise the organization and eviction granularity of KV data from a single tensor to the session level, so a conversation’s cache stays resident and is evicted as a whole. This reduces fragmentation and random I/O and brings bandwidth usage closer to the peak achievable with sequential access.
2. Coordinate Compute and Storage Scheduling
Let the compute side tell the storage side in advance which context will be needed next, so the storage side can prefetch and prioritize accordingly. The compute side, in turn, adjusts batching based on cache hit rates, avoiding compute units that spin while waiting for I/O.
3. Tiered Placement and Hot/Cold Identification
Decide whether KV data lands in the fast or slow tier based on session activity, estimated remaining turns, and access frequency. Keep hot sessions resident in memory as much as possible and push cold sessions down to disk to reduce back-and-forth movement across tiers.
4. Link Capacity Planning to Chip Selection
Match cache capacity planning to the chip’s memory and memory bandwidth: keep only the active KV data of the current batch in device memory, use host memory for the warm tier, and use solid-state drives for the cold tier. This avoids the imbalance where compute is sufficient but bandwidth is fully consumed by data movement.
5. Build Observability
Collect metrics such as cache hit rate, cross-tier transfer volume, and queueing latency through monitoring, alerting, and logging services, and use that data to determine whether the bottleneck lies in compute, bandwidth, or capacity.
5. Implementation Recommendations
When putting these ideas into practice on cloud platforms such as Baidu AI Cloud, they can be mapped onto a combination of general capabilities: use a container platform to host the inference service and the cache service, use object storage to archive cold data, and use the monitoring and alerting system to track hit rates and bandwidth levels. The core principle is a single one: make the caching strategy “aware” of the structure of the conversation, and make scheduling decisions that see both compute and I/O. Only then can the performance gap of the two-tier storage approach be genuinely narrowed.
