Introduction
Vision Transformers (ViTs) have revolutionized image recognition but remain computationally expensive because they treat every small image patch as an independent token. While pruning or merging tokens can improve efficiency, these methods often suffer from "semantic insufficiency." A single $16 \times 16$ patch, such as a blurry blue square, lacks clear meaning on its own. Discarding such patches prematurely can lead to a loss of vital information that only becomes apparent when patches are viewed in context.
Methodology
To address this, the authors introduce ImagePiece, a re-tokenization strategy inspired by subword tokenization in Natural Language Processing (NLP). Just as characters combine to form meaningful subwords, ImagePiece merges semantically weak image patches into coherent "chunks" before making pruning decisions.
The ImagePiece pipeline consists of three core stages:
- Re-tokenizing Non-semantic Tokens: The model identifies the least important tokens based on their attention to the
[CLS]token and merges them into larger abstractions. - Semantic Re-evaluation: Once merged, the importance of these new "chunks" is recalculated. This allows the model to "discover" meaning in previously discarded areas—for instance, several "meaningless" blue patches might combine to represent a recognizable part of a bus.
- Local Coherence Bias: A small convolutional stem replaces the standard linear patchify layer, encouraging the model to recognize that adjacent patches are likely part of the same object.
Experiments and Results
The method was evaluated on the ImageNet-1k dataset using DeiT-Tiny and DeiT-Small architectures. ImagePiece demonstrates a rare "free lunch" in model optimization: it simultaneously increases throughput and improves accuracy.
Key findings include:
- Efficiency Gains: For DeiT-Small, ImagePiece achieved a 54% increase in throughput while improving accuracy by 0.39%. For DeiT-Tiny, it provided a 47% speedup with a 0.48% accuracy gain.
- Semantic Recovery: Analysis revealed that nearly 59% of tokens initially deemed "inattentive" in early layers were reassessed as "attentive" after being merged into larger chunks. This confirms that many "useless" patches are simply waiting for context.
- Extreme Compression: In scenarios where tokens are aggressively reduced (leaving only ~13% of original tokens), ImagePiece outperformed baselines like DynamicViT and ToMe by over 8% in accuracy.
Conclusion
ImagePiece successfully adapts the concept of subword tokenization to the visual domain, proving that content-aware merging can prevent the hasty loss of information in efficient ViTs. While currently focused on classification, this approach holds promise for scaling larger models and improving multi-modal alignment in frameworks like CLIP. Future research will explore its application in dense prediction tasks like object detection and segmentation.
Summary updated