arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.16525cs.CLcs.AI
收藏

KVShare:具备高效多租户KV缓存复用能力的大语言模型服务系统

KVShare: An LLM Service System with Efficient and Effective Multi-Tenant KV Cache Reuse

Central South University(中南大学);Tsinghua University(清华大学)

Huan Yang, Renji Zhang, Mingzhe Huang, Weijun Wang, Yin Tang, Yuanchun Li, Yunxin Liu, Deyu Zhang

AI总结:

针对大模型长上下文带来的高计算成本和首token时延问题,提出KVShare系统,通过双阶段高偏差算法和缓存感知调度器实现多租户KV缓存跨请求复用,显著提升服务效率与准确率。

摘要:

长文本理解领域的最新进展已将大语言模型(LLM)的上下文长度推高至一百万token。这提升了LLM的准确率和推理能力,但也带来了高昂的计算成本和不佳的首token生成时延(Time to First Token, TTFT)。KV缓存复用——即复用前缀和模板完全相同的KV缓存,或共享相似的KV缓存并辅以额外的选择性重计算——为解决这一问题提供了可行思路。然而,现有研究忽略了解码阶段新token引入的跨请求KV复用问题以及注意力偏差。本文提出一种KV缓存管理模块,可在多租户场景下跨请求共享KV缓存且不损失模型准确率。我们的系统KVShare通过两大机制实现准确高效的LLM服务:1)双阶段高偏差算法(Dual-Stage High Deviation algorithm, DHD),在预填充(prefill)和解码阶段均有条件地选择一小部分KV缓存进行重计算;2)缓存感知调度器,根据请求的KV缓存命中率分配优先级,并协调连续批处理(continuous batching),以提升系统效率并缩短TTFT。在Qwen2.5-7B、Llama3.1-8B和Yi1.5-9B等模型上开展的多任务实验表明,与全量KV重计算相比,KVShare将TTFT降低最高达9.39倍,吞吐量提升1.2倍。此外,相较于当前最优(SOTA)方法,KVShare的准确率提升了20.38%。

英文摘要:

Recent advances in long-text understanding have pushed the context length of large language models (LLMs) up to one million tokens. It boosts LLMs's accuracy and reasoning capacity but causes exorbitant computational costs and unsatisfactory Time to First Token (TTFT). KV cache reuse, which reuses the exact same KV cache of prefixes and templates or shares similar ones but with extra selective recomputation, offers a promising way to tackle this issue. However, prior studies overlook the cross-request KV reuse and the attention deviations introduced by new tokens during the decoding stage. In this paper, we present a KV cache management module that shares the KV cache across requests under multi-tenant scenarios without sacrificing model accuracy. Our system, KVShare, enables accurate and efficient LLM serving by 1) a Dual-Stage High Deviation algorithm (DHD) that conditionally selects a small portion of KV cache to be recomputed during both prefill and decode phases, and 2) a cache-aware scheduler that prioritizes requests based on their KV cache hit rates and orchestrates continuous batching to achieve enhanced system efficiency and faster TTFT. Multi-task experiments conducted on models such as Qwen2.5-7B,Llama3.1-8B and Yi1.5-9B demonstrate that KVShare reduces TTFT by up to 9.39x and increases 1.2x of the throughput compared to the full KV recompute. Moreover, KVShare achieves 20.38% boost in terms of accuracy compared to SOTA methods.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑