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

SparDA: 用于高效长上下文LLM推理的稀疏解耦注意力

SparDA: Sparse Decoupled Attention for Efficient Long-Context LLM Inference

NVIDIA;Thinking Machines Lab;ByteDance Seed;MIT

Yaosheng Fu, Guangxuan Xiao, Xin Dong, Song Han, Oreste Villa

AI总结:

提出SparDA架构,通过引入第四投影Forecast实现KV缓存预取与注意力解耦,减少稀疏选择开销,在长上下文推理中实现1.25倍预填充加速和1.7倍解码加速。

摘要:

稀疏注意力减少了长上下文LLM推理的计算和内存带宽。然而,仍然存在两个关键挑战:(1)KV缓存容量随序列长度增长,卸载到CPU内存引入了PCIe传输瓶颈;(2)稀疏选择步骤本身保持$O(T^2)$复杂度,在长上下文中可能主导注意力成本。我们提出SparDA,一种解耦的稀疏注意力架构,它在Query、Key和Value之外引入了第四个逐层投影——Forecast。Forecast预测下一层所需的KV块,从而实现超前选择,将CPU到GPU的预取与当前层执行重叠。由于Forecast与注意力查询解耦,我们的GQA实现为每个GQA组使用一个Forecast头,相比原始多头选择器减少了选择开销。SparDA增加了<0.5%的参数,并通过匹配原始选择器的注意力分布仅训练Forecast投影。在两个稀疏预训练的8B模型上,SparDA匹配或略微提高了准确性,并且相比稀疏注意力卸载基线,提供了高达1.25倍的预填充加速和1.7倍的解码加速。通过使单个GPU上可行的批量大小更大,SparDA进一步实现了比非卸载稀疏基线高达5.3倍的解码吞吐量。我们的源代码可在https://github.com/NVlabs/SparDA获取。

英文摘要:

Sparse attention reduces compute and memory bandwidth for long-context LLM inference. However, two key challenges remain: (1) KV cache capacity still grows with sequence length, and offloading to CPU memory introduces a PCIe transfer bottleneck; (2) sparse selection during prefill retains $O(T^2)$ complexity and can dominate attention cost at long contexts. We propose SparDA, a decoupled sparse attention architecture that introduces a fourth per-layer projection, the Forecast, alongside Query, Key, and Value. The Forecast predicts the KV blocks needed by the next layer, enabling lookahead selection that overlaps CPU-to-GPU prefetch with current-layer execution. Because Forecast is decoupled from the attention query, our GQA implementation uses one Forecast head per GQA group, reducing selection overhead versus the original multi-head selector. On the evaluated 8B models, SparDA adds <0.5% parameters and trains only the Forecast projections using attention-derived supervision from the frozen backbone. On two sparse-pretrained 8B models, SparDA maintains accuracy comparable to the full-query sparse-attention baseline while delivering up to 1.25$\times$ prefill speedup and 1.7$\times$ decode speedup over the sparse-attention offload baseline. By enabling larger feasible batch sizes on a single GPU, SparDA further reaches up to 5.3$\times$ higher decode throughput than the non-offload sparse baseline on MiniCPM4.1-8B. Our adaptation to GLM-5.1 (754B MoE) also achieves accuracy comparable to native token-level DSA, extending the accuracy evaluation beyond block-sparse 8B models. Our source code is available at https://github.com/NVlabs/SparDA.

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

↑