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

DepthKV:面向长上下文LLM推理的分层KV缓存压缩

DepthKV: Layer-Dependent KV Cache Pruning for Long-Context LLM Inference

Ruhr University Bochum(博德姆鲁尔大学);UAR Research Center for Trustworthy Data Science and Security(UAR可信数据科学与安全研究中心)

Zahra Dehghanighobadi, Asja Fischer

AI总结:

本文提出DepthKV,通过分层敏感度分配优化KV缓存预算,提升长上下文LLM推理效率,优于统一剪枝方法。

摘要:

长上下文推理是大型语言模型(LLM)的关键能力,使长文档理解、摘要和代码生成等应用成为可能。然而,高效的自回归推理依赖于键值(KV)缓存,其内存开销与序列长度成线性增长,导致主要内存瓶颈。为缓解此开销,KV缓存剪枝方法在推理过程中删除注意力得分低的缓存标记。现有方法通常在所有层上应用统一剪枝比例,隐含假设所有层对整体模型性能贡献相等。我们证明此假设不优,因为各层对剪枝的敏感度差异显著。我们提出DepthKV,一种分层剪枝框架,根据层的敏感度分配固定全局KV预算,而非使用统一分配。在多个模型和任务中,DepthKV在相同全局剪枝比例下始终优于统一剪枝,通过分层分配更有效地利用KV缓存预算。

英文摘要:

Long-context reasoning is a critical capability of large language models (LLMs), enabling applications such as long-document understanding, summarization, and code generation. However, efficient autoregressive inference relies on the key-value (KV) cache, whose memory footprint grows linearly with sequence length, leading to a major memory bottleneck. To mitigate this overhead, KV cache pruning methods discard cached tokens with low attention scores during inference. Most existing methods apply a uniform pruning ratio across layers, implicitly assuming that all layers contribute equally to overall model performance. We show that this assumption is suboptimal, as layers differ significantly in their sensitivity to pruning. We propose DepthKV, a layer-dependent pruning framework that allocates a fixed global KV budget across layers based on their sensitivity, rather than using a uniform allocation. Across multiple models and tasks, DepthKV consistently outperforms uniform pruning at the same global pruning ratio, demonstrating more effective utilization of the KV cache budget through layer-dependent allocation.

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

↑