Papers › Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks

Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks

5 May 2021arXiv:2105.02358archive 2025-07-28

Meng-Hao Guo, Zheng-Ning Liu, Tai-Jiang Mu, Shi-Min Hu

Attention mechanisms, especially self-attention, have played an increasingly important role in deep feature representation for visual tasks. Self-attention updates the feature at each position by computing a weighted sum of features using pair-wise affinities across all positions to capture the long-range dependency within a single sample. However, self-attention has quadratic complexity and ignores potential correlation between different samples. This paper proposes a novel attention mechanism which we call external attention, based on two external, small, learnable, shared memories, which can be implemented easily by simply using two cascaded linear layers and two normalization layers; it conveniently replaces self-attention in existing popular architectures. External attention has linear complexity and implicitly considers the correlations between all data samples. We further incorporate the multi-head mechanism into external attention to provide an all-MLP architecture, external attention MLP (EAMLP), for image classification. Extensive experiments on image classification, object detection, semantic segmentation, instance segmentation, image generation, and point cloud analysis reveal that our method provides results comparable or superior to the self-attention mechanism and some of its variants, with much lower computational and memory costs.

PaperPDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

MenghaoGuo/-EANet officialmentioned on GitHubpytorch report
MenghaoGuo/EANet mentioned on GitHubpytorch report
innat/External-Attention-TensorFlow mentioned on GitHubtfApache-2.0 report
shuuchen/external_attention.pytorch mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Image ClassificationImage GenerationInstance SegmentationObject DetectionPoint Cloud ClassificationSemantic Segmentationimage-classificationobject-detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet T2T-ViT-14 Top 1 Accuracy 81.7% #615 of 1060 Archive leaderboard report
Semantic Segmentation ADE20K EANet (ResNet-101) Validation mIoU 45.33 #192 of 235 Archive leaderboard report
Semantic Segmentation ADE20K val EANet (ResNet-101) mIoU 45.33 #80 of 95 Archive leaderboard report
Semantic Segmentation Cityscapes val EANet mIoU 81.7% #39 of 99 Archive leaderboard report
Semantic Segmentation PASCAL VOC 2012 test EANet (ResNet-101) Mean IoU 84% #16 of 51 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections