Width & Depth Pruning for Vision Transformers
Fang Yu, Kun Huang, Meng Wang, Yuan Cheng, Wei Chu, Li Cui
Abstract
Transformer models have demonstrated their promising potential and achieved excellent performance on a series of computer vision tasks. However, the huge computational cost of vision transformers hinders their deployment and application to edge devices. Recent works have proposed to find and remove the unimportant units of vision transformers. Despite achieving remarkable results, these methods take one dimension of network width into consideration and ignore network depth, which is another important dimension for pruning vision transformers. Therefore, we propose a Width & Depth Pruning (WDPruning) framework that reduces both width and depth dimensions simultaneously. Specifically, for width pruning, a set of learnable pruning-related parameters is used to adaptively adjust the width of transformer. For depth pruning, we introduce several shallow classifiers by using the intermediate information of the transformer blocks, which allows images to be classified by shallow classifiers instead of the deeper classifiers. In the inference period, all of the blocks after shallow classifiers can be dropped so they don't bring additional parameters and computation. Experimental results on benchmark datasets demonstrate that the proposed method can significantly reduce the computational costs of mainstream vision transformers such as DeiT and Swin Transformer with a minor accuracy drop. In particular, on ILSVRC-12, we achieve over 22% pruning ratio of FLOPs by compressing DeiT-Base, even with an increase of 0.14% Top-1 accuracy.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b6cce5ce-be47-424a-b507-c29cb8dba8f2Cited by top-tier papers33
- Deep Compression of Pre-trained Transformer ModelsNaigang Wang, Chi-Chun (Charlie) Liu, Swagath Venkataramani, Sanchari Sen et al.NeurIPS 2022 · 38 citations
- PuMer: Pruning and Merging Tokens for Efficient Vision Language ModelsQingqing Cao, Bhargavi Paranjape, Hannaneh HajishirziACL 2023 · 23 citations
- UPDP: A Unified Progressive Depth Pruner for CNN and Vision TransformerJi Liu, Dehua Tang, Yuanxian Huang, Li Zhang et al.AAAI 2024 · 18 citations
- The Need for Speed: Pruning Transformers with One RecipeSamir Khaki, Konstantinos N. PlataniotisICLR 2024 · 17 citations
- MoE Jetpack: From Dense Checkpoints to Adaptive Mixture of Experts for Vision TasksXingkui Zhu, Yiran Guan, Dingkang Liang, Yuchao Chen et al.NeurIPS 2024 · 15 citations
Builds on14
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
- Deformable DETR: Deformable Transformers for End-to-End Object DetectionXizhou Zhu, Weijie Su, Lewei Lu, Bin Li et al.ICLR 2021 · 7,353 citations
- CutMix: Regularization Strategy to Train Strong Classifiers With Localizable FeaturesSangdoo Yun, Dongyoon Han, Sanghyuk Chun, Seong Joon Oh et al.ICCV 2019 · 5,843 citations
Related papers
- X-Pruner: eXplainable Pruning for Vision TransformersLu Yu, Wei XiangCVPR 2023
- Rethinking Depth Pruning for Vision Transformers: A Heterogeneity-Aware PerspectiveZhenfeng Su, Kang Zhao, Han Bao, Tao Yuan et al.ICML 2026
- Global Vision Transformer Pruning with Hessian-Aware SaliencyHuanrui Yang, Hongxu Yin, Maying Shen, Pavlo Molchanov et al.CVPR 2023
- MiniViT: Compressing Vision Transformers with Weight MultiplexingJinnian Zhang, Houwen Peng, Kan Wu, Mengchen Liu et al.CVPR 2022 · 115 citations
- Unified Visual Transformer CompressionShixing Yu, Tianlong Chen, Jiayi Shen, Huan Yuan et al.ICLR 2022 · 118 citations
