DiffRate : Differentiable Compression Rate for Efficient Vision Transformers

Mengzhao Chen, Wenqi Shao, Peng Xu, Mingbao Lin, Kaipeng Zhang +4 more
2/14/2026

No official code found. Best implementation: OpenGVLab/DiffRate (103 stars, last commit 2023-07-14).

Abstract

Token compression aims to speed up large-scale vision transformers (e.g. ViTs) by pruning (dropping) or merging tokens. It is an important but challenging task. Although recent advanced approaches achieved great success, they need to carefully handcraft a compression rate (i.e. number of tokens to remove), which is tedious and leads to sub-optimal performance. To tackle this problem, we propose Differentiable Compression Rate (DiffRate), a novel token compression method that has several appealing properties prior arts do not have. First, DiffRate enables propagating the loss function’s gradient onto the compression ratio, which is considered as a non-differentiable hyperparameter in previous work. In this case, different layers can automatically learn different compression rates layer-wisely without extra overhead. Second, token pruning and merging can be naturally performed simultaneously in DiffRate, while they were isolated in previous works. Third, extensive experiments demonstrate that DiffRate achieves state-of-the-art performance. For example, by applying the learned layer-wise compression rates to an off-the-shelf ViT-H (MAE) model, we achieve a 40% FLOPs reduction and a 1.5× throughput improvement, with a minor accuracy drop of 0.16% on ImageNet without fine-tuning, even outperforming previous methods with fine-tuning. Codes and models are available at https://github.com/OpenGVLab/DiffRate.

View on arXivView PDF

Code Implementations(1)

OpenGVLab/DiffRateCommunity100%

[ICCV 23]An approach to enhance the efficiency of Vision Transformer (ViT) by concurrently employing token pruning and token merging techniques, while incorporating a differentiable compression rate.

1037Python, Jupyter NotebookMay 29, 20233 years ago

Similar Papers

Cite this paper

@article{chen2026diffrate,
  title  = {DiffRate : Differentiable Compression Rate for Efficient Vision Transformers},
  author = {Mengzhao Chen and Wenqi Shao and Peng Xu and Mingbao Lin and Kaipeng Zhang and Fei Chao and Rongrong Ji and Y. Qiao and Ping Luo},
  year   = {2026},
  eprint = {2305.17997},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2305.17997},
  journal = {ICCV 2023 2023}
}

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

Discussion