[Paper Review] A Unified Pruning Framework for Vision Transformers
This paper proposes UP-ViTs, a unified structured pruning framework for Vision Transformers and their variants that simultaneously prunes channels across all components—self-attention, feed-forward networks, normalization layers, and convolutional layers—without altering the model architecture. By using an efficient importance scoring module and progressive pruning strategies, UP-ViTs achieves state-of-the-art accuracy on compressed models, such as UP-DeiT-T achieving 75.79% top-1 accuracy on ImageNet with the same FLOPs as vanilla DeiT-T.
Recently, vision transformer (ViT) and its variants have achieved promising performances in various computer vision tasks. Yet the high computational costs and training data requirements of ViTs limit their application in resource-constrained settings. Model compression is an effective method to speed up deep learning models, but the research of compressing ViTs has been less explored. Many previous works concentrate on reducing the number of tokens. However, this line of attack breaks down the spatial structure of ViTs and is hard to be generalized into downstream tasks. In this paper, we design a unified framework for structural pruning of both ViTs and its variants, namely UP-ViTs. Our method focuses on pruning all ViTs components while maintaining the consistency of the model structure. Abundant experimental results show that our method can achieve high accuracy on compressed ViTs and variants, e.g., UP-DeiT-T achieves 75.79% accuracy on ImageNet, which outperforms the vanilla DeiT-T by 3.59% with the same computational cost. UP-PVTv2-B0 improves the accuracy of PVTv2-B0 by 4.83% for ImageNet classification. Meanwhile, UP-ViTs maintains the consistency of the token representation and gains consistent improvements on object detection tasks.
Motivation & Objective
- Address the lack of effective, generalizable pruning methods for Vision Transformers that maintain structural consistency.
- Overcome limitations of token-level pruning, which disrupts spatial structure and harms transferability to downstream tasks.
- Develop a unified framework applicable to both vanilla ViTs and their variants, including models with convolutional or hierarchical designs.
- Enable high-accuracy, low-computation compressed ViTs that generalize well to object detection and other dense prediction tasks.
- Achieve superior performance compared to existing pruning methods by jointly pruning all components while preserving model integrity.
Proposed method
- Design an efficient evaluation module to compute importance scores for each filter in pre-trained ViT components using gradient-based magnitude estimation.
- Apply structured pruning by removing redundant channels across all components—including MHSAs, FFNs, normalization layers, and convolutions—simultaneously and uniformly.
- Propose a novel channel-removal strategy for multi-head self-attention layers that preserves attention head structure and maintains representational consistency.
- Introduce a progressive block pruning method that removes the least important blocks iteratively and replaces them with hybrid blocks to maintain performance.
- Use knowledge distillation during fine-tuning to preserve accuracy after pruning, with a teacher model matching the original architecture.
- Apply a unified pruning pipeline across multiple ViT variants, including DeiT, PVTv2, and Swin Transformer, ensuring architectural consistency post-compression.
Experimental results
Research questions
- RQ1Can a unified pruning framework be designed to simultaneously compress all components of Vision Transformers without altering their structural design?
- RQ2How does structured pruning across all layers (including FFN, MSA, normalization, and convolutions) affect accuracy and inference efficiency compared to token-level pruning?
- RQ3Does maintaining the original token representation during pruning improve transferability to downstream tasks like object detection?
- RQ4What is the relative effectiveness of one-time versus progressive pruning strategies in compressing ViT width and depth?
- RQ5Can the pruned models generalize better than existing state-of-the-art compressed ViTs across diverse architectures and tasks?
Key findings
- UP-DeiT-T achieves 75.79% top-1 accuracy on ImageNet, outperforming the original DeiT-T by 3.59% at the same FLOPs.
- UP-PVTv2-B0 improves accuracy by 4.83% over the original PVTv2-B0 on ImageNet classification under identical computational costs.
- Progressive block pruning yields higher accuracy (73.78%) than one-time block removal (73.20%) when compressing UP-DeiT-T to 10 blocks.
- One-time pruning of component 1 (width) achieves 66.95% accuracy, outperforming progressive pruning (65.05%) on the same task.
- The pruned UP-ViTs models maintain consistent performance gains across downstream tasks, including object detection, due to preserved token representation.
- The framework generalizes effectively across ViT variants, including DeiT, PVTv2, and Swin Transformer, demonstrating broad applicability and robustness.
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.