Learned Thresholds Token Merging and Pruning for Vision Transformers

Maxim Bonnaerens, Joni Dambre
7/20/2023
cs.CV

Official code: Mxbonn/ltmp (17 stars, last commit 2024-11-24).

Abstract

Vision transformers have demonstrated remarkable success in a wide range of computer vision tasks over the last years. However, their high computational costs remain a significant barrier to their practical deployment. In particular, the complexity of transformer models is quadratic with respect to the number of input tokens. Therefore techniques that reduce the number of input tokens that need to be processed have been proposed. This paper introduces Learned Thresholds token Merging and Pruning (LTMP), a novel approach that leverages the strengths of both token merging and token pruning. LTMP uses learned threshold masking modules that dynamically determine which tokens to merge and which to prune. We demonstrate our approach with extensive experiments on vision transformers on the ImageNet classification task. Our results demonstrate that LTMP achieves state-of-the-art accuracy across reduction rates while requiring only a single fine-tuning epoch, which is an order of magnitude faster than previous methods. Code is available at https://github.com/Mxbonn/ltmp .

View on arXivView PDF

Code Implementations(1)

Mxbonn/ltmpOfficial100%

Code for Learned Thresholds Token Merging and Pruning for Vision Transformers (LTMP). A technique to reduce the size of Vision Transformers to any desired size with minimal loss of accuracy.

171PythonJul 3, 20231 years ago
computer-visiondeep-learningefficiencypruningtransformer+1 more

Similar Papers

Cite this paper

@article{bonnaerens2023learned,
  title  = {Learned Thresholds Token Merging and Pruning for Vision Transformers},
  author = {Maxim Bonnaerens and Joni Dambre},
  year   = {2023},
  eprint = {2307.10780},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.10780v2}
}

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/2307.10780.svg)](https://codeofpaper.com/paper/2307.10780)

Discussion