arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.06763cs.LG
收藏

稀疏注意力作为范围搜索问题:迈向一种高效的KV缓存索引

Sparse Attention as a Range Searching Problem: Towards an Inference-Efficient Index for KV Cache

Department of Computer Science(计算机科学系);University of Illinois Chicago(伊利诺伊大学芝加哥分校)

Mohsen Dehghankar, Abolfazl Asudeh

AI总结:

本文提出Louver索引,通过将稀疏注意力重新表述为半空间范围搜索问题,解决KV缓存检索中的准确性和效率问题,实验表明其在精度和运行时间上优于现有方法。

摘要:

稀疏注意力通过选择部分键值对提升LLM推理效率,但可能造成精度下降。现有方法在固定或自适应token预算下提供经验鲁棒性或部分理论保证,但无法保证解码步骤中零误判。本文通过将稀疏注意力重新表述为半空间范围搜索问题,提出Louver索引,该索引在理论和实践中保证指定阈值下的零误判,轻量级易集成,并结合硬件优化。实验表明Louver在精度和运行时间上均优于现有稀疏注意力方法,且比FlashAttention等密集注意力更快。

英文摘要:

Sparse attention improves LLM inference efficiency by selecting a subset of key-value entries, but at the cost of potential accuracy degradation. In particular, omitting critical KV entries can induce substantial errors in model outputs. Existing methods typically operate under fixed or adaptive token budgets and provide empirical robustness or partial theoretical guarantees, yet they do not ensure zero false negatives in decoding steps, particularly since the set of relevant tokens is both query- and step-dependent. Our empirical observations confirm that missing even one critical key can lead to sharp error spikes, especially in long reasoning tasks where the set of important tokens varies throughout decoding. This observation motivates the need for indexing methods that dynamically adapt to these variations across decoding steps while guaranteeing a full recall of the relevant keys above a certain threshold. We address this challenge by reformulating sparse attention as the halfspace range searching problem. However, existing range searching indices are not suitable for modern LLM inference due to their computational and implementation overheads. To overcome this, we introduce Louver, a novel index structure tailored for efficient KV cache retrieval. Louver (i) guarantees zero false negatives with respect to a specified threshold in both theory and practice, (ii) is lightweight to integrate into existing LLM pipelines, and (iii) incorporates hardware-aware optimizations for both CPU and GPU executions. Our experiments demonstrate that Louver outperforms prior sparse attention methods in both accuracy and runtime, and is faster than highly optimized dense attentions such as FlashAttention. These results highlight that recall guarantees are a critical and overlooked dimension of sparse attention, and open a new direction for building theoretically grounded, efficient KV cache indices.

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

↑