提出训练感知的细粒度稀疏注意力,提升长视频多模态模型效率
OmniSparse: Training-Aware Fine-Grained Sparse Attention for Long-Video MLLMs
- 动态分配查询、键值对与头级别的注意力预算
- 预填充阶段提速2.7倍,解码阶段内存减少2.4倍
- 适合追求高效长视频生成的开发者使用
现有稀疏注意力方法主要在推理阶段通过预设稀疏模式选择关键标记以加速,但难以弥合训练与推理差距,且缺乏在查询、键值对(KV)和头维度上的细粒度选择能力,导致性能不佳和加速有限。本文提出OmniSparse,一种面向长视频多模态大模型的训练感知细粒度稀疏注意力框架,可在训练与推理中协同工作,并实现动态标记预算分配。具体包含三个自适应互补机制:(1) 通过懒惰活跃分类进行查询选择,保留捕捉广泛语义相似性的活跃查询,剔除关注局部上下文且功能冗余的懒惰查询;(2) 头级动态预算分配的键值对选择,基于最平坦头确定共享预算并在所有头间均匀分配,确保注意力召回率;(3) 通过按头级解码查询模式选择性获取视觉键值缓存,降低头级冗余。实验表明,OmniSparse在保持全注意力性能的同时,预填充阶段最高提速2.7倍,解码阶段内存减少2.4倍。
原文摘要 · Abstract (English)
Existing sparse attention methods primarily target inference-time acceleration by selecting critical tokens under predefined sparsity patterns. However, they often fail to bridge the training-inference gap and lack the capacity for fine-grained token selection across multiple dimensions such as queries, key-values (KV), and heads, leading to suboptimal performance and limited acceleration gains. In this paper, we introduce OmniSparse, a training-aware fine-grained sparse attention framework for long-video MLLMs, which operates in both training and inference with dynamic token budget allocation. Specifically, OmniSparse contains three adaptive and complementary mechanisms: (1) query selection via lazy-active classification, retaining active queries that capture broad semantic similarity while discarding most lazy ones that focus on limited local context and exhibit high functional redundancy; (2) KV selection with head-level dynamic budget allocation, where a shared budget is determined based on the flattest head and applied uniformly across all heads to ensure attention recall; and (3) KV cache slimming to reduce head-level redundancy by selectively fetching visual KV cache according to the head-level decoding query pattern. Experimental results show that OmniSparse matches the performance of full attention while achieving up to 2.7x speedup during prefill and 2.4x memory reduction during decoding.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。