Training-Free Acceleration of ViTs with Delayed Spatial Merging

Jung Hwan Heo, Seyedarmin Azizi, Arash Fayyazi, Massoud Pedram
3/4/2023
cs.CVcs.AIcs.LG

No official code found. Best implementation: johnheo/fast-compress-vit (5 stars, MIT, last commit 2023-03-10).

Abstract

Token merging has emerged as a new paradigm that can accelerate the inference of Vision Transformers (ViTs) without any retraining or fine-tuning. To push the frontier of training-free acceleration in ViTs, we improve token merging by adding the perspectives of 1) activation outliers and 2) hierarchical representations. Through a careful analysis of the attention behavior in ViTs, we characterize a delayed onset of the convergent attention phenomenon, which makes token merging undesirable in the bottom blocks of ViTs. Moreover, we augment token merging with a hierarchical processing scheme to capture multi-scale redundancy between visual tokens. Combining these two insights, we build a unified inference framework called DSM: Delayed Spatial Merging. We extensively evaluate DSM on various ViT model scales (Tiny to Huge) and tasks (ImageNet-1k and transfer learning), achieving up to 1.8$\times$ FLOP reduction and 1.6$\times$ throughput speedup at a negligible loss while being two orders of magnitude faster than existing methods.

View on arXivView PDF

Code Implementations(1)

MIT

Official Pytorch Implementation of "A Fast Training-free Compression Framework for Vision Transformers"

50Mar 2, 20233 years agoMIT

Similar Papers

Cite this paper

@article{heo2023trainingfree,
  title  = {Training-Free Acceleration of ViTs with Delayed Spatial Merging},
  author = {Jung Hwan Heo and Seyedarmin Azizi and Arash Fayyazi and Massoud Pedram},
  year   = {2023},
  eprint = {2303.02331},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.02331v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.02331.svg)](https://codeofpaper.com/paper/2303.02331)

Discussion