Papers › Scaling Local Self-Attention for Parameter Efficient Visual Backbones

Scaling Local Self-Attention for Parameter Efficient Visual Backbones

23 Mar 2021CVPR 2021 1arXiv:2103.12731archive 2025-07-28

Ashish Vaswani, Prajit Ramachandran, Aravind Srinivas, Niki Parmar, Blake Hechtman, Jonathon Shlens

Self-attention has the promise of improving computer vision systems due to parameter-independent scaling of receptive fields and content-dependent interactions, in contrast to parameter-dependent scaling and content-independent interactions of convolutions. Self-attention models have recently been shown to have encouraging improvements on accuracy-parameter trade-offs compared to baseline convolutional models such as ResNet-50. In this work, we aim to develop self-attention models that can outperform not just the canonical baseline models, but even the high-performing convolutional models. We propose two extensions to self-attention that, in conjunction with a more efficient implementation of self-attention, improve the speed, memory usage, and accuracy of these models. We leverage these improvements to develop a new self-attention model family, HaloNets, which reach state-of-the-art accuracies on the parameter-limited setting of the ImageNet classification benchmark. In preliminary transfer learning experiments, we find that HaloNet models outperform much larger models and have better inference performance. On harder tasks such as object detection and instance segmentation, our simple local self-attention and convolutional hybrids show improvements over very strong baselines. These results mark another step in demonstrating the efficacy of self-attention models on settings traditionally dominated by convolutional models.

PaperPDFConference PDFCodeCode Syntology ran

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

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2103.12731")

Code

Syntology Ran 12 of 20 code samples harvested from 4 repositories linked to this paper; 8 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · our draft was wrong; 5 ran · fixture could not drive it; 4 ran with no contract checked.

By repository: community (archive-listed): 20 samples from 4 repositories, 12 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

kevin-ssy/ViP mentioned on GitHubpytorchMIT report
lucidrains/halonet-pytorch mentioned on GitHubpytorchMIT report
rwightman/pytorch-image-models mentioned on GitHubpytorch 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

20 samples harvested; 12 ran; 1 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
5ran · fixture could not drive it
4ran
8unverified

Licence: 0 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

HaloAttention xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran MIT (permissive) · 2e1c36d6346e85e2 · report
HaloAttention qwopqwop200/halonet-tf2/halonet.py community (archive-listed) ran MIT (permissive) · e672b9aa56a1370e · report
RelPosEmb xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran MIT (permissive) · 84902fc5aa98fdd2 · report
RelPosEmb qwopqwop200/halonet-tf2/halonet.py community (archive-listed) ran MIT (permissive) · f84f90d761d35986 · report
expand_dim xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 042da966a79899bf · report
expand_dim qwopqwop200/halonet-tf2/halonet.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · c408fb0e411bf284 · report
pair lucidrains/halonet-pytorch/halonet_pytorch/halonet_pytorch.py community (archive-listed) ran · honoured contract fingerprinted MIT (permissive) · 3e27684df29ad41d · report
rel_to_abs xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · 1e87e34e9818520d · report
rel_to_abs qwopqwop200/halonet-tf2/halonet.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · de5b53fe2be91d13 · report
relative_logits_1d xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · f0386252d04dce23 · report
relative_logits_1d qwopqwop200/halonet-tf2/halonet.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · d72140427ae8af3b · report
to xmu-xiaoma666/External-Attention-pytorch/model/attention/HaloAttention.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 0bb26a83df4e7b0b · report
addmm_flop_jit kevin-ssy/ViP/utils/flop_count/jit_handles.py community (archive-listed) unverified MIT (permissive) · 27b31e965ef896f1 · report
apply_pos kevin-ssy/ViP/models/vip_layers.py community (archive-listed) unverified MIT (permissive) · 24b72f9389954e2e · report
create_loader kevin-ssy/ViP/utils/loader.py community (archive-listed) unverified MIT (permissive) · 1cf1c5e0f9a581ba · report
dist_init kevin-ssy/ViP/utils/distributed_utils.py community (archive-listed) unverified MIT (permissive) · b2ada9fb7de2d355 · report
generic_activation_jit kevin-ssy/ViP/utils/flop_count/jit_handles.py community (archive-listed) unverified MIT (permissive) · 29724655612e3ef9 · report
get_shape kevin-ssy/ViP/utils/flop_count/jit_handles.py community (archive-listed) unverified MIT (permissive) · 653ac611901cfc1c · report
init_device kevin-ssy/ViP/utils/distributed_utils.py community (archive-listed) unverified MIT (permissive) · 5d8cf2436bdfc77b · report
load_ext kevin-ssy/ViP/utils/ext_loader.py community (archive-listed) unverified MIT (permissive) · a512212dfdd82da0 · report

Tasks

Image ClassificationInstance SegmentationObject DetectionSemantic SegmentationTransfer Learningobject-detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet HaloNet4 (base 128, Conv-12) Number of params 87M #223 of 1060 Archive leaderboard report
Image Classification ImageNet HaloNet4 (base 128, Conv-12) Top 1 Accuracy 85.5% #223 of 1060 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.

Methods

Introduced by this paper: HaloNet

HaloNet

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