Abstract
Vision Transformers (ViTs) have established themselves as state-of-the-art models for computer vision, yet their high computational cost remains a barrier for deployment on resource-constrained devices. While token pruning has emerged as a popular solution to reduce complexity, it suffers from a "permanent information loss" problem where mistakenly discarded tokens cannot be recovered. This paper introduces IdleViT, a novel framework that replaces permanent pruning with a dynamic "token idling" strategy. By allowing tokens to bypass expensive computations in specific layers without being permanently deleted, IdleViT enables a self-correction mechanism that preserves accuracy while significantly reducing computational overhead.
Introduction
The computational bottleneck of Vision Transformers primarily stems from the quadratic complexity of Multi-Head Self-Attention (MHSA) and the density of Feed-Forward Networks (FFN). Existing efficiency methods often rely on token pruning—identifying and removing "unimportant" image patches as data flows through the network. However, pruning is an irreversible process. If a model's early layers incorrectly identify a foreground patch as background, that information is lost forever, leading to degraded performance in deeper layers.
IdleViT addresses this limitation by introducing Dynamic Token Idling. Instead of discarding tokens, the model temporarily "idles" them, allowing them to skip the heavy computations of a given layer while remaining available for re-selection in subsequent layers. This approach ensures that no token is truly left behind, providing the model with the flexibility to correct its own partitioning decisions.
Methodology
1. Dynamic Token Idling
In each transformer layer, IdleViT partitions the input tokens into two sets: a Selected set and an Idle set.
- Selected Tokens: These tokens undergo the standard MHSA and FFN operations.
- Idle Tokens: These tokens bypass the MHSA and FFN blocks entirely, effectively acting as a skip-connection for specific spatial locations.
At the end of the layer, the two sets are concatenated back together. Because the idle tokens are preserved in the feature pipeline, they can be re-evaluated and "re-activated" in later layers if the model determines they contain relevant information for the final classification task.
2. Token Cut Loss
To optimize the partitioning process, the authors introduce a regularization term inspired by graph theory: the Token Cut Loss. Based on normalized graph cuts, this loss encourages the model to maximize attention scores within the Selected set while minimizing the attention (or "cut") between the Selected and Idle sets. This ensures that the partition is semantically meaningful and that the model focuses its computational budget on the most informative regions of the image.
3. Training and Distillation
IdleViT is refined through a resource-friendly finetuning process. The model is trained for 30 epochs using a knowledge distillation framework, where a full-sized, pre-trained ViT acts as a "teacher" to guide the idling "student" model. This helps the student model maintain high accuracy even as its computational footprint is reduced.
Theoretical Insights: Mitigating Oversmoothing
A significant challenge in deep ViTs is oversmoothing, a phenomenon where tokens become increasingly similar as they pass through multiple layers, eventually losing their discriminative power. The authors provide a theoretical analysis showing that IdleViT’s skip-connections for idle tokens naturally mitigate this issue. By preserving the original features of idle tokens and re-introducing them later, the model maintains higher token diversity, which is essential for robust feature representation.
Experimental Results
The researchers evaluated IdleViT on the ImageNet-1K dataset across various architectures, including DeiT, LV-ViT, and Swin Transformers.
- Efficiency Gains: On the DeiT-S backbone, IdleViT reduced computational complexity (GMACs) by 33% and improved inference speed by 36%. This was achieved with a negligible Top-1 accuracy drop of less than 0.2% (79.6% vs. 79.8% for the baseline).
- Comparison with Pruning: When compared to EViT, a state-of-the-art pruning method, IdleViT achieved 0.5% higher accuracy at the same keep ratio, demonstrating the superiority of idling over permanent discarding.
- Architectural Flexibility: Unlike many pruning methods that struggle with the fixed spatial grids of pyramid-structured models, IdleViT works seamlessly with Swin Transformers. Since tokens are never removed, the spatial hierarchy remains intact, making it a versatile solution for diverse ViT designs.
Conclusion
IdleViT represents a shift in how we approach ViT efficiency. By moving from permanent pruning to dynamic idling, the framework provides a safety net against information loss and a theoretical defense against oversmoothing. While the method currently requires a brief finetuning phase with a teacher model, its ability to deliver significant speedups with minimal accuracy loss makes it a compelling candidate for deploying high-performance vision models on edge devices. Future research may extend this idling logic to dense prediction tasks like object detection and semantic segmentation, where spatial integrity is paramount.
Summary updated