不依赖数据和输入,通过查询键几何自动区分大模型的检索与流式注意力头。
Autonomy-of-Heads: Data-Free Sparse Attention from Frozen Query-Key Geometry

- 基于查询键投影的谱几何特性,无需运行时计算直接判断注意力头功能。
- 50%稀疏度下平均保留96.5%全注意力性能,推理延迟降低超40%。
- 适合长文本生成、低延迟部署场景,尤其适用于资源受限设备。
长上下文大模型推理受限于二次复杂度的注意力计算和不断增长的键值缓存开销。现有稀疏注意力与键值压缩方法通常依赖运行时注意力分数、观察窗口、校准提示或学习门控来决定保留哪些标记或注意力头,导致头部诊断依赖输入且部署成本高。本文提出无数据稀疏注意力方法——自主注意力头(Autonomy-of-Heads, AoH),通过查询键投影的谱几何特性识别检索头与流式头。AoH定义核注意力算子 $M_h = W_K^{h op}W_Q^h$,并以有效秩作为头功能的权重空间度量:谱集中表示少数主导的查询-键匹配方向,对应检索头;谱分散则无主导全局匹配方向,对应流式头。进一步设计 $d_ ext{head}$ 维高效计算,避免构建完整的 $d_ ext{model} imes d_ ext{model}$ 矩阵。在多模型上广泛实验表明,在50%稀疏度下,AoH平均保持96.5%全注意力性能,预填充与解码延迟分别降低最多41.4%和66.0%,在256K token长度下键值缓存内存减少50.0%。
原文摘要 · Abstract (English)
Long-context LLM inference is bottlenecked by quadratic attention computation and growing KV-cache costs. Existing sparse attention and KV-compression methods typically decide which tokens or heads to preserve from runtime attention scores, observation windows, calibration prompts, or learned gates, making head diagnosis input-dependent and costly to deploy. We propose Autonomy-of-Heads (AoH), a data-free method that identifies retrieval and streaming heads from the spectral geometry of query-key projections. AoH defines the kernel attention operator $M_h = W_K^{h\top}W_Q^h$ and uses its effective-rank as a weight-space measure of head function: concentrated spectra indicate a small number of dominant query-key matching directions and are associated with retrieval heads, whereas diffuse spectra indicate the absence of a dominant global matching direction and are associated with streaming heads. We further derive an efficient $d_\text{head}$-dimensional computation that avoids constructing the full $d_\text{model}\times d_\text{model}$ matrix. We conducted extensive experiments across models demonstrating that at 50\% sparsity, AoH retains 96.5\% of Full Attention performance on average while reducing prefill and decode latency by up to 41.4\% and 66.0\%, respectively, and KV-cache memory by 50.0\% at 256K tokens.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。