HiSA: Sparsifying the Hidden Dimension of RoPE Attention in LLMs
Ambroise Borbely, Mathieu Salzmann, Olivier Verscheure
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.
Create a lesson
Related papers
Turnout: Adaptive Attention Switching for Efficient Reasoning
Shared title terminology · Anna Kuzina, Mart van Baalen, Paul N. Whatmough et al.
BusemannFormer: Horospherical Self-Attention for Hyperbolic Graph Transformers
Shared title terminology · Youheng Yao, Ziyao Zeng, Wenbo Liao et al.
Attention Head Specialization: Phase Transitions in Sample Complexity
Shared title terminology · Léo Catteau, O. Duranthon, Lenka Zdeborová
DTS: Delta-Based Tile Scoring for Efficient Long-Context Sparse Attention
Shared title terminology · Emre Uğur, Jiawen Qi, Qinyu Chen
NIMIS: A Structure-Agnostic, Chemically Informed Slot-Attention Framework for Demixing 1D 1H-NMR Mixture Spectra
Shared title terminology · Anna Marija Sumrova, Jonathan M. Goodman
Dimension-Free Buffer Bounds for Compressed-Momentum Error Feedback
Shared title terminology · Alireza Moayedikia