DEV Community

Mingxin Technology
Mingxin Technology

Posted on • Originally published at mingxinstorage.xyz

KV Cache Memory vs. Hit Rate: Why Larger Caches Yield Diminishing Returns

Key Findings

The relationship between KV Cache memory investment and inference acceleration gains is not linear: once cache capacity reaches a certain threshold, further expansion yields noticeably narrower improvements in hit rate and end-to-end speedup. This phenomenon stems from three compounding mechanisms—the power-law distribution of working set sizes, diminishing marginal hit rates from cache replacement, and the declining share of remote read latency in total latency. For technical decision-makers at compute centers, this means KV Cache capacity planning should anchor on the working set of the target workload, rather than pursuing "bigger is always better."

Why Larger KV Caches Yield Diminishing Returns

The core value of KV Cache lies in reuse. According to Efficient Memory Management for Large Language Model Serving with PagedAttention, the motivation for paged KV Cache management is precisely to address GPU memory fragmentation, allowing more historical key-value pairs to reside in memory. However, the boundary of cache benefits is determined by the workload itself: when cache capacity exceeds the active working set, additional capacity can only cache cold data with extremely low access frequency, and the hit rate improvement drops sharply.

Mingxin's measured data under a 480B production deployment with long-context cold-restore workloads clearly demonstrates this marginal effect [measured, report R2/R3]:

Concurrency Level Throughput Improvement Notes
Concurrency 8 +29% Lower bound
Concurrency 16 +40% Optimal operating point (upper bound)
TP4×2 full-node basis +35–36% Full-node aggregate

From concurrency 8 to 16, throughput improvement rises from 29% to 40%, an increase of about 11 percentage points; but as concurrency continues to rise, the improvement does not scale proportionally and instead falls back to 35–36% on a full-node basis. This indicates a "sweet spot" range for cache capacity—beyond which the incremental benefit of additional memory investment rapidly decays.

Hit Rate vs. Cache Capacity: The Mechanism Behind Diminishing Marginal Returns

To understand this phenomenon, we must break down the relationship between KV Cache hit rate and cache capacity. According to SGLang: Efficient Execution of Structured Language Model Programs, RadixAttention improves hit rates in multi-turn dialogue and shared-prefix scenarios through a prefix-tree reuse mechanism. But the ceiling of this mechanism's benefit is equally constrained by workload characteristics: if concurrent requests share limited prefixes, the reuse space of the prefix tree is inherently restricted.

Another key mechanism is the marginal hit rate of cache replacement. When cache capacity is small, additional capacity can accommodate more high-frequency KV blocks, yielding significant hit rate gains; as capacity approaches the working set size, additional capacity can only replace low-frequency cold blocks, and hit rate gains taper off. This pattern is also visible in Mingxin's measured time-to-first-token (TTFT) data [measured, report R2]:

Metric Baseline (no external recompute) FX100 Improvement
TTFT p50 (concurrency 16) 149.5s 11.85s 8.6–20×
Throughput (concurrency 16) 4.1 tok/s 74.9 tok/s ~18×

In the baseline scenario (no external recompute), TTFT reaches as high as 149.5 seconds; introducing KV Cache yields dramatic improvements—this is precisely the range where cache benefits are greatest. However, as hit rates approach their ceiling, the remaining TTFT is dominated by compute and network transfer, and the impact of cache expansion on end-to-end latency diminishes accordingly.

Practical Implications for Capacity Planning: Anchor on the Working Set

For compute centers, the core question in KV Cache capacity planning is not "how large can we make it," but "how large is the working set of the target workload?" According to Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving, the KVCache-centric disaggregated architecture improves resource utilization through prefix cache reuse and cross-node KV pooling, but its design premise is accurately identifying working set characteristics—if the workload has very few shared prefixes, the benefit of cross-node pooling is equally limited.

Mingxin's measured data on Ascend platforms confirms the leverage effect of caching from another angle [measured, report R9]:

Model Load Time (NFS baseline) Load Time (FX100) Speedup
DeepSeek-32B 691s 112s 6.2×
DeepSeek-70B 1399s 150s 9.3×

The larger the model, the longer the absolute cold-start load time, and the larger the absolute speedup from caching. But this benefit also follows the law of diminishing returns: once model weights fully reside in memory, further expansion no longer accelerates loading.

Conclusion

KV Cache memory investment and returns follow a diminishing marginal pattern; capacity planning should anchor on the working set of the target workload, not blind expansion. Mingxin has accumulated reproducible measurement methodologies in KV Cache tiered acceleration, supporting approximately 10-week gated joint testing validation (from G1 arrival acceptance to G4 72-hour stability), and welcomes compute center teams with clear SLA constraints to contact us for joint testing.

Key Q&A

Q: Does a larger KV Cache always guarantee higher inference acceleration gains?
A: Not necessarily. Mingxin's 480B workload measurements show that after throughput improvement reaches the optimal operating point of +40% at concurrency 16, further expansion actually narrows the gains (falling back to +35–36% on a full-node basis), exhibiting clear diminishing marginal returns.

Q: What is the mechanism behind diminishing cache returns?
A: When cache capacity exceeds the active working set, additional capacity can only cache low-frequency cold data, and hit rate gains taper off; simultaneously, the share of remote read latency in total latency declines, weakening the impact of cache expansion on end-to-end latency.

Q: How should KV Cache capacity be sized?
A: It should be anchored on the working set size of the target workload, combined with concurrency patterns and shared-prefix characteristics to determine the "sweet spot" range, rather than simply pursuing large capacity. Mingxin supports validating capacity plans through approximately 10-week gated joint testing with measured results.

References

  1. Efficient Memory Management for Large Language Model Serving with PagedAttention — https://arxiv.org/abs/2309.06180
  2. SGLang: Efficient Execution of Structured Language Model Programs — https://arxiv.org/abs/2312.07104
  3. Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving — https://arxiv.org/abs/2407.00079

Originally published at mingxinstorage.xyz. Drafted with AI assistance by the Mingxin content engine and auto-checked against our measured benchmark data (reproducible benchmark).

Top comments (0)