无需微调即可无损压缩视觉变压器,显著降低计算量。
Lossless Token Merging Even Without Fine-Tuning in Vision Transformers
- 自适应调整每层相似度阈值,避免不相关图像块合并。
- 在DeiT-T/S上实现30%以上浮点运算减少,精度零下降。
- 适合追求高效推理的模型部署场景,无需额外训练。
尽管视觉变换器(ViTs)已成为计算机视觉的标准架构,但其庞大的规模带来了显著的计算开销。令牌压缩技术受到广泛关注,但通常伴随严重信息损失,需大量额外训练才能达到实用性能。本文提出自适应令牌合并(ATM),一种确保无损合并的方法,在无需微调的情况下仍保持竞争力。ATM通过逐层、逐批动态调整层特定的相似度阈值,防止不同语义的令牌被错误合并。此外,ATM引入新型令牌匹配机制,同时考虑相似性和合并规模,尤其在最后几层最小化每次合并带来的信息损失。我们在多种预训练模型上验证该方法,结果表明ATM不仅超越所有现有无训练方法,甚至优于多数需要训练的方法,且无需额外训练。值得注意的是,无训练的ATM在DeiT-T和DeiT-S模型上实现了超过30%的浮点运算量(FLOPs)减少,而原始准确率未下降。
原文摘要 · Abstract (English)
Although Vision Transformers (ViTs) have become the standard architecture in computer vision, their massive sizes lead to significant computational overhead. Token compression techniques have attracted considerable attention to address this issue, but they often suffer from severe information loss, requiring extensive additional training to achieve practical performance. In this paper, we propose Adaptive Token Merging (ATM), a novel method that ensures lossless token merging, eliminating the need for fine-tuning while maintaining competitive performance. ATM adaptively reduces tokens across layers and batches by carefully adjusting layer-specific similarity thresholds, thereby preventing the undesirable merging of less similar tokens with respect to each layer. Furthermore, ATM introduces a novel token matching technique that considers not only similarity but also merging sizes, particularly for the final layers, to minimize the information loss incurred from each merging operation. We empirically validate our method across a wide range of pretrained models, demonstrating that ATM not only outperforms all existing training-free methods but also surpasses most training-intensive approaches, even without additional training. Remarkably, training-free ATM achieves over a 30% reduction in FLOPs for the DeiT-T and DeiT-S models without any drop in their original accuracy.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。