Learned Queries for Efficient Local Attention
Not on the map. Why?
Abstract (arXiv)
Vision Transformers (ViT) serve as powerful vision models. Unlike convolutional neural networks, which dominated vision research in previous years, vision transformers enjoy the ability to capture long-range dependencies in the data. Nonetheless, an integral part of any transformer architecture, the self-attention mechanism, suffers from high latency and inefficient memory utilization, making it less suitable for high-resolution input images. To alleviate these shortcomings, hierarchical vision models locally employ self-attention on non-interleaving windows. This relaxation reduces the complexity to be linear in the input size; however, it limits the cross-window interaction, hurting the model performance. In this paper, we propose a new shift-invariant local attention layer, called query and attend (QnA), that aggregates the input locally in an overlapping manner, much like convolutions. The key idea behind QnA is to introduce learned queries, which allow fast and efficient implementation. We verify the effectiveness of our layer by incorporating it into a hierarchical vision transformer model. We show improvements in speed and memory complexity while achieving comparable accuracy with state-of-the-art models. Finally, our layer scales especially well with window size, requiring up-to x10 less memory while being up-to x5 faster than existing methods. The code is publicly available at urlhttps://github.com/moabarar/qna.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Builds on 76 of its 91 references that are in the map. First posted on arXiv 21 Dec 2021.
Builds on
76 of 91 references.
References · 76
- 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
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2014Microsoft COCO: Common Objects in Contextcited by 17,498
- 2014Very Deep Convolutional Networks for Large-Scale Image Recognitioncited by 15,267
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,082
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
38 more
- 2015Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networkscited by 9,617
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,441
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2016Densely Connected Convolutional Networkscited by 6,691
- 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
- 2016Layer Normalizationcited by 5,579
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
- 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 4,993
- 2017Squeeze-and-Excitation Networkscited by 4,763
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,560
- 2014Going Deeper with Convolutionscited by 4,231
- 2014Deep Learning Face Attributes in the Wildcited by 3,679
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2016Aggregated Residual Transformations for Deep Neural Networkscited by 2,540
- 2019RandAugment: Practical automated data augmentation with a reduced search spacecited by 2,261
- 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,960
- 2017Accurate, Large Minibatch SGD: Training ImageNet in 1 Hourcited by 1,479
- 2020Sharpness-Aware Minimization for Efficiently Improving Generalizationcited by 1,404
- 2016Instance Normalization: The Missing Ingredient for Fast Stylizationcited by 1,187
- 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,096
- 2021Perceiver: General Perception with Iterative Attentioncited by 1,089
- 2018Dual Attention Network for Scene Segmentationcited by 1,001
- 2016Deep Networks with Stochastic Depthcited by 973
- 2020Designing Network Design Spacescited by 954
- 2021CvT: Introducing Convolutions to Vision Transformerscited by 946
- 2017Revisiting Unreasonable Effectiveness of Data in Deep Learning Eracited by 916
- 2020On Layer Normalization in the Transformer Architecturecited by 906
- 2021Multiscale Vision Transformerscited by 896
- 2021CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classificationcited by 806
- 2018Image Transformercited by 770
- 2021Going deeper with Image Transformerscited by 759
- 2018CCNet: Criss-Cross Attention for Semantic Segmentationcited by 717
- 2021Do Vision Transformers See Like Convolutional Neural Networks?cited by 671
- 2021Transformer in Transformercited by 632
- 2021Perceiver IO: A General Architecture for Structured Inputs & Outputscited by 616
- 2013Network In Networkcited by 600
- 2021CoAtNet: Marrying Convolution and Attention for All Data Sizescited by 566
- 2021Twins: Revisiting the Design of Spatial Attention in Vision Transformerscited by 565
50 most cited of 76 All 76 (JSON)
Built on by
Citing papers per year: 2022: 3; 2023: 12; 2024: 5; 2025: 6; 2026: 1.
27 papers.
Sort:
By area:
- 2023InterDiff: Generating 3D Human-Object Interactions with Physics-Informed Diffusioncited by 181
- 2025Fast Video Generation with Sliding Tile Attentioncited by 123
- 2023RMT: Retentive Networks Meet Vision Transformerscited by 68
- 2023Single Motion Diffusioncited by 65
- 2023TransNeXt: Robust Foveal Visual Perception for Vision Transformerscited by 61
- 2023Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attentioncited by 38
- 2023Vision Transformers with Mixed-Resolution Tokenizationcited by 35
- 2022Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention at Vision Transformer Inferencecited by 28
- 2024Multi-criteria Token Fusion with One-step-ahead Attention for Efficient Vision Transformerscited by 26
- 2023Lightweight Vision Transformer with Bidirectional Interactioncited by 25
- 2023DAT++: Spatially Dynamic Vision Transformer with Deformable Attentioncited by 21
- 2023ShiftAddViT: Mixture of Multiplication Primitives Towards Efficient Vision Transformercited by 15
15 more
- 2022Iterative Patch Selection for High-Resolution Image Recognitioncited by 13
- 2024When Linear Attention Meets Autoregressive Decoding: Towards More Effective and Efficient Linearized Large Language Modelscited by 9
- 2025MotionDreamer: One-to-Many Motion Synthesis with Localized Generative Masked Transformercited by 9
- 2024Vision Transformer with Sparse Scan Priorcited by 6
- 2023Rethinking Local Perception in Lightweight Vision Transformercited by 5
- 2023DESTINE: Dynamic Goal Queries with Temporal Transductive Alignment for Trajectory Predictioncited by 5
- 2024A Manifold Representation of the Key in Vision Transformerscited by 2
- 2024Towards Practical Single-shot Motion Synthesiscited by 1
- 2025A Retrospective Systematic Study on Hierarchical Sparse Query Transformer-assisted Ultrasound Screening for Early Hepatocellular Carcinomacited by 1
- 2025Controllable Single-shot Animation Blending with Temporal Conditioningcited by 1
- 2022Token Transformer: Can class token help window-based transformer build better long-range interactions?cited by 0
- 2023Recent Advances of Local Mechanisms in Computer Vision: A Survey and Outlook of Recent Workcited by 0
- 2025Block-based Symmetric Pruning and Fusion for Efficient Vision Transformerscited by 0
- 2025Through the PRISm: Importance-Aware Scene Graphs for Image Retrievalcited by 0
- 2026Advancing Vision Transformer with Enhanced Spatial Priorscited by 0
- 2026Advancing Vision Transformer with Enhanced Spatial Priors20 Apr 2026
- 2025Through the PRISm: Importance-Aware Scene Graphs for Image Retrieval20 Dec 2025
- 2025Controllable Single-shot Animation Blending with Temporal Conditioning25 Aug 2025
- 2025Block-based Symmetric Pruning and Fusion for Efficient Vision Transformers16 Jul 2025
- 2025MotionDreamer: One-to-Many Motion Synthesis with Localized Generative Masked Transformer11 Apr 2025
- 2025Fast Video Generation with Sliding Tile Attention6 Feb 2025
- 2025A Retrospective Systematic Study on Hierarchical Sparse Query Transformer-assisted Ultrasound Screening for Early Hepatocellular Carcinoma6 Feb 2025
- 2024When Linear Attention Meets Autoregressive Decoding: Towards More Effective and Efficient Linearized Large Language Models11 Jun 2024
- 2024Towards Practical Single-shot Motion Synthesis3 Jun 2024
- 2024Vision Transformer with Sparse Scan Prior22 May 2024
- 2024Multi-criteria Token Fusion with One-step-ahead Attention for Efficient Vision Transformers15 Mar 2024
- 2024A Manifold Representation of the Key in Vision Transformers1 Feb 2024
15 more
- 2023TransNeXt: Robust Foveal Visual Perception for Vision Transformers28 Nov 2023
- 2023DESTINE: Dynamic Goal Queries with Temporal Transductive Alignment for Trajectory Prediction11 Oct 2023
- 2023RMT: Retentive Networks Meet Vision Transformers20 Sep 2023
- 2023DAT++: Spatially Dynamic Vision Transformer with Deformable Attention4 Sep 2023
- 2023InterDiff: Generating 3D Human-Object Interactions with Physics-Informed Diffusion31 Aug 2023
- 2023ShiftAddViT: Mixture of Multiplication Primitives Towards Efficient Vision Transformer10 Jun 2023
- 2023Recent Advances of Local Mechanisms in Computer Vision: A Survey and Outlook of Recent Work2 Jun 2023
- 2023Lightweight Vision Transformer with Bidirectional Interaction1 Jun 2023
- 2023Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attention9 Apr 2023
- 2023Vision Transformers with Mixed-Resolution Tokenization1 Apr 2023
- 2023Rethinking Local Perception in Lightweight Vision Transformer31 Mar 2023
- 2023Single Motion Diffusion12 Feb 2023
- 2022Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention at Vision Transformer Inference18 Nov 2022
- 2022Token Transformer: Can class token help window-based transformer build better long-range interactions?11 Nov 2022
- 2022Iterative Patch Selection for High-Resolution Image Recognition24 Oct 2022
- 2025Fast Video Generation with Sliding Tile Attentioncited by 123
- 2023Single Motion Diffusioncited by 65
- 2025Fast Video Generation with Sliding Tile Attention6 Feb 2025
- 2023Single Motion Diffusion12 Feb 2023
- 2023InterDiff: Generating 3D Human-Object Interactions with Physics-Informed Diffusioncited by 181
- 2023RMT: Retentive Networks Meet Vision Transformerscited by 68
- 2023TransNeXt: Robust Foveal Visual Perception for Vision Transformerscited by 61
- 2023Slide-Transformer: Hierarchical Vision Transformer with Local Self-Attentioncited by 38
- 2023Vision Transformers with Mixed-Resolution Tokenizationcited by 35
- 2022Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention at Vision Transformer Inferencecited by 28
- 2024Multi-criteria Token Fusion with One-step-ahead Attention for Efficient Vision Transformerscited by 26
- 2023Lightweight Vision Transformer with Bidirectional Interactioncited by 25
- 2023DAT++: Spatially Dynamic Vision Transformer with Deformable Attentioncited by 21
- 2022Iterative Patch Selection for High-Resolution Image Recognitioncited by 13
- 2025MotionDreamer: One-to-Many Motion Synthesis with Localized Generative Masked Transformercited by 9
- 2024Vision Transformer with Sparse Scan Priorcited by 6
12 most cited of 22 All 22 (JSON)
- 2026Advancing Vision Transformer with Enhanced Spatial Priors20 Apr 2026
- 2025Through the PRISm: Importance-Aware Scene Graphs for Image Retrieval20 Dec 2025
- 2025Controllable Single-shot Animation Blending with Temporal Conditioning25 Aug 2025
- 2025Block-based Symmetric Pruning and Fusion for Efficient Vision Transformers16 Jul 2025
- 2025MotionDreamer: One-to-Many Motion Synthesis with Localized Generative Masked Transformer11 Apr 2025
- 2024Towards Practical Single-shot Motion Synthesis3 Jun 2024
- 2024Vision Transformer with Sparse Scan Prior22 May 2024
- 2024Multi-criteria Token Fusion with One-step-ahead Attention for Efficient Vision Transformers15 Mar 2024
- 2024A Manifold Representation of the Key in Vision Transformers1 Feb 2024
- 2023TransNeXt: Robust Foveal Visual Perception for Vision Transformers28 Nov 2023
- 2023DESTINE: Dynamic Goal Queries with Temporal Transductive Alignment for Trajectory Prediction11 Oct 2023
- 2023RMT: Retentive Networks Meet Vision Transformers20 Sep 2023
12 newest of 22 All 22 (JSON)