Abstract
Vision Transformers (ViTs) have achieved state-of-the-art performance in various computer vision tasks but suffer from high computational costs that scale with the number of patches, attention heads, and layers. We present AdaViT, an adaptive framework that improves ViT efficiency by dynamically pruning redundant components on a per-image basis. By learning to allocate computation based on image complexity, AdaViT achieves a 2x efficiency improvement with a negligible 0.8% drop in Top-1 accuracy on ImageNet.
Introduction
While Vision Transformers have revolutionized the field, they impose a significant "computational tax." Unlike traditional CNNs, the cost of a ViT is fixed for every input, regardless of its content. A simple image of a "white stork" against a clear sky requires the same processing power as a cluttered "barbershop" scene. This inherent inefficiency stems from treating all image patches, attention heads, and transformer blocks as equally necessary for every classification task. AdaViT addresses this by introducing instance-specific adaptivity, allowing the model to dynamically decide which components are essential for a given input.
Methodology
The core of AdaViT is a light-weight Decision Network integrated into each transformer block. This network generates three types of binary "usage policies" tailored to each input image:
- Patch Selection: Identifies and discards uninformative patches (e.g., background) as they progress through the network.
- Head Selection: Deactivates redundant self-attention heads that do not contribute significantly to the final prediction.
- Block Selection: Determines whether to skip an entire transformer block, utilizing residual connections to maintain information flow.
To enable end-to-end training with these discrete decisions, the authors employ the Gumbel-Softmax trick, allowing backpropagation through the selection process. The training objective optimizes a joint loss function: a standard classification loss and a Usage Loss that penalizes the model for exceeding a target computational budget $\gamma$.
Experimental Setup
AdaViT was evaluated on the ImageNet dataset, using T2T-ViT and DeiT as backbone architectures to demonstrate its model-agnostic nature. The primary metrics for evaluation were Top-1 accuracy and Giga Floating-point Operations (GFLOPs).
Results and Analysis
AdaViT demonstrates a superior accuracy-efficiency trade-off compared to static ViT variants and traditional CNNs.
- Efficiency Gains: AdaViT achieved a 2x reduction in GFLOPs compared to the T2T-ViT-19 baseline. Specifically, it maintained an 81.1% Top-1 accuracy on ImageNet using only 3.9 GFLOPs, whereas the full baseline required 8.5 GFLOPs for 81.9% accuracy.
- Adaptive Computation: Qualitative analysis reveals that the model naturally allocates more resources to complex scenes (e.g., "shoe shop") and fewer to simple, object-centric images (e.g., "parachute").
- Hierarchical Pruning: The model learns to prune patches progressively. Early layers retain most patches for global context, while deeper layers focus on discriminative object parts, effectively "masking out" irrelevant background information.
Conclusion
AdaViT provides a robust framework for making Vision Transformers more efficient through instance-specific pruning. While it significantly reduces theoretical FLOPs, a small accuracy gap remains compared to full-capacity models. Future research will focus on narrowing this gap and optimizing the dynamic execution for real-world hardware, where non-uniform workloads can pose challenges for standard GPU kernels.
Summary updated