[Paper Review] Patch Slimming for Efficient Vision Transformers
This paper proposes Patch Slimming, a top-down pruning method for Vision Transformers that removes redundant patches based on their impact on final classification features. By estimating each patch's contribution to the class token and preserving only the most influential ones, the method reduces FLOPs by over 45% in ViT-Tiny with only a 0.2% accuracy drop on ImageNet.
This paper studies the efficiency problem for visual transformers by excavating redundant calculation in given networks. The recent transformer architecture has demonstrated its effectiveness for achieving excellent performance on a series of computer vision tasks. However, similar to that of convolutional neural networks, the huge computational cost of vision transformers is still a severe issue. Considering that the attention mechanism aggregates different patches layer-by-layer, we present a novel patch slimming approach that discards useless patches in a top-down paradigm. We first identify the effective patches in the last layer and then use them to guide the patch selection process of previous layers. For each layer, the impact of a patch on the final output feature is approximated and patches with less impact will be removed. Experimental results on benchmark datasets demonstrate that the proposed method can significantly reduce the computational costs of vision transformers without affecting their performances. For example, over 45% FLOPs of the ViT-Ti model can be reduced with only 0.2% top-1 accuracy drop on the ImageNet dataset.
Motivation & Objective
- Address the high computational cost of Vision Transformers, which limits deployment on resource-constrained devices.
- Identify and remove redundant patches across layers, as opposed to pruning channels as in CNNs.
- Develop a structured pruning strategy that maintains model performance while accelerating inference.
- Enable efficient deployment of Vision Transformers through a principled, error-controlled patch removal process.
- Demonstrate that deeper layers contain significantly more patch-level redundancy than shallower layers.
Proposed method
- Propose a top-down pruning framework that starts from the final layer and works backward through the network.
- Estimate the importance of each patch by measuring its impact on the final output feature (class token) using error backpropagation.
- Use a global tolerant error threshold ε to control the trade-off between FLOPs reduction and accuracy loss.
- Preserve a patch if any of its spatial counterparts in deeper layers are retained, ensuring information flow is maintained.
- Apply a differentiable, gradient-based score to rank patches by their contribution to the final prediction.
- Use a reconstruction error approximation to estimate the significance of each patch without full fine-tuning.
Experimental results
Research questions
- RQ1Can patch-level redundancy in Vision Transformers be effectively identified and removed without significant performance drop?
- RQ2How does the redundancy of patches vary across different layers in a Vision Transformer?
- RQ3Can a top-down pruning strategy preserve model performance while reducing FLOPs more effectively than uniform or random pruning?
- RQ4What is the optimal trade-off between FLOPs reduction and accuracy loss when pruning patches?
- RQ5How does the proposed impact estimation method compare to attention-based or random pruning in terms of preserving model utility?
Key findings
- The proposed Patch Slimming method reduces FLOPs by 45.2% in the ViT-Tiny model with only a 0.2% drop in top-1 accuracy on ImageNet.
- DeiT-S achieves a 45.8% FLOPs reduction with a 0.2% accuracy drop, outperforming uniform pruning (77.2% top-1 accuracy, -2.6% drop).
- Deeper layers exhibit significantly higher patch redundancy than shallower layers, justifying the top-down pruning strategy.
- The proposed impact estimation method results in lower accuracy loss than random or attention-based pruning baselines at the same pruning rate.
- The pruned model develops a pyramid-like architecture, with more patches preserved in shallow layers and more removed in deeper layers.
- The method maintains high performance even at high pruning rates, with less than 0.4% accuracy drop when FLOPs reduction is below 45%.
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.