[Paper Review] ATS: Adaptive Token Sampling For Efficient Vision Transformers
This paper proposes Adaptive Token Sampling (ATS), a parameter-free, differentiable module that dynamically reduces the number of tokens in vision transformers based on input image complexity. By scoring and sampling significant tokens per image, ATS reduces GFLOPs by 37% on ImageNet while preserving accuracy, enabling plug-and-play efficiency gains for existing models.
While state-of-the-art vision transformer models achieve promising results for image classification, they are computationally very expensive and require many GFLOPs. Although the GFLOPs of a vision transformer can be decreased by reducing the number of tokens in the network, there is no setting that is optimal for all input images. In this work, we, therefore, introduce a differentiable parameter-free Adaptive Token Sampling (ATS) module, which can be plugged into any existing vision transformer architecture. ATS empowers vision transformers by scoring and adaptively sampling significant tokens. As a result, the number of tokens is not anymore static but it varies for each input image. By integrating ATS as an additional layer within current transformer blocks, we can convert them into much more efficient vision transformers with an adaptive number of tokens. Since ATS is a parameter-free module, it can be added to off-the-shelf pretrained vision transformers as a plug-and-play module, thus reducing their GFLOPs without any additional training. However, due to its differentiable design, one can also train a vision transformer equipped with ATS. We evaluate our module on the ImageNet dataset by adding it to multiple state-of-the-art vision transformers. Our evaluations show that the proposed module improves the state-of-the-art by reducing the computational cost (GFLOPs) by 37% while preserving the accuracy.
Motivation & Objective
- To address the high computational cost of vision transformers, which require many GFLOPs for inference.
- To overcome the limitation of fixed token counts in vision transformers, which are suboptimal for diverse input images.
- To develop a parameter-free, differentiable module that enables adaptive token reduction per input image.
- To allow integration into existing vision transformers without retraining, while still supporting end-to-end fine-tuning.
- To achieve significant computational efficiency gains without sacrificing classification accuracy.
Proposed method
- ATS introduces a differentiable scoring mechanism to rank the importance of tokens in the class token's attention map.
- The module adaptively samples only the most significant tokens based on their scores, reducing the total number of tokens per image.
- ATS is inserted as an additional layer within standard transformer blocks, replacing the fixed token processing pipeline.
- The module is parameter-free, enabling direct deployment on pretrained vision transformers without fine-tuning.
- Due to its differentiable nature, ATS supports end-to-end training when desired, allowing optimization of token sampling.
- The method is compatible with any vision transformer architecture and can be applied as a plug-and-play module.
Experimental results
Research questions
- RQ1Can a parameter-free, differentiable module dynamically reduce the number of tokens in vision transformers based on input image complexity?
- RQ2Does adaptive token sampling lead to significant computational savings without accuracy degradation?
- RQ3Can the proposed module be deployed on existing pretrained vision transformers without retraining?
- RQ4How does the performance of vision transformers with ATS compare to their original counterparts in terms of GFLOPs and accuracy?
- RQ5Can end-to-end training of the full model with ATS further improve efficiency and accuracy?
Key findings
- ATS reduces the computational cost of vision transformers by 37% in terms of GFLOPs on the ImageNet dataset.
- The accuracy of vision transformers equipped with ATS remains unchanged compared to their original counterparts.
- The module can be directly applied as a plug-and-play component to existing pretrained vision transformers without any additional training.
- The differentiable design of ATS allows for end-to-end fine-tuning, enabling further optimization of the sampling process.
- The adaptive token sampling mechanism successfully identifies and retains only the most informative tokens per image, improving efficiency.
- The method maintains state-of-the-art performance while significantly reducing inference complexity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.