Papers › When Shift Operation Meets Vision Transformer: An Extremely Simple Alternative to...

When Shift Operation Meets Vision Transformer: An Extremely Simple Alternative to Attention Mechanism

26 Jan 2022arXiv:2201.10801archive 2025-07-28

Guangting Wang, Yucheng Zhao, Chuanxin Tang, Chong Luo, Wenjun Zeng

Attention mechanism has been widely believed as the key to success of vision transformers (ViTs), since it provides a flexible and powerful way to model spatial relationships. However, is the attention mechanism truly an indispensable part of ViT? Can it be replaced by some other alternatives? To demystify the role of attention mechanism, we simplify it into an extremely simple case: ZERO FLOP and ZERO parameter. Concretely, we revisit the shift operation. It does not contain any parameter or arithmetic calculation. The only operation is to exchange a small portion of the channels between neighboring features. Based on this simple operation, we construct a new backbone network, namely ShiftViT, where the attention layers in ViT are substituted by shift operations. Surprisingly, ShiftViT works quite well in several mainstream tasks, e.g., classification, detection, and segmentation. The performance is on par with or even better than the strong baseline Swin Transformer. These results suggest that the attention mechanism might not be the vital factor that makes ViT successful. It can be even replaced by a zero-parameter operation. We should pay more attentions to the remaining parts of ViT in the future work. Code is available at github.com/microsoft/SPACH.

PaperPDFCodeCode 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="2201.10801")

Code

Syntology Ran 6 of 7 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 6 ran with no contract checked.

By repository: official repository: 7 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

microsoft/SPACH officialmentioned in papermentioned 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

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

6ran
1unverified

Licence: 0 of the 7 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 microsoft/SPACH. “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.

BasicLayer microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 025a8da133d73582 · report
GroupNorm microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic fingerprinted MIT (permissive) · 468dbc110847fd17 · report
Mlp microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · eb2bb570ac51f183 · report
PatchEmbed microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · d079baf8601e41e5 · report
PatchMerging microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 9d0d874136a0ef10 · report
ShiftViTBlock microsoft/SPACH/models/shiftvit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · c1151f8745d4efba · report
ShiftViT microsoft/SPACH/models/shiftvit.py official repository unverified MIT (permissive) · 296bef5bd4e63d1b · report

Tasks

Image ClassificationObject DetectionSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet Shift-B GFLOPs 15.2 #446 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-B Number of params 88M #446 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-B Top 1 Accuracy 83.3% #446 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-S GFLOPs 8.5 #502 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-S Number of params 50M #502 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-S Top 1 Accuracy 82.8% #502 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-T GFLOPs 4.4 #618 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-T Number of params 28M #618 of 1060 Archive leaderboard report
Image Classification ImageNet Shift-T Top 1 Accuracy 81.7% #618 of 1060 Archive leaderboard report
Object Detection COCO minival Shift-T APM 42.3 #219 of 220 Archive leaderboard report
Semantic Segmentation ADE20K Shift-B (UperNet) Validation mIoU 49.2 #137 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Shift-B Validation mIoU 47.9 #156 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Shift-S Validation mIoU 47.8 #157 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Shift-T Validation mIoU 46.3 #177 of 235 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

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformer

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