mlsanityData to 14 Oct 2026

Castling-ViT: Compressing Self-Attention via Switching Towards Linear-Angular Attention at Vision Transformer Inference

arXiv 2211.10526 ↗First posted 18 Nov 2022cs.CVcited by 28

Not on the map. Why?

Abstract (arXiv)

Vision Transformers (ViTs) have shown impressive performance but still require a high computation cost as compared to convolutional neural networks (CNNs), one reason is that ViTs' attention measures global similarities and thus has a quadratic complexity with the number of input tokens. Existing efficient ViTs adopt local attention (e.g., Swin) or linear attention (e.g., Performer), which sacrifice ViTs' capabilities of capturing either global or local context. In this work, we ask an important research question: Can ViTs learn both global and local context while being more efficient during inference? To this end, we propose a framework called Castling-ViT, which trains ViTs using both linear-angular attention and masked softmax-based quadratic attention, but then switches to having only linear angular attention during ViT inference. Our Castling-ViT leverages angular kernels to measure the similarities between queries and keys via spectral angles. And we further simplify it with two techniques: (1) a novel linear-angular attention mechanism: we decompose the angular kernels into linear terms and high-order residuals, and only keep the linear terms; and (2) we adopt two parameterized modules to approximate high-order residuals: a depthwise convolution and an auxiliary masked softmax attention to help learn both global and local information, where the masks for softmax attention are regularized to gradually become zeros and thus incur no overhead during ViT inference. Extensive experiments and ablation studies on three tasks consistently validate the effectiveness of the proposed Castling-ViT, e.g., achieving up to a 1.8% higher accuracy or 40% MACs reduction on ImageNet classification and 1.2 higher mAP on COCO detection under comparable FLOPs, as compared to ViTs with vanilla softmax-based attentions.

Key facts. Cited by 28 papers in the map (data through 14 Oct 2026). Builds on 64 of its 79 references that are in the map. First posted on arXiv 18 Nov 2022.

Builds on

64 of 79 references.

References · 64

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  3. 2014Microsoft COCO: Common Objects in Contextcited by 17,608
  4. 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
  5. 2020End-to-End Object Detection with Transformerscited by 7,414
  6. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,403
  7. 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,442
  8. 2018MobileNetV2: Inverted Residuals and Linear Bottleneckscited by 4,795
  9. 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
  10. 2020Deformable DETR: Deformable Transformers for End-to-End Object Detectioncited by 3,422
  11. 2020Longformer: The Long-Document Transformercited by 3,413
  12. 2021Masked-attention Mask Transformer for Universal Image Segmentationcited by 2,351
38 more
  1. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  2. 2019Searching for MobileNetV3cited by 1,994
  3. 2021Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutionscited by 1,962
  4. 2020Reformer: The Efficient Transformercited by 1,668
  5. 2020Rethinking Attention with Performerscited by 1,601
  6. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  7. 2021Per-Pixel Classification is Not All You Need for Semantic Segmentationcited by 1,152
  8. 2021Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNetcited by 1,101
  9. 2021YOLOX: Exceeding YOLO Series in 2021cited by 1,071
  10. 2022Token Merging: Your ViT But Fastercited by 1,021
  11. 2019EfficientDet: Scalable and Efficient Object Detectioncited by 1,020
  12. 2020Designing Network Design Spacescited by 960
  13. 2021CvT: Introducing Convolutions to Vision Transformerscited by 947
  14. 2017Revisiting Unreasonable Effectiveness of Data in Deep Learning Eracited by 919
  15. 2021Multiscale Vision Transformerscited by 897
  16. 2021DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsificationcited by 864
  17. 2021CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classificationcited by 806
  18. 2021Going deeper with Image Transformerscited by 764
  19. 2021PVT v2: Improved Baselines with Pyramid Vision Transformercited by 751
  20. 2022Exploring Plain Vision Transformer Backbones for Object Detectioncited by 724
  21. 2021MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformercited by 642
  22. 2021CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windowscited by 527
  23. 2021MViTv2: Improved Multiscale Vision Transformers for Classification and Detectioncited by 519
  24. 2022MaxViT: Multi-Axis Vision Transformercited by 476
  25. 2021LeViT: a Vision Transformer in ConvNet's Clothing for Faster Inferencecited by 475
  26. 2021Nystr"omformer: A Nystr"om-Based Algorithm for Approximating Self-Attentioncited by 471
  27. 2018Efficient Attention: Attention with Linear Complexitiescited by 368
  28. 2019Frequency Principle: Fourier Analysis Sheds Light on Deep Neural Networkscited by 368
  29. 2021AdaViT: Adaptive Tokens for Efficient Vision Transformercited by 362
  30. 2021Rethinking Spatial Dimensions of Vision Transformerscited by 361
  31. 2021XCiT: Cross-Covariance Image Transformerscited by 338
  32. 2022EfficientFormer: Vision Transformers at MobileNet Speedcited by 241
  33. 2022cosFormer: Rethinking Softmax in Attentioncited by 213
  34. 2021AutoFormer: Searching Transformers for Visual Recognitioncited by 188
  35. 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
  36. 2022QuadTree Attention for Vision Transformerscited by 129
  37. 2021SOFT: Softmax-free Transformer with Linear Complexitycited by 128
  38. 2020Lite Transformer with Long-Short Range Attentioncited by 127

50 most cited of 64 All 64 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 6; 2024: 11; 2025: 6; 2026: 5.

28 papers.

Sort:

By area:

  1. 2023EfficientSAM: Leveraged Masked Image Pretraining for Efficient Segment Anythingcited by 188
  2. 2023FLatten Transformer: Vision Transformer using Focused Linear Attentioncited by 171
  3. 2023Agent Attention: On the Integration of Softmax and Linear Attentioncited by 90
  4. 2024Bridging the Divide: Reconsidering Softmax and Linear Attentioncited by 48
  5. 2024A Survey on Transformer Compressioncited by 46
  6. 2023A survey on efficient vision transformers: algorithms, techniques, and performance benchmarkingcited by 41
  7. 2025PolaFormer: Polarity-aware Linear Attention for Vision Transformerscited by 32
  8. 2024Breaking the Low-Rank Dilemma of Linear Attentioncited by 31
  9. 2024Efficient Diffusion Transformer with Step-wise Dynamic Attention Mediatorscited by 24
  10. 2024Efficient Track Anythingcited by 21
  11. 2025Rectifying Magnitude Neglect in Linear Attentioncited by 16
  12. 2023ShiftAddViT: Mixture of Multiplication Primitives Towards Efficient Vision Transformercited by 15
16 more
  1. 2023Computation-efficient Deep Learning for Computer Vision: A Surveycited by 14
  2. 2024PaPr: Training-Free One-Step Patch Pruning with Lightweight ConvNets for Faster Inferencecited by 9
  3. 2024When Linear Attention Meets Autoregressive Decoding: Towards More Effective and Efficient Linearized Large Language Modelscited by 9
  4. 2025Not Every Patch is Needed: Towards a More Efficient and Effective Backbone for Video-based Person Re-identificationcited by 7
  5. 2024PADRe: A Unifying Polynomial Attention Drop-in Replacement for Efficient Vision Transformercited by 5
  6. 2025Linear Differential Vision Transformer: Learning Visual Contrasts via Pairwise Differentialscited by 4
  7. 2024Trio-ViT: Post-Training Quantization and Acceleration for Softmax-Free Efficient Vision Transformercited by 3
  8. 2024Automatic Channel Pruning for Multi-Head Attentioncited by 3
  9. 2025AnchorFormer: Differentiable Anchor Attention for Efficient Vision Transformercited by 3
  10. 2025Norm×Direction: Restoring the Missing Query Norm in Vision Linear Attentioncited by 2
  11. 2026BinaryAttention: One-Bit QK-Attention for Vision and Diffusion Transformerscited by 1
  12. 2024Long-Term Prediction Accuracy Improvement of Data-Driven Medium-Range Global Weather Forecastcited by 0
  13. 2026MirrorLA: Reflecting Feature Map for Vision Linear Attentioncited by 0
  14. 2026Attention to details, logits to truth: visual-aware attention and logits enhancement to mitigate hallucinations in LVLMscited by 0
  15. 2026RAViT: Resolution-Adaptive Vision Transformercited by 0
  16. 2026Do Vision Transformers Need All-to-All Attention? Global Communication Through Elastic Learned Corescited by 0