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

一种通过多粒度压缩的统一稀疏注意力机制

A Unified Sparse Attention via Multi-Granularity Compression

Siran Liu, Zane Cao, Yongchao He

AI总结:

UniSparse通过多粒度压缩和块级选择,实现高效稀疏注意力机制,提升LLM在长上下文理解和推理中的效率与准确性。

摘要:

高效的长上下文理解和推理能力对于大型语言模型(LLM)应用,如多轮对话和程序分析,变得越来越关键。然而,核心的自注意力机制随着序列长度的增加而平方增长,形成了一个基本的计算瓶颈。现有的稀疏注意力方法缓解了这一问题,但面临权衡:基于训练的方法成本高,无法直接作为其他模型的加速插件使用,而基于推理的方法往往牺牲效率或跨模态的通用性。为了解决这些限制,我们提出了UniSparse,一种统一的机制,引入了复合令牌的概念——紧凑的表示,能够聚合多粒度的上下文信息。基于这一抽象,UniSparse通过多粒度压缩和块级选择动态构建稀疏注意力,使在GPU上高效且硬件友好的执行成为可能。在多种模态和任务上,从合成基准到实际应用,UniSparse在准确性和效率上均优于最先进的稀疏注意力方法(例如MInference、XAttention、FlexPrefill),在准确率上达到全注意力的99%以上,并在注意力计算速度上比FlashAttention快多达2.61倍。

英文摘要:

Efficient long-context understanding and reasoning are increasingly vital for large language model (LLM) applications such as multi-turn dialogue and program analysis. However, the core self-attention mechanism scales quadratically with sequence length, creating a fundamental computational bottleneck. Existing sparse attention methods alleviate this issue but face trade-offs: training-based methods are costly and cannot be directly applied as acceleration plugins for other models, while inference-time methods often compromise efficiency or cross-modal generality. To address these limitations, we present UniSparse, a unified mechanism that introduces the notion of composite tokens--compact representations that aggregate multi-granularity contextual information. Building on this abstraction, UniSparse dynamically constructs sparse attention through multi-granularity compression and block-level selection, enabling efficient and hardware-friendly execution on GPU. Across multiple modalities and tasks ranging from synthetic benchmarks to real-world applications, UniSparse consistently surpasses state-of-the-art sparse attention methods (e.g., MInference, XAttention, FlexPrefill) in both accuracy and efficiency, achieving $\ge$ 99% of full-attention accuracy and up to 2.61$\times$ faster attention computation than FlashAttention.

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

↑