通过动态分析注意力机制,提前剔除冗余视觉标记,提升ViT效率。
SPOT: Sparsification with Attention Dynamics via Token Relevance in Vision Transformers
- 基于标记嵌入与多层注意力动态,实时评估标记重要性
- 相比标准ViT,计算效率最高提升40%且精度不降反升
- 轻量级模块可适配多种ViT架构,适合资源受限场景
尽管视觉变换器(ViT)在各类任务中表现优异,但其计算开销随处理标记数呈平方增长。紧凑的注意力表征能反映标记间交互分布,有助于在注意力计算前识别并削减不显著的标记。受此启发,我们提出一种名为SPOT(基于标记相关性的注意力动态稀疏化)的框架,通过融合标记嵌入、交互关系及跨层注意力动态来推断标记重要性,实现更上下文感知且可解释的相关性检测。该方法指导标记稀疏化,有效消除冗余标记,提升计算效率而不损失性能。SPOT采用轻量级预测器,可无缝集成至多种ViT架构,学习生成跨层输入相关的标记优先级。其灵活设计支持不同性能层级,适应多样资源约束。实证表明,与标准ViT相比,效率提升最高达40%,同时保持或提升准确率。代码与模型已开源:https://github.com/odedsc/SPOT。
原文摘要 · Abstract (English)
While Vision Transformers (ViT) have demonstrated remarkable performance across diverse tasks, their computational demands are substantial, scaling quadratically with the number of processed tokens. Compact attention representations, reflecting token interaction distributions, can guide early detection and reduction of less salient tokens prior to attention computation. Motivated by this, we present SParsification with attentiOn dynamics via Token relevance (SPOT), a framework for early detection of redundant tokens within ViTs that leverages token embeddings, interactions, and attention dynamics across layers to infer token importance, resulting in a more context-aware and interpretable relevance detection process. SPOT informs token sparsification and facilitates the elimination of such tokens, improving computational efficiency without sacrificing performance. SPOT employs computationally lightweight predictors that can be plugged into various ViT architectures and learn to derive effective input-specific token prioritization across layers. Its versatile design supports a range of performance levels adaptable to varying resource constraints. Empirical evaluations demonstrate significant efficiency gains of up to 40% compared to standard ViTs, while maintaining or even improving accuracy. Code and models are available at https://github.com/odedsc/SPOT .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。