Overview
EViT (Expediting Vision Transformers) introduces a novel token reorganization method that significantly accelerates Vision Transformers (ViTs) by identifying and fusing redundant image patches. By retaining only the most "attentive" tokens and merging the remainder into a single representative token, EViT increases inference speed by up to 50% with a negligible 0.3% drop in accuracy.
Introduction: The Computational Cost of ViTs
Vision Transformers have revolutionized computer vision, but they come with a heavy computational price tag. Unlike Convolutional Neural Networks (CNNs), which naturally reduce spatial resolution as they go deeper, standard ViTs process a fixed number of image "patches" (tokens) throughout the entire network.
A major inefficiency in this approach is that not all patches are equally important. In a typical image, many patches represent semantically meaningless backgrounds (like sky or grass) that do not contribute to the final classification. Processing these "distractive" tokens through every layer of the transformer—specifically in the Multi-Head Self-Attention (MHSA) and Feed-Forward Network (FFN) modules—consumes massive amounts of memory and computation for very little gain.
Methodology: The EViT Framework
To address this inefficiency, the authors propose EViT, a framework that progressively reduces the number of tokens as an image moves through the transformer layers. It consists of two main components:
- Attentive Token Identification: To decide which tokens to keep, EViT leverages the "class token" (
[CLS]). Since the class token is responsible for the final prediction, its attention scores toward other image tokens serve as a natural proxy for importance. Tokens with the highest attention scores are preserved. - Inattentive Token Fusion: Instead of simply discarding the "unimportant" tokens—which can lead to information loss and training instability—EViT fuses all inattentive tokens into a single representative token via a weighted average. This keeps the global context available to the model while drastically reducing the workload for subsequent layers.
This reorganization is integrated directly into the training process, allowing the model to learn how to best utilize the reduced token set. Crucially, EViT introduces no new parameters to the backbone architecture.
Key Insights
- Fusion Over Dropping: Simply "dropping" tokens (patch pruning) often hurts accuracy because even background patches contain some useful context. Fusing them into one token provides a "summary" of the background that stabilizes training and preserves performance.
- The "Efficiency-to-Accuracy" Pivot: Most acceleration papers focus solely on speed. EViT demonstrates that saved computation can be used to increase input resolution. By processing a higher-resolution image with EViT, models can achieve better accuracy than a vanilla ViT at the same computational cost.
- Early Identification is Hard: The authors found that moving token reduction to very early layers (e.g., before layer 3) hurts accuracy. The model requires a few layers of global interaction to accurately determine which patches are truly important.
- Oracle Guidance: Using a pre-trained "teacher" ViT to guide the token selection process (an "Oracle") can further boost the performance of the accelerated model.
Empirical Results
Evaluated primarily on ImageNet-1k, EViT demonstrates state-of-the-art trade-offs between accuracy and throughput:
- DeiT-S Acceleration: EViT increases the inference throughput of DeiT-S by 50% (from 2923 to 4385 images/s) while losing only 0.3% in Top-1 accuracy.
- Accuracy Boost: By increasing input resolution from 224x224 to 304x304, EViT improves DeiT-S accuracy by 1% while maintaining the same computational cost (MACs) as the original 224x224 vanilla model.
- LV-ViT-S: On the more advanced LV-ViT-S architecture, EViT achieves a 40% speedup with only a 0.3% accuracy drop.
- Comparison: EViT outperforms other popular acceleration methods like DynamicViT in the accuracy-vs-throughput trade-off, while being simpler to implement and requiring fewer parameters.
Limitations and Future Work
While highly effective for image classification, the current EViT implementation uses a fixed "keep rate" (e.g., preserving exactly 70% of tokens). A more adaptive approach that dynamically decides how many tokens to keep based on specific image complexity could yield even greater efficiency. Furthermore, applying EViT to dense prediction tasks like object detection or semantic segmentation remains challenging, as those tasks require maintaining a high-resolution spatial map throughout the network. Finally, the core method relies heavily on the existence of a [CLS] token, though alternative strategies exist for architectures without one.
Summary updated