vAttention首次实现可验证的稀疏注意力,保证精度与效率双优。
vAttention: Verified Sparse Attention
- 融合top-k与采样,动态选择最优策略
- 在Llama 3.1上提升4.5个百分点,20倍稀疏下媲美全注意力
- 适合需要高可靠性的推理场景,如长文本生成
当前主流稀疏注意力方法分为近似top-k(及扩展top-p)与基于采样的估计两类,但均无法提供一致的近似效果,且缺乏精度保障,限制实际部署。本文观察到top-k在注意力得分集中时表现佳,而随机采样在得分均匀时更优。基于此,提出vAttention,首个具备用户指定(ε, δ)精度保障的实用稀疏注意力机制。通过统一两种策略,vAttention在质量-效率权衡上优于单独使用任一方法。实验表明,在Llama 3.1 8B Instruct和DeepSeek-R1-Distill-Llama-8B上,其性能较原有方法提升约4.5个百分点;在不同数据集上,可达20倍稀疏下匹配全注意力模型质量。此外,其可在推理任务中实现高速解码,如在AIME2024上以10倍稀疏达到全模型质量,并支持高达32K token生成。
原文摘要 · Abstract (English)
State-of-the-art sparse attention methods for reducing decoding latency fall into two main categories: approximate top-$k$ (and its extension, top-$p$) and recently introduced sampling-based estimation. However, these approaches are fundamentally limited in their ability to approximate full attention: they fail to provide consistent approximations across heads and query vectors and, most critically, lack guarantees on approximation quality, limiting their practical deployment. We observe that top-$k$ and random sampling are complementary: top-$k$ performs well when attention scores are dominated by a few tokens, whereas random sampling provides better estimates when attention scores are relatively uniform. Building on this insight and leveraging the statistical guarantees of sampling, we introduce vAttention, the first practical sparse attention mechanism with user-specified $(ε, δ)$ guarantees on approximation accuracy (thus, "verified"). These guarantees make vAttention a compelling step toward practical, reliable deployment of sparse attention at scale. By unifying top-$k$ and sampling, vAttention outperforms both individually, delivering a superior quality-efficiency trade-off. Our experiments show that vAttention significantly improves the quality of sparse attention (e.g., $\sim$4.5 percentage points for Llama 3.1 8B Instruct and DeepSeek-R1-Distill-Llama-8B on RULER-HARD), and effectively bridges the gap between full and sparse attention (e.g., across datasets, it matches full model quality with up to 20x sparsity). We also demonstrate that it can be deployed in reasoning scenarios to achieve fast decoding without compromising model quality (e.g., vAttention achieves full model quality on AIME2024 at 10x sparsity with up to 32K token generations). Code: https://github.com/skylight-org/sparse-attention-hub. Webpage: https://sky-light.eecs.berkeley.edu.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。