arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.06798cs.CV
收藏

Token Compensator:无需重新调优即可改变Vision Transformer的推理成本

Token Compensator: Altering Inference Cost of Vision Transformer without Re-Tuning

Peking University(北京大学)

Shibo Jie, Yehui Tang, Jianyuan Guo, Zhi-Hong Deng, Kai Han, Yunhe Wang

AI总结:

针对ViT的token压缩在训练与推理压缩度不匹配时性能骤降的问题,提出含小型插件ToCom的模型算术框架,无需重训即可为下游现成模型带来普遍性能提升,在多基准上验证有效。

摘要:

Token压缩通过减少冗余token的数量(例如剪枝注意力较低的token或合并相似token)来加速Vision Transformer(ViT)的训练和推理。然而,当应用于下游任务时,如果训练阶段和推理阶段的压缩度不匹配,这些方法会出现显著的性能下降,这限制了token压缩在现成预训练模型上的应用。本文提出了一种模型算术框架,用于解耦这两个阶段的压缩度。我们预先在预训练模型上额外执行一个快速的参数高效自蒸馏阶段,以获得一个名为Token Compensator(ToCom,token补偿器)的小型插件,它描述了不同压缩度下模型之间的差距。在推理过程中,ToCom可以直接插入到任何训练与推理压缩度不匹配的下游现成模型中,无需进一步训练即可获得普遍的性能提升。在20多个下游任务上的实验证明了该框架的有效性。在CIFAR100、细粒度视觉分类和VTAB-1k基准上,ToCom可使DeiT-B的平均性能分别最高提升2.3%、1.5%和2.0%。代码:https://github.com/JieShibo/ToCom

英文摘要:

Token compression expedites the training and inference of Vision Transformers (ViTs) by reducing the number of the redundant tokens, e.g., pruning inattentive tokens or merging similar tokens. However, when applied to downstream tasks, these approaches suffer from significant performance drop when the compression degrees are mismatched between training and inference stages, which limits the application of token compression on off-the-shelf trained models. In this paper, we propose a model arithmetic framework to decouple the compression degrees between the two stages. In advance, we additionally perform a fast parameter-efficient self-distillation stage on the pre-trained models to obtain a small plugin, called Token Compensator (ToCom), which describes the gap between models across different compression degrees. During inference, ToCom can be directly inserted into any downstream off-the-shelf models with any mismatched training and inference compression degrees to acquire universal performance improvements without further training. Experiments on over 20 downstream tasks demonstrate the effectiveness of our framework. On CIFAR100, fine-grained visual classification, and VTAB-1k, ToCom can yield up to a maximum improvement of 2.3%, 1.5%, and 2.0% in the average performance of DeiT-B, respectively. Code: https://github.com/JieShibo/ToCom

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

↑