arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.06807cs.CR
收藏

MPCache:面向高效私有LLM推理的MPC友好KV缓存淘汰

MPCache: MPC-Friendly KV Cache Eviction for Efficient Private LLM Inference

Peking University(北京大学);National University of Singapore(新加坡国立大学);Ant Group(蚂蚁集团)

Wenxuan Zeng, Ye Dong, Jinjin Zhou, Jin Tan, Lei Wang, Tao Wei, Runsheng Wang, Meng Li

AI总结:

针对MPC私有LLM推理延迟高的问题,提出MPCache框架,结合静态淘汰与查询感知动态选择,并优化相似度近似、聚类和跨层索引共享,显著降低解码延迟与通信量。

摘要:

基于安全多方计算(MPC)的私有大语言模型(LLM)推理实现了形式化的数据隐私保护,但存在显著的延迟开销,尤其是在处理长输入序列时。尽管已有针对明文高效LLM推理的键值(KV)缓存淘汰和稀疏注意力算法,但它们并非为MPC设计,无法直接惠及私有LLM推理。本文提出一种精确且MPC友好的KV缓存淘汰框架,名为MPCache,其基于观察:长序列中的历史token对下游解码可能具有不同影响。因此,MPCache结合了一种一次性静态淘汰算法以丢弃不重要的KV缓存,以及一种查询感知的动态选择算法,仅激活一小部分KV缓存用于注意力计算。MPCache进一步整合了一系列优化以实现高效的动态KV缓存选择,包括MPC友好的相似度近似、分层KV缓存聚类以及跨层索引共享策略。大量实验表明,MPCache在不同生成任务中持续优于先前的KV缓存淘汰基线,并在不同序列长度上分别实现了1.8~2.01倍和3.39~8.37倍的解码延迟和通信量降低。

英文摘要:

Private large language model (LLM) inference based on secure multi-party computation (MPC) achieves formal data privacy protection but suffers from significant latency overhead, especially for long input sequences. While key-value (KV) cache eviction and sparse attention algorithms have been proposed for efficient LLM inference in plaintext, they are not designed for MPC and cannot benefit private LLM inference directly. In this paper, we propose an accurate and MPC-friendly KV cache eviction framework, dubbed MPCache, building on the observation that historical tokens in a long sequence may have different effects on the downstream decoding. Hence, MPCache combines a look-once static eviction algorithm to discard unimportant KV cache and a query-aware dynamic selection algorithm to activate only a small subset of KV cache for attention computation. MPCache further incorporates a series of optimizations for efficient dynamic KV cache selection, including MPC-friendly similarity approximation, hierarchical KV cache clustering, and cross-layer index-sharing strategy. Extensive experiments demonstrate that MPCache consistently outperforms prior-art KV cache eviction baselines across different generation tasks and achieves 1.8 ~ 2.01x and 3.39 ~ 8.37x decoding latency and communication reduction on different sequence lengths, respectively.

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

↑