[论文解读] Evo-ViT: Slow-Fast Token Evolution for Dynamic Vision Transformer
Evo-ViT 提出了一种自激励的慢-快标记演化方法,用于动态视觉变压器,通过原生全局分类注意力实现非结构化、实例级的标记选择,同时通过双计算路径保持空间结构。该方法在 ImageNet-1K 上仅导致 0.4% 的 top-1 准确率下降,将 DeiT-S 的推理速度提升 60% 以上,优于现有剪枝方法在效率和准确率保持方面的表现。
Vision transformers (ViTs) have recently received explosive popularity, but the huge computational cost is still a severe issue. Since the computation complexity of ViT is quadratic with respect to the input sequence length, a mainstream paradigm for computation reduction is to reduce the number of tokens. Existing designs include structured spatial compression that uses a progressive shrinking pyramid to reduce the computations of large feature maps, and unstructured token pruning that dynamically drops redundant tokens. However, the limitation of existing token pruning lies in two folds: 1) the incomplete spatial structure caused by pruning is not compatible with structured spatial compression that is commonly used in modern deep-narrow transformers; 2) it usually requires a time-consuming pre-training procedure. To tackle the limitations and expand the applicable scenario of token pruning, we present Evo-ViT, a self-motivated slow-fast token evolution approach for vision transformers. Specifically, we conduct unstructured instance-wise token selection by taking advantage of the simple and effective global class attention that is native to vision transformers. Then, we propose to update the selected informative tokens and uninformative tokens with different computation paths, namely, slow-fast updating. Since slow-fast updating mechanism maintains the spatial structure and information flow, Evo-ViT can accelerate vanilla transformers of both flat and deep-narrow structures from the very beginning of the training process. Experimental results demonstrate that our method significantly reduces the computational cost of vision transformers while maintaining comparable performance on image classification.
研究动机与目标
- 为解决视觉变压器因序列长度呈二次方增长而导致的计算效率低下问题。
- 克服现有标记剪枝方法破坏空间结构且需要微调预训练模型的局限性。
- 在平面结构和深而窄的变压器架构中,从零开始实现高效、动态的标记选择。
- 在计算量减少过程中保持信息流动和空间一致性。
- 开发一种可插拔的解决方案,与诸如深而窄 ViT 中的结构化压缩方法兼容。
提出的方法
- 利用最后一层的全局分类注意力,为每个输入实例动态识别出有信息量的标记和占位符标记。
- 引入慢-快更新机制:有信息量的标记通过完整的计算路径处理,而占位符标记则使用轻量级路径。
- 通过不移除标记而是利用双路径重新加权其贡献,从而保持完整的空间结构和信息流动。
- 采用层到阶段的训练策略,逐步稳定深层网络中的标记选择。
- 在各层中保持一致的标记保留比例,最优性能在统一比例下实现(例如所有层均为 50%)。
- 使用深层网络中分类标记的注意力分数作为动态、数据依赖的标记选择标准。
实验结果
研究问题
- RQ1是否能够从零开始在视觉变压器中有效应用非结构化标记选择,而不会破坏空间结构?
- RQ2如何在不依赖微调或固定剪枝掩码的情况下,实现无需预训练的动态、实例级标记选择?
- RQ3双路径(慢-快)更新机制是否能在平面结构和深而窄的 ViT 架构中,同时保持性能并减少计算量?
- RQ4为最大化效率和准确率,各层之间最优的标记保留比例策略是什么?
- RQ5在轻量级路径中持续更新占位符标记,与剪枝方法相比,是否能保持甚至提升模型性能?
主要发现
- Evo-ViT 在 ImageNet-1K 上将 DeiT-S 的吞吐量提升 60% 以上,仅导致 0.4% 的 top-1 准确率下降,优于现有剪枝方法。
- 该方法在多种 ViT 架构(包括 DeiT 和 LeViT)中均表现出一致的性能,展现出广泛的适用性。
- 在所有层中采用一致的标记保留比例可获得最佳性能,因为它最大限度地提高了通过完整网络处理的有信息量标记数量。
- 标记选择在训练过程中逐步演化:初期不稳定,随时间推移逐渐稳定,有信息量的标记(如鱼尾或蝙蝠部分)在深层网络中被逐步选中。
- 可视化结果表明,该方法聚焦于物体而非背景,且由于结构保持设计,深层网络中能检索到被遗漏的标记。
- 来自深层网络(如第 10 层)的全局分类注意力提供了比仅最后一层或列平均注意力策略更有效、更稳定的标记选择信号。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。