arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2209.13802cs.CV

自适应稀疏ViT:通过充分利用自注意力实现可学习的自适应令牌剪枝

Adaptive Sparse ViT: Towards Learnable Adaptive Token Pruning by Fully Exploiting Self-Attention

Peking University(北京大学);Baidu Research(百度研究院)

Xiangcheng Liu, Tianyi Wu, Guodong Guo

AI总结:

本文提出自适应稀疏ViT框架,利用注意力头重要性加权评分与可学习阈值实现分层令牌剪枝,在DeiT-S上吞吐量提升50%且准确率仅下降0.2%。

摘要:

视觉Transformer已成为计算机视觉领域的一种新范式,在表现出卓越性能的同时也伴随着高昂的计算成本。图像令牌剪枝是ViT压缩的主要方法之一,其原因在于:复杂度与令牌数量呈二次方关系,且许多仅包含背景区域的令牌对最终预测并没有真正的贡献。现有工作要么依赖额外模块来评估单个令牌的重要性,要么对不同输入实例采用固定比例的剪枝策略。在本工作中,我们提出了一种以最小代价实现的自适应稀疏令牌剪枝框架。具体而言,我们首先提出了一种低开销的注意力头重要性加权类别注意力评分机制。然后,插入可学习参数作为阈值,以区分信息性令牌与不重要令牌。通过比较令牌注意力分数与阈值,我们可以分层地丢弃无用令牌,从而加速推理。可学习阈值在预算感知训练中得到优化,以平衡准确率与复杂度,并为不同输入实例执行相应的剪枝配置。大量实验证明了我们方法的有效性。我们的方法将DeiT-S的吞吐量提升了50%,而top-1准确率仅下降0.2%,在准确率与延迟之间取得了比先前方法更好的权衡。

英文摘要:

Vision transformer has emerged as a new paradigm in computer vision, showing excellent performance while accompanied by expensive computational cost. Image token pruning is one of the main approaches for ViT compression, due to the facts that the complexity is quadratic with respect to the token number, and many tokens containing only background regions do not truly contribute to the final prediction. Existing works either rely on additional modules to score the importance of individual tokens, or implement a fixed ratio pruning strategy for different input instances. In this work, we propose an adaptive sparse token pruning framework with a minimal cost. Specifically, we firstly propose an inexpensive attention head importance weighted class attention scoring mechanism. Then, learnable parameters are inserted as thresholds to distinguish informative tokens from unimportant ones. By comparing token attention scores and thresholds, we can discard useless tokens hierarchically and thus accelerate inference. The learnable thresholds are optimized in budget-aware training to balance accuracy and complexity, performing the corresponding pruning configurations for different input instances. Extensive experiments demonstrate the effectiveness of our approach. Our method improves the throughput of DeiT-S by 50% and brings only 0.2% drop in top-1 accuracy, which achieves a better trade-off between accuracy and latency than the previous methods.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑