Attention is sparse in vision transformers. We observe the final prediction in vision transformers is only based on a subset of most informative tokens, which is sufficient for accurate image recognition. Based on this observation, we propose a dynamic token sparsification framework to prune redundant tokens progressively and dynamically based on the input. Specifically, we devise a lightweight prediction module to estimate the importance score of each token given the current features. The module is added to different layers to prune redundant tokens hierarchically. To optimize the prediction module in an end-to-end manner, we propose an attention masking strategy to differentiably prune a token by blocking its interactions with other tokens. Benefiting from the nature of self-attention, the unstructured sparse tokens are still hardware friendly, which makes our framework easy to achieve actual speed-up. By hierarchically pruning 66% of the input tokens, our method greatly reduces 31%~37% FLOPs and improves the throughput by over 40% while the drop of accuracy is within 0.5% for various vision transformers. Equipped with the dynamic token sparsification framework, DynamicViT models can achieve very competitive complexity/accuracy trade-offs compared to state-of-the-art CNNs and vision transformers on ImageNet. Code is available at https://github.com/raoyongming/DynamicViT


翻译:在视觉变压器中,人们很少注意。 我们观察视觉变压器中的最后预测仅仅基于一组信息最丰富的象征物, 这足以准确的图像识别。 基于此观察, 我们提议一个动态的象征质升级框架, 逐步和以输入为基础动态地处理多余的象征物。 具体地说, 我们设计了一个轻量的预测模块, 以根据当前特性来估计每个象征物的重要性分数。 该模块被添加到不同的层中, 将多余的象征物按等级排列。 为了以端对端的方式优化预测模块, 我们建议通过屏蔽其与其他象征物的相互作用, 以不同方式淡化一个象征物。 从自我注意的性质出发, 无结构的稀有象征物仍然对硬件友好。 这样, 我们的框架很容易实现实际的加速。 通过分级调整66%的输入物代号, 我们的方法大大降低了31%-37%的FLOPs, 将吞吐量提高40%以上, 而对于各种视觉变压器来说, 精确性下降为0.5 % 。 在动态的调控压D- 变压框架中, 变压/ 变压/ 变压式 变压/ 变压 变压 变压 变压 变压 变压 变压式 变压 变压 变压 变压 变压 变压 变压 变压 变压 变压 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变 变

0
下载
关闭预览

相关内容

专知会员服务
90+阅读 · 2021年6月29日
专知会员服务
45+阅读 · 2021年6月1日
最新《Transformers模型》教程,64页ppt
专知会员服务
320+阅读 · 2020年11月26日
【干货书】机器学习速查手册,135页pdf
专知会员服务
127+阅读 · 2020年11月20日
专知会员服务
110+阅读 · 2020年3月12日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
CVPR2019年热门论文及开源代码分享
深度学习与NLP
7+阅读 · 2019年6月3日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
ICLR2019最佳论文出炉
专知
12+阅读 · 2019年5月6日
计算机视觉领域顶会CVPR 2018 接受论文列表
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
【推荐】直接未来预测:增强学习监督学习
机器学习研究会
6+阅读 · 2017年11月24日
Arxiv
19+阅读 · 2020年12月23日
Arxiv
8+阅读 · 2020年10月9日
Arxiv
23+阅读 · 2020年9月16日
Arxiv
6+阅读 · 2019年7月11日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
VIP会员
相关VIP内容
专知会员服务
90+阅读 · 2021年6月29日
专知会员服务
45+阅读 · 2021年6月1日
最新《Transformers模型》教程,64页ppt
专知会员服务
320+阅读 · 2020年11月26日
【干货书】机器学习速查手册,135页pdf
专知会员服务
127+阅读 · 2020年11月20日
专知会员服务
110+阅读 · 2020年3月12日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
相关资讯
RoBERTa中文预训练模型:RoBERTa for Chinese
PaperWeekly
57+阅读 · 2019年9月16日
CVPR2019年热门论文及开源代码分享
深度学习与NLP
7+阅读 · 2019年6月3日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
ICLR2019最佳论文出炉
专知
12+阅读 · 2019年5月6日
计算机视觉领域顶会CVPR 2018 接受论文列表
Hierarchical Imitation - Reinforcement Learning
CreateAMind
19+阅读 · 2018年5月25日
计算机视觉近一年进展综述
机器学习研究会
9+阅读 · 2017年11月25日
【推荐】直接未来预测:增强学习监督学习
机器学习研究会
6+阅读 · 2017年11月24日
相关论文
Arxiv
19+阅读 · 2020年12月23日
Arxiv
8+阅读 · 2020年10月9日
Arxiv
23+阅读 · 2020年9月16日
Arxiv
6+阅读 · 2019年7月11日
The Evolved Transformer
Arxiv
5+阅读 · 2019年1月30日
Top
微信扫码咨询专知VIP会员