跳到正文
arXiv (AI + Vision + Imaging)· Ambroise Borbely, Mathieu Salzmann, Olivier Verscheure·· 6 天前AI 评分36

HiSA:在LLM的RoPE注意力中稀疏化隐藏维度

HiSA: Sparsifying the Hidden Dimension of RoPE Attention in LLMs

AI 导读

研究者提出Hidden Sparse Attention(HiSA),保持query和key投影完整,仅按token位置设定的静态无参数规则计算部分点积,使注意力在隐藏特征维度而非token维度上稀疏。从头训练LLM显示,HiSA仅计算约三分之一的query-key乘积,性能不降反升,并提升解码速度、缩小内存占用。该方法已扩展到FlashAttention-3内核,用于训练和推理。

正文 · 原文

arXiv:2611.26363v1 Announce Type: new Abstract: Attention in large language models (LLMs) scores every query against every key with a full dot product. We investigate whether this dot product must be computed completely for attention to be effective. We propose Hidden Sparse Attention (HiSA), which keeps the query and key projections intact but only computes a partial dot product, following a static, parameter-free rule set by the token positions: attention becomes sparse in the hidden (feature) dimension, an axis much less explored than token sparsity, rather than over tokens as in almost all sparse attention methods. Based on the structure of rotary position embeddings (RoPE), we decompose keys and queries into parts which can be omitted when computing attention. By training LLMs from scratch with HiSA, we find that this partial dot product does not hurt but improves performance compared with the complete product while computing only about a third of the query-key products. During inference HiSA improves decoding speed and shrinks memory footprint. We also extend HiSA to FlashAttention-3 kernels for training and inference. Finally, we motivate our approach by showing that dense attention learns to suppress the attention score parts that HiSA drops. Code is available at https://github.com/ambroise-b/hisa.

来源:arXiv (AI + Vision + Imaging) · arxiv.org