Papers › Dilated Neighborhood Attention Transformer

Dilated Neighborhood Attention Transformer

29 Sep 2022arXiv:2209.15001archive 2025-07-28

Ali Hassani, Humphrey Shi

Transformers are quickly becoming one of the most heavily applied deep learning architectures across modalities, domains, and tasks. In vision, on top of ongoing efforts into plain transformers, hierarchical transformers have also gained significant attention, thanks to their performance and easy integration into existing frameworks. These models typically employ localized attention mechanisms, such as the sliding-window Neighborhood Attention (NA) or Swin Transformer's Shifted Window Self Attention. While effective at reducing self attention's quadratic complexity, local attention weakens two of the most desirable properties of self attention: long range inter-dependency modeling, and global receptive field. In this paper, we introduce Dilated Neighborhood Attention (DiNA), a natural, flexible and efficient extension to NA that can capture more global context and expand receptive fields exponentially at no additional cost. NA's local attention and DiNA's sparse global attention complement each other, and therefore we introduce Dilated Neighborhood Attention Transformer (DiNAT), a new hierarchical vision transformer built upon both. DiNAT variants enjoy significant improvements over strong baselines such as NAT, Swin, and ConvNeXt. Our large model is faster and ahead of its Swin counterpart by 1.6% box AP in COCO object detection, 1.4% mask AP in COCO instance segmentation, and 1.4% mIoU in ADE20K semantic segmentation. Paired with new frameworks, our large variant is the new state of the art panoptic segmentation model on COCO (58.5 PQ) and ADE20K (49.4 PQ), and instance segmentation model on Cityscapes (45.1 AP) and ADE20K (35.4 AP) (no extra data). It also matches the state of the art specialized semantic segmentation models on ADE20K (58.1 mIoU), and ranks second on Cityscapes (84.5 mIoU) (no extra data).

PaperPDFCode

In Syntology View this paper on Syntology, its page in Syntology's graph. That page 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

SHI-Labs/Neighborhood-Attention-Transformer officialmentioned in papermentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to StyleNAT: Giving Each Head a New Perspective (arXiv:2211.05770; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 0 honoured, 0 violated, 1 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
shi-labs/natten officialmentioned on GitHubpytorchMITSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Faster Neighborhood Attention: Reducing the O(n^2) Cost of Self Attention at the... (arXiv:2403.04690; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 2 unverified); nothing checks that they implement this paper's method. report
alexmehta/nac-tcn-tcns-with-causal-na mentioned on GitHubpytorchGPL-2.0Syntology: not harvested report
huggingface/transformers mentioned on GitHubpytorchSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Attention Is All You Need (arXiv:1706.03762; that paper's own run record: 610 ran (of which 293 constructed an object rather than computing a result; 529 with no instrument failure: 45 honoured, 15 violated, 469 with no contract checked; 81 where Syntology's instrument failed) · 336 unverified), HuggingFace's Transformers: State-of-the-art Natural Language Processing (arXiv:1910.03771; that paper's own run record: 3 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 3 where Syntology's instrument failed) · 0 unverified), DeBERTa: Decoding-enhanced BERT with Disentangled Attention (arXiv:2006.03654; that paper's own run record: 4 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 2 honoured, 1 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 9 unverified) and 1 more (every one in this page's JSON twin); nothing checks that they implement this paper's method. report
MindSpore-scientific/code-10 mindsporeSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Open-Sora: Democratizing Efficient Video Production for All (arXiv:2412.20404; that paper's own run record: 3 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; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
MindSpore-scientific/code-8 mindsporeSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to SimBa: Simplicity Bias for Scaling Up Parameters in Deep Reinforcement Learning (arXiv:2410.09754; that paper's own run record: 6 ran (of which 2 constructed an object rather than computing a result; 6 with no instrument failure: 0 honoured, 0 violated, 6 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. 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

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

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

Tasks

Image ClassificationInstance SegmentationObject DetectionPanoptic SegmentationSegmentationSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet DiNAT-Large (11x11ks; 384res; Pretrained on IN22K@224) GFLOPs 92.4 #86 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Large (11x11ks; 384res; Pretrained on IN22K@224) Number of params 200M #86 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Large (11x11ks; 384res; Pretrained on IN22K@224) Top 1 Accuracy 87.5% #86 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Large (384x384; Pretrained on ImageNet-22K @ 224x224) GFLOPs 89.7 #89 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Large (384x384; Pretrained on ImageNet-22K @ 224x224) Top 1 Accuracy 87.4% #89 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT_s-Large (384res; Pretrained on IN22K@224) GFLOPs 101.5 #95 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT_s-Large (384res; Pretrained on IN22K@224) Number of params 197M #95 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT_s-Large (384res; Pretrained on IN22K@224) Top 1 Accuracy 87.4% #95 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT_s-Large (224x224; Pretrained on ImageNet-22K @ 224x224) GFLOPs 34.5 #136 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT_s-Large (224x224; Pretrained on ImageNet-22K @ 224x224) Top 1 Accuracy 86.5% #136 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Base GFLOPs 13.7 #321 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Base Number of params 90M #321 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Base Top 1 Accuracy 84.4% #321 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Small GFLOPs 7.8 #389 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Small Number of params 51M #389 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Small Top 1 Accuracy 83.8% #389 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Tiny GFLOPs 4.3 #512 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Tiny Number of params 28M #512 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Tiny Top 1 Accuracy 82.7% #512 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Mini GFLOPs 2.7 #609 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Mini Number of params 20M #609 of 1060 Archive leaderboard report
Image Classification ImageNet DiNAT-Mini Top 1 Accuracy 81.8% #609 of 1060 Archive leaderboard report
Instance Segmentation ADE20K val DiNAT-L (Mask2Former, single-scale) AP 35.4 #10 of 14 Archive leaderboard report
Instance Segmentation ADE20K val DiNAT-L (Mask2Former, single-scale) APL 55.5 #10 of 14 Archive leaderboard report
Instance Segmentation ADE20K val DiNAT-L (Mask2Former, single-scale) APM 39.0 #10 of 14 Archive leaderboard report
Instance Segmentation ADE20K val DiNAT-L (Mask2Former, single-scale) APS 16.3 #10 of 14 Archive leaderboard report
Instance Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) AP50 75.0 #22 of 93 Archive leaderboard report
Instance Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) mask AP 50.8 #22 of 93 Archive leaderboard report
Instance Segmentation Cityscapes val DiNAT-L (single-scale, Mask2Former) AP50 72.6 #7 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val DiNAT-L (single-scale, Mask2Former) mask AP 45.1 #7 of 17 Archive leaderboard report
Panoptic Segmentation ADE20K val DiNAT-L (Mask2Former, 640x640) AP 35.0 #16 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val DiNAT-L (Mask2Former, 640x640) PQ 49.4 #16 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val DiNAT-L (Mask2Former, 640x640) mIoU 56.3 #16 of 25 Archive leaderboard report
Panoptic Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) AP 49.2 #8 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) PQ 58.5 #8 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) PQst 48.8 #8 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) PQth 64.9 #8 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival DiNAT-L (single-scale, Mask2Former) mIoU 68.3 #8 of 31 Archive leaderboard report
Panoptic Segmentation Cityscapes val DiNAT-L (Mask2Former) AP 44.5 #12 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val DiNAT-L (Mask2Former) PQ 67.2 #12 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val DiNAT-L (Mask2Former) mIoU 83.4 #12 of 37 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-L (Mask2Former) Validation mIoU 58.1 #25 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-Large (UperNet) Validation mIoU 54.9 #53 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT_s-Large (UperNet) Validation mIoU 54.6 #59 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-Base (UperNet) Validation mIoU 50.4 #113 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-Small (UperNet) Validation mIoU 49.9 #124 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-Tiny (UperNet) Validation mIoU 48.8 #143 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DiNAT-Mini (UperNet) Validation mIoU 47.2 #165 of 235 Archive leaderboard report
Semantic Segmentation ADE20K val DiNAT-L (Mask2Former) mIoU 58.1 #17 of 95 Archive leaderboard report
Semantic Segmentation Cityscapes val DiNAT-L (Mask2Former) mIoU 84.5 #15 of 99 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

ConvNeXtNeighborhood AttentionTransformer

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