NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Grafting Vision Transformers

Jongwoo Park, Kumara Kahatapitiya, Donghyun Kim, Shivchander Sudalairaj, Quanfu Fan, Michael S. Ryoo

Abstract

Vision Transformers (ViTs) have recently become the state-of-the-art across many computer vision tasks. In contrast to convolutional networks (CNNs), ViTs enable global information sharing even within shallow layers of a network, i.e., among high-resolution features. However, this perk was later overlooked with the success of pyramid architectures such as Swin Transformer, which show better performance-complexity trade-offs. In this paper, we present a simple and efficient add-on component (termed GrafT) that considers global dependencies and multi-scale information throughout the network, in both high- and low-resolution features alike. It has the flexibility of branching out at arbitrary depths and shares most of the parameters and computations of the backbone. GrafT shows consistent gains over various well-known models which includes both hybrid and pure Transformer types, both homogeneous and pyramid structures, and various self-attention methods. In particular, it largely benefits mobile-size models by providing high-level semantics. On the ImageNet-1k dataset, GrafT delivers +3.9%, +1.4%, and +1.9% top-1 accuracy improvement to DeiT-T, Swin-T, and MobViT-XXS, respectively.

The Challenge of Pyramid Architectures

While early Vision Transformers (ViTs) like DeiT utilized global attention across all layers, the computational cost of processing high-resolution features globally is prohibitive. To address this, pyramid architectures (e.g., Swin, CSWin) introduced hierarchical downsampling and local window-based attention. While efficient, these models lose the ability to capture global dependencies in their early, high-resolution stages, only achieving a "big picture" view in much deeper layers.

GrafT (Grafting Vision Transformers) is proposed as a lightweight, plug-and-play solution to this problem. It re-introduces multi-scale, global information at early stages without sacrificing the efficiency of the underlying pyramid backbone.

The GrafT Architecture

GrafT functions as a horizontal pyramid structure that can be attached to any layer of a backbone Transformer. It processes features through three primary pathways:

  1. Downsampling: High-resolution features from the backbone are reduced to multiple lower-resolution versions using adaptive average pooling.
  2. Local Multi-head Self-Attention (L-MSA): Each scale is processed using local attention. At the coarsest scale, the window effectively covers the entire feature map, restoring global context.
  3. Upsampling: Processed features are scaled back up using a novel Learnable W-Bilinear (Window-based Bilinear) interpolation. This method employs anti-aliasing weights to ensure smooth transitions between local regions.
Overview of the GrafT architecture (left) and its performance gains across various backbones (right).

Finally, these "grafted" features are fused back into the backbone before the Feed-Forward Network (FFN) block, providing the model with multi-scale insights it would otherwise lack.

Mechanism and Receptive Fields

A key innovation in GrafT is how it manages receptive fields. By processing tokens at multiple scales simultaneously, the model can integrate high-level semantic information from coarse scales into the high-resolution features of the backbone. The Learnable W-Bilinear interpolation is specifically designed to solve the aliasing problems that typically occur when upsampling local attention maps.

Detailed view of the GrafT block mechanism and the resulting multi-scale receptive fields.

Experimental Results

The researchers evaluated GrafT across ImageNet-1K (classification), COCO 2017 (detection), and ADE20K (segmentation). The results demonstrate consistent improvements across diverse architectures:

  • ImageNet-1K Classification: GrafT improved DeiT-T by +3.9%, Swin-T by +1.4%, and MobViT-XXS by +1.9% in top-1 accuracy.
  • Object Detection: On COCO, it provided a +1.6 mAP boost for MobViT-XS and +1.1 AP for Swin-T.
  • Semantic Segmentation: Swin-T with GrafT achieved a +1.3 mIOU improvement on ADE20K.

Discussion and Limitations

GrafT is particularly potent for mobile-sized models, where the addition of early high-level semantics compensates for the limited capacity of small backbones. While highly efficient in terms of FLOPs—adding only minimal computational overhead—the authors note a trade-off in actual throughput. For example, adding GrafT to Swin-T reduced throughput from 1357 to 969 FPS due to the parallelization overhead inherent in multi-branch architectures. Future work will focus on optimizing implementation to bridge the gap between theoretical FLOP efficiency and real-world wall-clock speed.

Summary updated

BibTeX
@inproceedings{park2024grafting,
  author = {Jongwoo Park and Kumara Kahatapitiya and Donghyun Kim and Shivchander Sudalairaj and Quanfu Fan and Michael S. Ryoo},
  title = {{Grafting Vision Transformers}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  url = {https://openreview.net/forum?id=GK1iNB4BT3},
}
Figure