TL;DR
The Vicinity Vision Transformer (VVT) introduces Vicinity Attention, a linear-complexity attention mechanism that seamlessly integrates 2D locality bias using a decomposable Manhattan distance function. By pairing this with a novel feature-reduction block design, VVT achieves state-of-the-art performance on vision tasks while using up to 50% fewer parameters than competing models and scaling efficiently to high-resolution images.
What Problem Does This Paper Address?
Standard Vision Transformers (ViTs) rely on softmax self-attention, which suffers from quadratic computational and memory complexity ($O(N^2)$) relative to the number of image patches ($N$). This quadratic bottleneck makes processing high-resolution images or fine-grained patches prohibitively expensive.
While "linear attention" methods ($O(N)$) have been successfully introduced in Natural Language Processing (NLP) to bypass this issue, directly applying them to computer vision tasks usually leads to a severe drop in accuracy. The authors identify the core reason: existing linear attention methods flatten images into 1D sequences and completely ignore 2D locality bias—the fundamental visual principle that neighboring regions in an image are highly correlated and should share stronger attention weights.
Methods
The authors introduce two core components to bring 2D locality to linear attention without sacrificing efficiency:
- Vicinity Attention: Instead of softmax, the authors use a positive kernel function (based on ReLU) that allows the order of matrix multiplication to be inverted, dropping the complexity from $O(N^2d)$ to $O(Nd^2)$. To inject 2D locality, they bind a 2D Manhattan distance decomposition with a cosine re-weighting function. Because Manhattan distance naturally separates into independent horizontal and vertical components, it can be mathematically factored directly into the linear attention formulation.
- Vicinity Attention Block: Linear attention shifts the computational bottleneck from the sequence length ($N$) to the feature dimension ($d$). To fix this new $O(Nd^2)$ bottleneck, the authors propose Feature Reduction Attention (FRA), which projects features into a halved dimension space (reducing attention complexity by 4x). To prevent information loss, they add a parallel Feature Preserving Connection (FPC)—a lightweight skip connection using global average pooling and linear layers to recover the original feature distribution.
These blocks are arranged into a four-stage pyramid backbone called the Vicinity Vision Transformer (VVT), which progressively reduces sequence length while increasing feature dimensions.
Datasets
The proposed VVT architecture was evaluated on three standard benchmarks:
- CIFAR-100: Used for small-scale image classification and locality constraint analysis.
- ImageNet-1k: Used for large-scale image classification (1.28 million training images, 50,000 validation images).
- ADE20K: Used to evaluate semantic segmentation performance across 150 semantic categories.
No new datasets or benchmarks were introduced in this paper.
Key Insights and Ideas
- 1D Locality Fails in Vision: Prior NLP methods like cosFormer use 1D sequence distance constraints. When applied to images, tokenization separates vertically adjacent patches in the 1D sequence, causing the model to ignore vertical neighbors. 2D Manhattan distance solves this by treating horizontal and vertical axes symmetrically.
- Soft vs. Hard Locality: Unlike window-based attention mechanisms (e.g., Swin), which restrict attention to a strict local boundary ("hard locality"), Vicinity Attention maintains a global receptive field but applies a "soft" mathematical bias favoring local neighbors.
- The Feature Dimension Bottleneck: Linear attention isn't a silver bullet; it trades a sequence length bottleneck for a feature dimension bottleneck. Addressing this via the FRA + FPC block structure is essential for achieving real-world hardware speedups.
Key Results
- Parameter Efficiency: VVT-M (Medium) achieves 83.8% top-1 accuracy on ImageNet-1k, outperforming Swin-B (83.3%) and Twins-SVT-L (83.7%) while using roughly 50% fewer parameters (47.9M vs 88.0M and 99.2M, respectively).
- High-Resolution Scaling: VVT exhibits a significantly slower GFLOPs growth rate as input resolution scales up to 1300x1300 compared to standard ViT, Swin, and PVT architectures.
- Semantic Segmentation: When paired with a Semantic FPN head on the ADE20K dataset, VVT-S achieves 45.6% mIoU, substantially outperforming ResNet50 (36.7%) and PVT-Small (39.8%).
Limitations and Future Work
The primary limitation of VVT occurs in the low-resolution regime. When the input resolution (and thus sequence length $N$) is small, the quadratic feature dimension overhead ($d^2$) dominates the computation. As a result, VVT can exhibit slightly lower throughput than standard transformers on low-resolution inputs, though it quickly becomes superior as resolution scales up.
For future work, the authors suggest utilizing neural architecture search (NAS) to optimize the macro-design of the backbone specifically around these linear vision operations.
Summary updated