Papers › On the Connection between Local Attention and Dynamic Depth-wise Convolution

On the Connection between Local Attention and Dynamic Depth-wise Convolution

8 Jun 2021ICLR 2022 4arXiv:2106.04263archive 2025-07-28

Qi Han, Zejia Fan, Qi Dai, Lei Sun, Ming-Ming Cheng, Jiaying Liu, Jingdong Wang

Vision Transformer (ViT) attains state-of-the-art performance in visual recognition, and the variant, Local Vision Transformer, makes further improvements. The major component in Local Vision Transformer, local attention, performs the attention separately over small local windows. We rephrase local attention as a channel-wise locally-connected layer and analyze it from two network regularization manners, sparse connectivity and weight sharing, as well as weight computation. Sparse connectivity: there is no connection across channels, and each position is connected to the positions within a small local window. Weight sharing: the connection weights for one position are shared across channels or within each group of channels. Dynamic weight: the connection weights are dynamically predicted according to each image instance. We point out that local attention resembles depth-wise convolution and its dynamic version in sparse connectivity. The main difference lies in weight sharing - depth-wise convolution shares connection weights (kernel weights) across spatial positions. We empirically observe that the models based on depth-wise convolution and the dynamic variant with lower computation complexity perform on-par with or sometimes slightly better than Swin Transformer, an instance of Local Vision Transformer, for ImageNet classification, COCO object detection and ADE semantic segmentation. These observations suggest that Local Vision Transformer takes advantage of two regularization forms and dynamic weight to increase the network capacity. Code is available at https://github.com/Atten4Vis/DemystifyLocalViT.

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="2106.04263")

Code

Syntology Ran 7 of 16 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 5 ran with no contract checked.

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

atten4vis/demystifylocalvit officialmentioned in papermentioned 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

16 samples harvested; 7 ran; 1 honoured the contract we drafted; 9 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
1ran · violated contract
5ran
9unverified

Licence: 0 of the 16 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 Atten4Vis/DemystifyLocalViT. “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.

GET_BLOCKS Atten4Vis/DemystifyLocalViT/models/idynamic.py official repository ran · violated contract fingerprinted MIT (permissive) · c5acf386fe00c470 · report
build_optimizer Atten4Vis/DemystifyLocalViT/optimizer.py official repository ran MIT (permissive) · e35a4b2e4114b1a5 · report
get_final_iter Atten4Vis/DemystifyLocalViT/downstreams/segmentation/.dev/gather_models.py official repository ran MIT (permissive) · 88d68650d669bb11 · report
get_final_results Atten4Vis/DemystifyLocalViT/downstreams/detection/.dev_scripts/gather_models.py official repository ran MIT (permissive) · 2268355e37eebb82 · report
get_grad_norm Atten4Vis/DemystifyLocalViT/utils.py official repository ran · honoured contract MIT (permissive) · eec1e7cba51d5e8e · report
process_checkpoint Atten4Vis/DemystifyLocalViT/downstreams/detection/.dev_scripts/gather_models.py official repository ran MIT (permissive) · e76a491553cf9fcf · report
set_weight_decay Atten4Vis/DemystifyLocalViT/optimizer.py official repository ran MIT (permissive) · b33222a09fc93bec · report
Dtype Atten4Vis/DemystifyLocalViT/models/idynamic.py official repository unverified MIT (permissive) · 1e624f979ea53ae4 · report
auto_resume_helper Atten4Vis/DemystifyLocalViT/utils.py official repository unverified MIT (permissive) · 0c32459bef92ff8c · report
build_model Atten4Vis/DemystifyLocalViT/models/build.py official repository unverified MIT (permissive) · dd74736c6244d64b · report
build_scheduler Atten4Vis/DemystifyLocalViT/lr_scheduler.py official repository unverified MIT (permissive) · c02cc4e0b5720211 · report
check_keywords_in_name Atten4Vis/DemystifyLocalViT/optimizer.py official repository unverified MIT (permissive) · b0a5beb34716d5a6 · report
create_logger Atten4Vis/DemystifyLocalViT/logger.py official repository unverified MIT (permissive) · 80450600f7f09b0a · report
get_config Atten4Vis/DemystifyLocalViT/config.py official repository unverified MIT (permissive) · c32302734842a753 · report
get_final_results Atten4Vis/DemystifyLocalViT/downstreams/segmentation/.dev/gather_models.py official repository unverified MIT (permissive) · 6c10c287d59a984c · report
load_checkpoint Atten4Vis/DemystifyLocalViT/utils.py official repository unverified MIT (permissive) · d690bbafcc136a37 · report

Tasks

Object DetectionSemantic Segmentationobject-detection

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEConvolutionDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformerVision Transformer

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