arXiv:2601.18999cs.LGcs.AI2026-01被引 2

提出联合优化缓存与负载均衡的新方法,显著提升大模型推理性能。

Randomization Boosts KV Caching, Learning Balances Query Load: A Joint Perspective

  • 引入随机化缓存淘汰与学习型查询路由协同机制
  • 缓存命中率最高提升6.92倍,首次生成延迟降低14.06倍
  • 适合高并发大模型服务场景,尤其关注推理效率的工程师

KV缓存是加速大语言模型推理的核心技术,通过复用先前查询的键值对来提升效率,但在内存受限情况下,其效果高度依赖淘汰策略。默认的最近最少使用(LRU)算法在动态在线查询场景下表现不佳,尤其在多模型服务中,平衡各工作节点的查询负载与最大化单个节点的缓存命中率存在内在冲突。本文首次建立统一数学模型,揭示缓存淘汰与查询调度之间的核心权衡。分析表明现有方法存在理论局限,进而提出结合可证明竞争力的随机化缓存淘汰与基于学习的自适应查询路由算法,实现负载均衡与高命中率的协同优化。在4个基准数据集和3种前缀共享设置下的大量实验验证了该方法的有效性:相比当前最优方法,缓存命中率最高提升6.92倍,延迟降低11.96倍,首次生成时间减少14.06倍,吞吐量提升77.4%。代码已开源。

原文摘要 · Abstract (English)

KV caching is a fundamental technique for accelerating Large Language Model (LLM) inference by reusing key-value (KV) pairs from previous queries, but its effectiveness under limited memory is highly sensitive to the eviction policy. The default Least Recently Used (LRU) eviction algorithm struggles with dynamic online query arrivals, especially in multi-LLM serving scenarios, where balancing query load across workers and maximizing cache hit rate of each worker are inherently conflicting objectives. We give the first unified mathematical model that captures the core trade-offs between KV cache eviction and query routing. Our analysis reveals the theoretical limitations of existing methods and leads to principled algorithms that integrate provably competitive randomized KV cache eviction with learning-based methods to adaptively route queries with evolving patterns, thus balancing query load and cache hit rate. Our theoretical results are validated by extensive experiments across 4 benchmarks and 3 prefix-sharing settings, demonstrating improvements of up to 6.92$\times$ in cache hit rate, 11.96$\times$ reduction in latency, 14.06$\times$ reduction in time-to-first-token (TTFT), and 77.4% increase in throughput over the state-of-the-art methods. Our code is available at https://github.com/fzwark/KVRouting.

大模型推理缓存优化负载均衡

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。