SkipViT:通过令牌级跳跃连接加速视觉Transformer
SkipViT: Speeding Up Vision Transformers with a Token-Level Skip Connection
AI总结:
针对视觉Transformer中存在大量无信息令牌导致冗余计算的问题,提出无新增参数的令牌级跳跃连接方法SkipViT,将不重要令牌送入低成本路径,在维持准确率的同时显著提升训练吞吐量。
摘要:
视觉Transformer相比CNN模型计算量更大、对数据需求更高,这是业内公认的事实。ViT等Transformer模型需要所有输入图像令牌来学习令牌间的关联关系。但这些令牌中有很多不具备信息价值,可能包含无关背景、次要景物等冗余信息。这类令牌会被多头自注意力(MHSA)忽略,导致MHSA和前馈网络(FFN)中存在大量冗余的不必要计算。本研究提出一种优化方法:将不重要的令牌分离出来,送入另一条低成本计算路径,以此减少这类令牌之间的无效交互。该方法不会为ViT模型新增任何参数,旨在在训练吞吐量与最终模型Top-1准确率零损失之间找到最优平衡。在华为Ascend910A上从零训练ViT-small的实验结果表明,SkipViT可有效舍弃55%的令牌,同时提升13%以上的训练吞吐量,且分类精度保持在基线模型水平。
英文摘要:
Vision transformers are known to be more computationally and data-intensive than CNN models. These transformer models such as ViT, require all the input image tokens to learn the relationship among them. However, many of these tokens are not informative and may contain irrelevant information such as unrelated background or unimportant scenery. These tokens are overlooked by the multi-head self-attention (MHSA), resulting in many redundant and unnecessary computations in MHSA and the feed-forward network (FFN). In this work, we propose a method to optimize the amount of unnecessary interactions between unimportant tokens by separating and sending them through a different low-cost computational path. Our method does not add any parameters to the ViT model and aims to find the best trade-off between training throughput and achieving a 0% loss in the Top-1 accuracy of the final model. Our experimental results on training ViT-small from scratch show that SkipViT is capable of effectively dropping 55% of the tokens while gaining more than 13% training throughput and maintaining classification accuracy at the level of the baseline model on Huawei Ascend910A.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。