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

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

韩松 Song Han · MIT / NVIDIA · 2026-06-03 · arXiv:2606.04511 ↗ · 被引 0

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

稀疏注意力减少了长上下文 LLM 推理的计算和内存带宽,但仍面临两个关键挑战:(1)KV 缓存容量随序列长度增长,卸载到 CPU 内存会引入 PCIe 传输瓶颈;(2)稀疏选择步骤本身保持 O(T²)复杂度,在长上下文中可能主导注意力成本。我们提出 SparDA,一种解耦的稀疏注意力架构,在查询、键和值之外引入了第四个逐层投影——预测(Forecast)。预测预测下一层所需的 KV 块,实现超前选择,将 CPU 到 GPU 的预取与当前层执行重叠。由于预测与注意力查询解耦,我们的 GQA 实现每个 GQA 组使用一个预测头,相比原始多头选择器减少了选择开销。SparDA 仅增加<0.5%的参数,并通过匹配原始选择器的注意力分布仅训练预测投影。在两个稀疏预训练的 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) the sparse selection step itself 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. SparDA adds $&lt;$0.5% parameters and trains only the Forecast projections by matching the original selector's attention distribution. On two sparse-pretrained 8B models, SparDA matches or slightly improves accuracy and delivers 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. Our source code is available at https://github.com/NVlabs/SparDA.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 12)

阅读逐段中英对照全文 →