Skip to main content
QUICK REVIEW

[Paper Review] Unified Visual Transformer Compression

Shixing Yu, Tianlong Chen|arXiv (Cornell University)|Mar 15, 2022
Advanced Neural Network ApplicationsComputer Science28 citations
TL;DR

UVC jointly optimizes pruning, block skipping, and knowledge distillation in ViTs under a budget, achieving substantial FLOPs reduction with minimal accuracy loss on ImageNet across DeiT and T2T-ViT backbones.

ABSTRACT

Vision transformers (ViTs) have gained popularity recently. Even without customized image operators such as convolutions, ViTs can yield competitive performance when properly trained on massive data. However, the computational overhead of ViTs remains prohibitive, due to stacking multi-head self-attention modules and else. Compared to the vast literature and prevailing success in compressing convolutional neural networks, the study of Vision Transformer compression has also just emerged, and existing works focused on one or two aspects of compression. This paper proposes a unified ViT compression framework that seamlessly assembles three effective techniques: pruning, layer skipping, and knowledge distillation. We formulate a budget-constrained, end-to-end optimization framework, targeting jointly learning model weights, layer-wise pruning ratios/masks, and skip configurations, under a distillation loss. The optimization problem is then solved using the primal-dual algorithm. Experiments are conducted with several ViT variants, e.g. DeiT and T2T-ViT backbones on the ImageNet dataset, and our approach consistently outperforms recent competitors. For example, DeiT-Tiny can be trimmed down to 50\% of the original FLOPs almost without losing accuracy. Codes are available online:~\url{https://github.com/VITA-Group/UVC}.

Motivation & Objective

  • Motivate efficient deployment of vision transformers by reducing computational cost without sacrificing accuracy.
  • Propose a unified framework that combines multiple compression techniques in a single end-to-end optimization.
  • Enable automatic balancing of pruning, skipping, and distillation under a global resource budget.
  • Evaluate UVC on popular ViT variants (DeiT and T2T-ViT) on ImageNet and compare with state-of-the-art pruning methods.

Proposed method

  • Formulate ViT compression as a constrained end-to-end optimization problem.
  • Jointly learn network weights, layer-wise pruning masks/ratios, and skip configurations with distillation loss.
  • Use two-level group sparsity to prune attention heads and MLP neurons within each transformer block.
  • Introduce binary gating variables for skip configuration across transformer blocks to enable block dropping.
  • Solve the mini-max optimization via a primal-dual algorithm.
  • Provide a reference implementation and experimental results on DeiT and T2T-ViT backbones.

Experimental results

Research questions

  • RQ1Can pruning within ViT blocks and across blocks via skip configurations be optimized jointly under a resource budget?
  • RQ2Does integrating pruning, skipping, and knowledge distillation outperform single-method ViT compression?
  • RQ3What are the accuracy/latency trade-offs achievable for DeiT and T2T-ViT at various FLOPs budgets?
  • RQ4How does UVC compare with existing patch-reduction and pruning methods on ImageNet?

Key findings

  • UVC can reduce FLOPs by around 50% for DeiT-Tiny with minimal accuracy loss (0.3%/0.9% under distillation/no distillation settings).
  • UVC outperforms several modern ViT compression methods (e.g., SViTE, PatchSlimming, HVT, IA-RED 2) in terms of accuracy at similar or greater FLOPs reductions.
  • For DeiT-Base, UVC achieves ~45% FLOPs reduction with acceptable accuracy drop, delivering competitive results where some baselines struggle to train stably.
  • When applied to T2T-ViT-14, UVC achieves substantial FLOPs savings (e.g., 44–60% range) with modest accuracy degradation, surpassing some patch-based reductions.
  • Ablation shows jointly optimizing skip, pruning, and distillation yields better trade-offs than any single component or sequential application.
  • Code for UVC is publicly available.
  • (Notes from the text) UVC demonstrates strong performance across multiple ViT variants on ImageNet.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.