SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications

Abdelrahman M. Shaker, Muhammad Maaz, H. Rasheed, Salman H. Khan, Ming Yang +1 more
2/14/2026

No official code found. Best implementation: Amshaker/SwiftFormer (317 stars, Apache-2.0, last commit 2025-07-18).

Abstract

Self-attention has become a defacto choice for capturing global context in various vision applications. However, its quadratic computational complexity with respect to image resolution limits its use in real-time applications, especially for deployment on resource-constrained mobile devices. Although hybrid approaches have been proposed to combine the advantages of convolutions and self-attention for a better speed-accuracy trade-off, the expensive matrix multiplication operations in self-attention remain a bottleneck. In this work, we introduce a novel efficient additive attention mechanism that effectively replaces the quadratic matrix multiplication operations with linear element-wise multiplications. Our design shows that the key-value interaction can be replaced with a linear layer without sacrificing any accuracy. Unlike previous state-of-the-art methods, our efficient formulation of self-attention enables its usage at all stages of the network. Using our proposed efficient additive attention, we build a series of models called "SwiftFormer" which achieves state-of-the-art performance in terms of both accuracy and mobile inference speed. Our small variant achieves 78.5% top-1 ImageNet-1K accuracy with only 0.8 ms latency on iPhone 14, which is more accurate and 2× faster compared to MobileViT-v2. Our code and models: https://tinyurl.com/5ft8v46w

View on arXivView PDF

Code Implementations(1)

Apache-2.0

[ICCV - 2023] Official repository of paper SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications

31731Shell, PythonMar 26, 20231 years agoApache-2.0

Similar Papers

Cite this paper

@article{shaker2026swiftformer,
  title  = {SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications},
  author = {Abdelrahman M. Shaker and Muhammad Maaz and H. Rasheed and Salman H. Khan and Ming Yang and F. Khan},
  year   = {2026},
  eprint = {2303.15446},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2303.15446},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.15446.svg)](https://codeofpaper.com/paper/2303.15446)

Discussion