Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Slicing Vision Transformer for Flexible Inference

About

Vision Transformers (ViT) is known for its scalability. In this work, we target to scale down a ViT to fit in an environment with dynamic-changing resource constraints. We observe that smaller ViTs are intrinsically the sub-networks of a larger ViT with different widths. Thus, we propose a general framework, named Scala, to enable a single network to represent multiple smaller ViTs with flexible inference capability, which aligns with the inherent design of ViT to vary from widths. Concretely, Scala activates several subnets during training, introduces Isolated Activation to disentangle the smallest sub-network from other subnets, and leverages Scale Coordination to ensure each sub-network receives simplified, steady, and accurate learning objectives. Comprehensive empirical validations on different tasks demonstrate that with only one-shot training, Scala learns slimmable representation without modifying the original ViT structure and matches the performance of Separate Training. Compared with the prior art, Scala achieves an average improvement of 1.6% on ImageNet-1K with fewer parameters.

Yitian Zhang, Huseyin Coskun, Xu Ma, Huan Wang, Ke Ma, Xi (Stephen) Chen, Derek Hao Hu, Yun Fu• 2024

Related benchmarks

TaskDatasetResultRank
Image ClassificationImageNet-1K 1.0 (val)
Top-1 Accuracy76.1
92
ClassificationFine-grained classification benchmarks (Food-101, CIFAR-10, CIFAR-100, SUN397, Stanford Cars, FGVC Aircraft, Pascal VOC 2007, DTD, Oxford-IIIT Pets, Caltech-101, Oxford Flowers 102, CUB-200-2011)
Accuracy (Food-101)83.4
14
Showing 2 of 2 rows

Other info

Follow for update