English

Learning to Merge Tokens in Vision Transformers

Computer Vision and Pattern Recognition 2022-02-25 v1 Machine Learning

Abstract

Transformers are widely applied to solve natural language understanding and computer vision tasks. While scaling up these architectures leads to improved performance, it often comes at the expense of much higher computational costs. In order for large-scale models to remain practical in real-world systems, there is a need for reducing their computational overhead. In this work, we present the PatchMerger, a simple module that reduces the number of patches or tokens the network has to process by merging them between two consecutive intermediate layers. We show that the PatchMerger achieves a significant speedup across various model sizes while matching the original performance both upstream and downstream after fine-tuning.

Keywords

Cite

@article{arxiv.2202.12015,
  title  = {Learning to Merge Tokens in Vision Transformers},
  author = {Cedric Renggli and André Susano Pinto and Neil Houlsby and Basil Mustafa and Joan Puigcerver and Carlos Riquelme},
  journal= {arXiv preprint arXiv:2202.12015},
  year   = {2022}
}

Comments

11 pages, 9 figures

R2 v1 2026-06-24T09:52:20.682Z