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 ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 20 code samples harvested from 4 repositories linked to this paper: 18 ran (of which 4 constructed an object rather than computing a result; 11 with no instrument failure: 1 honoured, 0 violated, 10 with no contract checked; 7 where Syntology's instrument failed) · 2 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; 5 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: community (archive-listed): 20 samples from 4 repositories, 18 ran (11 with no instrument failure; 7 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

kevin-ssy/ViP mentioned on GitHubpytorchMITSyntology: 8 samples, 6 ran (0 instrument-failed) · 2 unverified report
lucidrains/halonet-pytorch mentioned on GitHubpytorchMITSyntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report
rwightman/pytorch-image-models mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to AdamP: Slowing Down the Slowdown for Momentum Optimizers on Scale-invariant Weights (arXiv:2006.08217; that paper's own run record: 4 ran (of which 1 constructed an object rather than computing a result; 2 with no instrument failure: 1 honoured, 0 violated, 1 with no contract checked; 2 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
BR-IDL/PaddleViT paddleSyntology: not harvested report
leondgarse/keras_cv_attention_models tfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to RepViT: Revisiting Mobile CNN From ViT Perspective (arXiv:2307.09283; that paper's own run record: 6 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 0 honoured, 0 violated, 3 with no contract checked; 3 where Syntology's instrument failed) · 6 unverified); nothing checks that they implement this paper's method. report
qwopqwop200/halonet-tf2 tfSyntology: 5 samples, 5 ran (3 instrument-failed) · 0 unverified report
xmu-xiaoma666/External-Attention-pytorch pytorchSyntology: 6 samples, 6 ran (4 instrument-failed) · 0 unverified 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.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

20 samples harvested: 18 ran (of which 4 constructed an object rather than computing a result; 11 with no instrument failure: 1 honoured, 0 violated, 10 with no contract checked; 7 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
5ran; the contract check could not run
10ran
2unverified

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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 2 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

kevin-ssy/ViP community (archive-listed) 8 samples, 6 ran (0 instrument-failed) · 2 unverified
addmm_flop_jit utils/flop_count/jit_handles.py ran MIT (permissive) · 27b31e965ef896f1 · report fixture: signature inputs:list/1/MockJitValue, outputs:list/1/empty · returned Counter · level recorded 2026-09-25
apply_pos models/vip_layers.py ran MIT (permissive) · 24b72f9389954e2e · report fixture: signature tensor:Tensor/3/float, pos:Tensor/4/float, num_heads:int/0/int · returned Tensor · level recorded 2026-09-24
create_loader in 6 papers utils/loader.py ran MIT (permissive) · 1cf1c5e0f9a581ba · report fixture: signature dataset:DummyDataset/0/?, input_size:int/0/int, batch_size:int/0/int, is_training:bool/0/bool, use_prefetcher:bool/0/bool, no_aug:bool/0/bool, re_prob:float/0/float, re_mode:str/0/str, re_count:int/0/int, re_split:bool/0/bool, scale:NoneType/0/?, ratio:NoneType/0/?, hflip:float/0/float, vflip:float/0/float, color_jitter:float/0/float, auto_augment:NoneType/0/?, num_aug_splits:int/0/int, interpolation:str/0/str, mean:tuple/1/float, std:tuple/1/float, num_workers:int/0/int, distributed:bool/0/bool, crop_pct:NoneType/0/?, collate_fn:NoneType/0/?, pin_memory:bool/0/bool, fp16:bool/0/bool, tf_preprocessing:bool/0/bool, use_multi_epochs_loader:bool/0/bool, repeated_aug:bool/0/bool · returned PrefetchLoader · level recorded 2026-09-25
generic_activation_jit utils/flop_count/jit_handles.py ran MIT (permissive) · 29724655612e3ef9 · report fixture: signature op_name:str/0/str · returned function · level recorded 2026-09-25
get_shape in 27 papers utils/flop_count/jit_handles.py ran MIT (permissive) · 653ac611901cfc1c · report fixture: signature val:Value/0/? · returned list · level recorded 2026-09-25
load_ext utils/ext_loader.py ran MIT (permissive) · a512212dfdd82da0 · report fixture: signature name:str/0/str, funcs:list/1/str · returned module · level recorded 2026-09-24
dist_init in 7 papers utils/distributed_utils.py unverified MIT (permissive) · b2ada9fb7de2d355 · report
init_device in 20 papers utils/distributed_utils.py unverified MIT (permissive) · 5d8cf2436bdfc77b · report
lucidrains/halonet-pytorch community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
pair in 101 papers halonet_pytorch/halonet_pytorch.py ran · honoured contract fingerprinted MIT (permissive) · 3e27684df29ad41d · report fixture: signature x:Tensor/2/float · returned tuple · level recorded 2026-09-22
qwopqwop200/halonet-tf2 community (archive-listed) 5 samples, 5 ran (3 instrument-failed) · 0 unverified
HaloAttention halonet.py ran MIT (permissive) · e672b9aa56a1370e · report fixture: returned HaloAttention · level recorded 2026-09-22
RelPosEmb halonet.py ran MIT (permissive) · f84f90d761d35986 · report fixture: returned RelPosEmb · level recorded 2026-09-22
expand_dim in 11 papers
census: 3 implementations from 5 papers, 1 distinct output on one shared input
halonet.py ran; the contract check could not run (RAISES) MIT (permissive) · c408fb0e411bf284 · report fixture: signature t:EagerTensor/2/float, dim:int/0/int, k:int/0/int · returned EagerTensor · level recorded 2026-09-22
rel_to_abs halonet.py ran; the contract check could not run (RAISES) MIT (permissive) · de5b53fe2be91d13 · report fixture: signature x:EagerTensor/3/float · returned EagerTensor · level recorded 2026-09-22
relative_logits_1d halonet.py ran; the contract check could not run (RAISES) MIT (permissive) · d72140427ae8af3b · report fixture: signature q:EagerTensor/4/float, rel_k:EagerTensor/2/float · returned EagerTensor · level recorded 2026-09-22
xmu-xiaoma666/External-Attention-pytorch community (archive-listed) 6 samples, 6 ran (4 instrument-failed) · 0 unverified
HaloAttention model/attention/HaloAttention.py ran MIT (permissive) · 2e1c36d6346e85e2 · report fixture: returned HaloAttention · level recorded 2026-09-22
RelPosEmb model/attention/HaloAttention.py ran MIT (permissive) · 84902fc5aa98fdd2 · report fixture: returned RelPosEmb · level recorded 2026-09-22
expand_dim in 11 papers
census: 3 implementations from 5 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
model/attention/HaloAttention.py ran · our draft was wrong fingerprinted MIT (permissive) · 042da966a79899bf · report fixture: signature t:Tensor/2/float, dim:int/0/int, k:int/0/int · returned Tensor · level recorded 2026-09-22
rel_to_abs model/attention/HaloAttention.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · 1e87e34e9818520d · report fixture: signature x:Tensor/3/float · returned Tensor · level recorded 2026-09-22
relative_logits_1d model/attention/HaloAttention.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · f0386252d04dce23 · report fixture: signature q:Tensor/4/float, rel_k:Tensor/2/float · returned Tensor · level recorded 2026-09-22
to in 15 papers model/attention/HaloAttention.py ran · our draft was wrong fingerprinted MIT (permissive) · 0bb26a83df4e7b0b · report fixture: signature x:Tensor/2/float · returned dict · level recorded 2026-09-22

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.

2 assemblies on this paper: 2 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).

2 sibling assemblies for HaloNets (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.

harvested Assembly for HaloNets (graph method: HaloNets). 6 bricks; individually on a fixture: 6 ran (of which 2 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 4 where Syntology's instrument failed) · 0 unverified. The assembly has not been run end-to-end.

one of 2 siblings

  1. HaloAttention entry · level 1 · ran · 2e1c36d6346e85e2
  2. RelPosEmb model · level 1 · ran · 84902fc5aa98fdd2
  3. relative_logits_1d helper · level 1 · ran; the contract check could not run (RAISES) · f0386252d04dce23
  4. expand_dim helper · level 1 · ran · our draft was wrong · 042da966a79899bf
  5. rel_to_abs helper · level 1 · ran; the contract check could not run (RAISES) · 1e87e34e9818520d
  6. to helper · level 1 · ran · our draft was wrong · 0bb26a83df4e7b0b

harvested Assembly for HaloNets (graph method: HaloNets). 5 bricks; individually on a fixture: 5 ran (of which 2 constructed an object rather than computing a result; 2 with no instrument failure: 0 honoured, 0 violated, 2 with no contract checked; 3 where Syntology's instrument failed) · 0 unverified. The assembly has not been run end-to-end.

one of 2 siblings

  1. HaloAttention entry · level 1 · ran · e672b9aa56a1370e
  2. RelPosEmb helper · level 1 · ran · f84f90d761d35986
  3. relative_logits_1d helper · level 1 · ran; the contract check could not run (RAISES) · d72140427ae8af3b
  4. expand_dim helper · level 1 · ran; the contract check could not run (RAISES) · c408fb0e411bf284
  5. rel_to_abs helper · level 1 · ran; the contract check could not run (RAISES) · de5b53fe2be91d13

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2103.12731") returns these assemblies with each brick's role and wiring (how to connect).

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