KVT: k-NN Attention for Boosting Vision Transformers
Not on the map. Why?
Abstract (arXiv)
Convolutional Neural Networks (CNNs) have dominated computer vision for years, due to its ability in capturing locality and translation invariance. Recently, many vision transformer architectures have been proposed and they show promising performance. A key component in vision transformers is the fully-connected self-attention which is more powerful than CNNs in modelling long range dependencies. However, since the current dense self-attention uses all image patches (tokens) to compute attention matrix, it may neglect locality of images patches and involve noisy tokens (e.g., clutter background and occlusion), leading to a slow training process and potential degradation of performance. To address these problems, we propose the k-NN attention for boosting vision transformers. Specifically, instead of involving all the tokens for attention matrix calculation, we only select the top-k similar tokens from the keys for each query to compute the attention map. The proposed k-NN attention naturally inherits the local bias of CNNs without introducing convolutional operations, as nearby tokens tend to be more similar than others. In addition, the k-NN attention allows for the exploration of long range correlation and at the same time filters out irrelevant tokens by choosing the most similar tokens from the entire image. Despite its simplicity, we verify, both theoretically and empirically, that k-NN attention is powerful in speeding up training and distilling noise from input tokens. Extensive experiments are conducted by using 11 different vision transformer architectures to verify that the proposed k-NN attention can work with any existing transformer architectures to improve its prediction performance. The codes are available at urlhttps://github.com/damo-cv/KVT.
Key facts. Cited by 64 papers in the map (data through 7 Oct 2026). Builds on 61 of its 93 references that are in the map. First posted on arXiv 28 May 2021.
Builds on
61 of 93 references.
References · 61
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2014Microsoft COCO: Common Objects in Contextcited by 17,498
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,441
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2021Emerging Properties in Self-Supervised Vision Transformerscited by 6,893
- 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
38 more
- 2017MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applicationscited by 3,827
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2016Aggregated Residual Transformations for Deep Neural Networkscited by 2,540
- 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Reformer: The Efficient Transformercited by 1,658
- 2019Generating Long Sequences with Sparse Transformerscited by 1,523
- 2017ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devicescited by 1,194
- 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,096
- 2016Semantic Understanding of Scenes through the ADE20K Datasetcited by 1,063
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
- 2021CvT: Introducing Convolutions to Vision Transformerscited by 946
- 2018MnasNet: Platform-Aware Neural Architecture Search for Mobilecited by 937
- 2021Multiscale Vision Transformerscited by 896
- 2021CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classificationcited by 806
- 2020Efficient Transformers: A Surveycited by 784
- 2021Going deeper with Image Transformerscited by 759
- 2021Transformer in Transformercited by 632
- 2020Transformer Interpretability Beyond Attention Visualizationcited by 620
- 2021Twins: Revisiting the Design of Spatial Attention in Vision Transformerscited by 565
- 2021ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biasescited by 484
- 2021LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inferencecited by 475
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
- 2020End-to-End Video Instance Segmentation with Transformerscited by 443
- 2021TransReID: Transformer-based Object Re-Identificationcited by 432
- 2021Transformer Trackingcited by 412
- 2021Rethinking Spatial Dimensions of Vision Transformerscited by 361
- 2019Axial Attention in Multidimensional Transformerscited by 350
- 2018Generating Wikipedia by Summarizing Long Sequencescited by 333
- 2020Exploring Self-attention for Image Recognitioncited by 313
- 2019On the Relationship between Self-Attention and Convolutional Layerscited by 299
- 2021DeepViT: Towards Deeper Vision Transformercited by 288
- 2020Sparse Sinkhorn Attentioncited by 250
- 2021Incorporating Convolution Designs into Visual Transformerscited by 248
- 2021LocalViT: Analyzing Locality in Vision Transformerscited by 228
- 2021Co-Scale Conv-Attentional Image Transformerscited by 224
- 2021Multi-Scale Vision Longformer: A New Vision Transformer for High-Resolution Image Encodingcited by 207
- 2019Adaptively Sparse Transformerscited by 154
50 most cited of 61 All 61 (JSON)
Built on by
Citing papers per year: 2021: 6; 2022: 10; 2023: 19; 2024: 14; 2025: 8; 2026: 7.
64 papers.
Sort:
By area:
- 2023One Fits All:Power General Time Series Analysis by Pretrained LMcited by 615
- 2023Learning A Sparse Transformer Network for Effective Image Derainingcited by 204
- 2021SPViT: Enabling Faster Vision Transformers via Soft Token Pruningcited by 165
- 2023Swap Attention in Spatiotemporal Diffusions for Text-to-Video Generationcited by 153
- 2021CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptationcited by 129
- 2022QuadTree Attention for Vision Transformerscited by 129
- 2022Entroformer: A Transformer-based Entropy Model for Learned Image Compressioncited by 102
- 2024PromptCharm: Text-to-Image Generation through Multi-modal Prompting and Refinementcited by 61
- 2023Vision Transformer with Quadrangle Attentioncited by 46
- 2024A Survey on Transformer Compressioncited by 44
- 2022VSA: Learning Varied-Size Window Attention in Vision Transformerscited by 43
- 2023Prompt-In-Prompt Learning for Universal Image Restorationcited by 43
38 more
- 2023Memory-and-Anticipation Transformer for Online Action Understandingcited by 39
- 2021Scaled ReLU Matters for Training Vision Transformerscited by 29
- 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecturecited by 28
- 2021Self-slimmed Vision Transformercited by 27
- 2022VAQF: Fully Automatic Software-Hardware Co-Design Framework for Low-Bit Vision Transformercited by 27
- 2023EulerMormer: Robust Eulerian Motion Magnification via Dynamic Filtering within Transformercited by 27
- 2025Progressive Focused Transformer for Single Image Super-Resolutioncited by 25
- 2022DynaST: Dynamic Sparse Transformer for Exemplar-Guided Image Generationcited by 24
- 2023FM-ViT: Flexible Modal Vision Transformers for Face Anti-Spoofingcited by 22
- 2023SCT: A Simple Baseline for Parameter-Efficient Fine-Tuning via Salient Channelscited by 20
- 2021ELSA: Enhanced Local Self-Attention for Vision Transformercited by 18
- 2023MA-ViT: Modality-Agnostic Vision Transformers for Face Anti-Spoofingcited by 18
- 2022Dynamic Focus-aware Positional Queries for Semantic Segmentationcited by 16
- 2023Hourglass Tokenizer for Efficient Transformer-Based 3D Human Pose Estimationcited by 15
- 2021Decoupling and Recoupling Spatiotemporal Representation for RGB-D-based Motion Recognitioncited by 13
- 2024Looking 3D: Anomaly Detection with 2D-3D Alignmentcited by 13
- 2023All4One: Symbiotic Neighbour Contrastive Learning via Self-Attention and Redundancy Reductioncited by 11
- 2023Linear Log-Normal Attention with Unbiased Concentrationcited by 11
- 2022A Unified Multimodal De- and Re-coupling Framework for RGB-D Motion Recognitioncited by 9
- 2023CAIT: Triple-Win Compression towards High Accuracy, Fast Inference, and Favorable Transferability For ViTscited by 9
- 2024LeMeViT: Efficient Vision Transformer with Learnable Meta Tokens for Remote Sensing Image Interpretationcited by 9
- 2022Data Level Lottery Ticket Hypothesis for Vision Transformerscited by 7
- 2022ClusTR: Exploring Efficient Self-attention via Clustering for Vision Transformerscited by 6
- 2023Reciprocal Attention Mixing Transformer for Lightweight Image Restorationcited by 6
- 2023Graph-Segmenter: Graph Transformer with Boundary-aware Attention for Semantic Segmentationcited by 6
- 2023Revisit Parameter-Efficient Transfer Learning: A Two-Stage Paradigmcited by 5
- 2024MultiMax: Sparse and Multi-Modal Attention Learningcited by 5
- 2024PADRe: A Unifying Polynomial Attention Drop-in Replacement for Efficient Vision Transformercited by 5
- 2024Hierarchical Separable Video Transformer for Snapshot Compressive Imagingcited by 4
- 2022Effective Vision Transformer Training: A Data-Centric Perspectivecited by 3
- 2024ReViT: Enhancing Vision Transformers Feature Diversity with Attention Residual Connectionscited by 3
- 2024LevAttention: Time, Space, and Streaming Efficient Algorithm for Heavy Attentionscited by 3
- 2024KNN Transformer with Pyramid Prompts for Few-Shot Learningcited by 3
- 2026LaSSM: Efficient Semantic-Spatial Query Decoding via Local Aggregation and State Space Models for 3D Instance Segmentationcited by 3
- 2024A Manifold Representation of the Key in Vision Transformerscited by 2
- 2026Multi-scale hypergraph meets LLMs: Aligning large language models for time series analysiscited by 2
- 2023Multi-stage Factorized Spatio-Temporal Representation for RGB-D Action and Gesture Recognitioncited by 1
- 2025Unifying Convolution and Attention via Convolutional Nearest Neighborscited by 1
50 most cited of 64 All 64 (JSON)
- 2026AdaST: Adaptive Coupling for Spatial-Temporal Forecasting28 Sep 2026
- 2026FMRFusion: Frequency-Aware Multi-View Representation Learning for Heterogeneous Image Fusion6 Jun 2026
- 2026EmambaIR: Efficient Visual State Space Model for Event-guided Image Reconstruction8 May 2026
- 2026k-Maximum Inner Product Attention for Graph Transformers and the Expressive Power of GraphGPS4 Apr 2026
- 2026Residual SODAP: Residual Self-Organizing Domain-Adaptive Prompting with Structural Knowledge Preservation for Continual Learning13 Mar 2026
- 2026LaSSM: Efficient Semantic-Spatial Query Decoding via Local Aggregation and State Space Models for 3D Instance Segmentation11 Feb 2026
- 2026Multi-scale hypergraph meets LLMs: Aligning large language models for time series analysis4 Feb 2026
- 2025Spectral Discrepancy and Cross-modal Semantic Consistency Learning for Object Detection in Hyperspectral Image20 Dec 2025
- 2025KLO-Net: A Dynamic K-NN Attention U-Net with CSP Encoder for Efficient Prostate Gland Segmentation from MRI15 Dec 2025
- 2025HIMOSA: Efficient Remote Sensing Image Super-Resolution with Hierarchical Mixture of Sparse Attention29 Nov 2025
- 2025Unifying Convolution and Attention via Convolutional Nearest Neighbors18 Nov 2025
- 2025TCSAFormer: Efficient Vision Transformer with Token Compression and Sparse Attention for Medical Image Segmentation6 Aug 2025
38 more
- 2025Progressive Focused Transformer for Single Image Super-Resolution26 Mar 2025
- 2025Iterative Optimal Attention and Local Model for Single Image Rain Streak Removal20 Mar 2025
- 2025Fraesormer: Learning Adaptive Sparse Transformer for Efficient Food Recognition15 Mar 2025
- 2024KNN Transformer with Pyramid Prompts for Few-Shot Learning14 Oct 2024
- 2024LevAttention: Time, Space, and Streaming Efficient Algorithm for Heavy Attentions7 Oct 2024
- 2024Genetic Information Analysis of Age-Related Macular Degeneration Fellow Eye Using Multi-Modal Selective ViT17 Sep 2024
- 2024Hierarchical Separable Video Transformer for Snapshot Compressive Imaging16 Jul 2024
- 2024PADRe: A Unifying Polynomial Attention Drop-in Replacement for Efficient Vision Transformer16 Jul 2024
- 2024Looking 3D: Anomaly Detection with 2D-3D Alignment27 Jun 2024
- 2024MultiMax: Sparse and Multi-Modal Attention Learning3 Jun 2024
- 2024LeMeViT: Efficient Vision Transformer with Learnable Meta Tokens for Remote Sensing Image Interpretation16 May 2024
- 2024Frequency Decoupling for Motion Magnification via Multi-Level Isomorphic Architecture12 Mar 2024
- 2024Segmentation Guided Sparse Transformer for Under-Display Camera Image Restoration9 Mar 2024
- 2024PromptCharm: Text-to-Image Generation through Multi-modal Prompting and Refinement6 Mar 2024
- 2024ReViT: Enhancing Vision Transformers Feature Diversity with Attention Residual Connections17 Feb 2024
- 2024A Survey on Transformer Compression5 Feb 2024
- 2024A Manifold Representation of the Key in Vision Transformers1 Feb 2024
- 2023Prompt-In-Prompt Learning for Universal Image Restoration8 Dec 2023
- 2023EulerMormer: Robust Eulerian Motion Magnification via Dynamic Filtering within Transformer7 Dec 2023
- 2023Linear Log-Normal Attention with Unbiased Concentration22 Nov 2023
- 2023Hourglass Tokenizer for Efficient Transformer-Based 3D Human Pose Estimation20 Nov 2023
- 2023CAIT: Triple-Win Compression towards High Accuracy, Fast Inference, and Favorable Transferability For ViTs27 Sep 2023
- 2023SCT: A Simple Baseline for Parameter-Efficient Fine-Tuning via Salient Channels15 Sep 2023
- 2023Multi-stage Factorized Spatio-Temporal Representation for RGB-D Action and Gesture Recognition23 Aug 2023
- 2023Patch Is Not All You Need21 Aug 2023
- 2023Memory-and-Anticipation Transformer for Online Action Understanding15 Aug 2023
- 2023Graph-Segmenter: Graph Transformer with Boundary-aware Attention for Semantic Segmentation15 Aug 2023
- 2023Reciprocal Attention Mixing Transformer for Lightweight Image Restoration19 May 2023
- 2023Swap Attention in Spatiotemporal Diffusions for Text-to-Video Generation18 May 2023
- 2023FM-ViT: Flexible Modal Vision Transformers for Face Anti-Spoofing5 May 2023
- 2023MA-ViT: Modality-Agnostic Vision Transformers for Face Anti-Spoofing15 Apr 2023
- 2023Vision Transformer with Quadrangle Attention27 Mar 2023
- 2023Learning A Sparse Transformer Network for Effective Image Deraining21 Mar 2023
- 2023All4One: Symbiotic Neighbour Contrastive Learning via Self-Attention and Redundancy Reduction16 Mar 2023
- 2023Revisit Parameter-Efficient Transfer Learning: A Two-Stage Paradigm14 Mar 2023
- 2023One Fits All:Power General Time Series Analysis by Pretrained LM23 Feb 2023
- 2022A Unified Multimodal De- and Re-coupling Framework for RGB-D Motion Recognition16 Nov 2022
- 2022Data Level Lottery Ticket Hypothesis for Vision Transformers2 Nov 2022
50 newest of 64 All 64 (JSON)
- 2023One Fits All:Power General Time Series Analysis by Pretrained LMcited by 615
- 2023Learning A Sparse Transformer Network for Effective Image Derainingcited by 204
- 2023Swap Attention in Spatiotemporal Diffusions for Text-to-Video Generationcited by 153
- 2021CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptationcited by 129
- 2022QuadTree Attention for Vision Transformerscited by 129
- 2022Entroformer: A Transformer-based Entropy Model for Learned Image Compressioncited by 102
- 2023Vision Transformer with Quadrangle Attentioncited by 46
- 2024A Survey on Transformer Compressioncited by 44
- 2022VSA: Learning Varied-Size Window Attention in Vision Transformerscited by 43
- 2023Prompt-In-Prompt Learning for Universal Image Restorationcited by 43
- 2023Memory-and-Anticipation Transformer for Online Action Understandingcited by 39
- 2021Scaled ReLU Matters for Training Vision Transformerscited by 29
12 most cited of 61 All 61 (JSON)
- 2026AdaST: Adaptive Coupling for Spatial-Temporal Forecasting28 Sep 2026
- 2026FMRFusion: Frequency-Aware Multi-View Representation Learning for Heterogeneous Image Fusion6 Jun 2026
- 2026EmambaIR: Efficient Visual State Space Model for Event-guided Image Reconstruction8 May 2026
- 2026k-Maximum Inner Product Attention for Graph Transformers and the Expressive Power of GraphGPS4 Apr 2026
- 2026Residual SODAP: Residual Self-Organizing Domain-Adaptive Prompting with Structural Knowledge Preservation for Continual Learning13 Mar 2026
- 2026LaSSM: Efficient Semantic-Spatial Query Decoding via Local Aggregation and State Space Models for 3D Instance Segmentation11 Feb 2026
- 2026Multi-scale hypergraph meets LLMs: Aligning large language models for time series analysis4 Feb 2026
- 2025Spectral Discrepancy and Cross-modal Semantic Consistency Learning for Object Detection in Hyperspectral Image20 Dec 2025
- 2025KLO-Net: A Dynamic K-NN Attention U-Net with CSP Encoder for Efficient Prostate Gland Segmentation from MRI15 Dec 2025
- 2025HIMOSA: Efficient Remote Sensing Image Super-Resolution with Hierarchical Mixture of Sparse Attention29 Nov 2025
- 2025Unifying Convolution and Attention via Convolutional Nearest Neighbors18 Nov 2025
- 2025TCSAFormer: Efficient Vision Transformer with Token Compression and Sparse Attention for Medical Image Segmentation6 Aug 2025
12 newest of 61 All 61 (JSON)