HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

DiffRate : Differentiable Compression Rate for Efficient Vision Transformers

Chen Mengzhao ; Shao Wenqi ; Xu Peng ; Lin Mingbao ; Zhang Kaipeng ; Chao Fei ; Ji Rongrong ; Qiao Yu ; Luo Ping

DiffRate : Differentiable Compression Rate for Efficient Vision
  Transformers

Abstract

Token compression aims to speed up large-scale vision transformers (e.g.ViTs) by pruning (dropping) or merging tokens. It is an important butchallenging task. Although recent advanced approaches achieved great success,they need to carefully handcraft a compression rate (i.e. number of tokens toremove), which is tedious and leads to sub-optimal performance. To tackle thisproblem, we propose Differentiable Compression Rate (DiffRate), a novel tokencompression method that has several appealing properties prior arts do nothave. First, DiffRate enables propagating the loss function's gradient onto thecompression ratio, which is considered as a non-differentiable hyperparameterin previous work. In this case, different layers can automatically learndifferent compression rates layer-wisely without extra overhead. Second, tokenpruning and merging can be naturally performed simultaneously in DiffRate,while they were isolated in previous works. Third, extensive experimentsdemonstrate 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.5x throughputimprovement, with a minor accuracy drop of 0.16% on ImageNet withoutfine-tuning, even outperforming previous methods with fine-tuning. Codes andmodels are available at https://github.com/OpenGVLab/DiffRate.

Code Repositories

opengvlab/diffrate
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
efficient-vits-on-imagenet-1k-with-deit-sDiffRate
GFLOPs: 2.9
Top 1 Accuracy: 79.8
efficient-vits-on-imagenet-1k-with-lv-vit-sDiffRate
GFLOPs: 3.9
Top 1 Accuracy: 82.6

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
DiffRate : Differentiable Compression Rate for Efficient Vision Transformers | Papers | HyperAI