{"about":{"non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","site":"https://codewithpapers.app","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page","syntology":{"site":"https://syntology.ai","developers":"https://syntology.ai/developers","mcp":{"server":"https://syntology.ai/mcp","transport":"streamable-http","server_card":"https://syntology.ai/.well-known/mcp/server-card.json","auth":{"type":"trial token, no account","trial_token":"https://syntology.ai/api/oauth/trial/token","method":"POST","docs":"https://syntology.ai/developers"}},"have":"https://syntology.ai/api/graph/have?x=<method, arXiv id or title> (free, answers coverage only)","paper_base":"https://syntology.ai/paper/","atlas_base":"https://app.syntology.ai/?focus="},"machine_readable":[{"url":"https://codewithpapers.app/llms.txt","what":"the machine catalog: every machine-readable file, counted"},{"url":"https://codewithpapers.app/index/manifest.json","what":"paper-to-code index by arXiv id, with Syntology's counts"},{"url":"https://codewithpapers.app/search/manifest.json","what":"site search index (titles, authors) and its files"},{"url":"https://codewithpapers.app/download","what":"bulk files: Syntology's layer, described there"},{"url":"https://codewithpapers.app/build_manifest.json","what":"the build record: inputs, counts, exclusions, probes"}]},"url":"/paper/dilated-neighborhood-attention-transformer","title":"Dilated Neighborhood Attention Transformer","arxiv_id":"2209.15001","date":"2022-09-29","proceeding":null,"authors":["Ali Hassani","Humphrey Shi"],"abstract":"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).","url_abs":"https://arxiv.org/abs/2209.15001v3","url_pdf":"https://arxiv.org/pdf/2209.15001v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/SHI-Labs/Neighborhood-Attention-Transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/shi-labs/natten","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/alexmehta/nac-tcn-tcns-with-causal-na","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-2.0"}},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/huggingface/transformers","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/MindSpore-scientific/code-10/tree/main/MicAugment","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/MindSpore-scientific/code-8/tree/main/MicAugment","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"dilated-neighborhood-attention-transformer","repo_url":"https://github.com/leondgarse/keras_cv_attention_models/tree/main/keras_cv_attention_models/nat","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"tf","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"panoptic-segmentation","task_name":"Panoptic Segmentation"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"convnext","method_name":"ConvNeXt"},{"method_slug":"na","method_name":"Neighborhood Attention"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Large (11x11ks; 384res; Pretrained on IN22K@224)","rank_in_archive_order":86,"of":1060,"metrics":{"GFLOPs":"92.4","Number of params":"200M","Top 1 Accuracy":"87.5%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Large (384x384; Pretrained on ImageNet-22K @ 224x224)","rank_in_archive_order":89,"of":1060,"metrics":{"GFLOPs":"89.7","Top 1 Accuracy":"87.4%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT_s-Large (384res; Pretrained on IN22K@224)","rank_in_archive_order":95,"of":1060,"metrics":{"GFLOPs":"101.5","Number of params":"197M","Top 1 Accuracy":"87.4%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT_s-Large (224x224; Pretrained on ImageNet-22K @ 224x224)","rank_in_archive_order":136,"of":1060,"metrics":{"GFLOPs":"34.5","Top 1 Accuracy":"86.5%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Base","rank_in_archive_order":321,"of":1060,"metrics":{"GFLOPs":"13.7","Number of params":"90M","Top 1 Accuracy":"84.4%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Small","rank_in_archive_order":389,"of":1060,"metrics":{"GFLOPs":"7.8","Number of params":"51M","Top 1 Accuracy":"83.8%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Tiny","rank_in_archive_order":512,"of":1060,"metrics":{"GFLOPs":"4.3","Number of params":"28M","Top 1 Accuracy":"82.7%"},"uses_additional_data":false},{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"DiNAT-Mini","rank_in_archive_order":609,"of":1060,"metrics":{"GFLOPs":"2.7","Number of params":"20M","Top 1 Accuracy":"81.8%"},"uses_additional_data":false},{"leaderboard":"/sota/instance-segmentation-on-ade20k-val","task":"Instance Segmentation","dataset":"ADE20K val","model":"DiNAT-L (Mask2Former, single-scale)","rank_in_archive_order":10,"of":14,"metrics":{"AP":"35.4","APL":"55.5","APM":"39.0","APS":"16.3"},"uses_additional_data":false},{"leaderboard":"/sota/instance-segmentation-on-coco-minival","task":"Instance Segmentation","dataset":"COCO minival","model":"DiNAT-L (single-scale, Mask2Former)","rank_in_archive_order":22,"of":93,"metrics":{"AP50":"75.0","mask AP":"50.8"},"uses_additional_data":false},{"leaderboard":"/sota/instance-segmentation-on-cityscapes-val","task":"Instance Segmentation","dataset":"Cityscapes val","model":"DiNAT-L (single-scale, Mask2Former)","rank_in_archive_order":7,"of":17,"metrics":{"AP50":"72.6","mask AP":"45.1"},"uses_additional_data":false},{"leaderboard":"/sota/panoptic-segmentation-on-ade20k-val","task":"Panoptic Segmentation","dataset":"ADE20K val","model":"DiNAT-L (Mask2Former, 640x640)","rank_in_archive_order":16,"of":25,"metrics":{"AP":"35.0","PQ":"49.4","mIoU":"56.3"},"uses_additional_data":false},{"leaderboard":"/sota/panoptic-segmentation-on-coco-minival","task":"Panoptic Segmentation","dataset":"COCO minival","model":"DiNAT-L (single-scale, Mask2Former)","rank_in_archive_order":8,"of":31,"metrics":{"AP":"49.2","PQ":"58.5","PQst":"48.8","PQth":"64.9","mIoU":"68.3"},"uses_additional_data":false},{"leaderboard":"/sota/panoptic-segmentation-on-cityscapes-val","task":"Panoptic Segmentation","dataset":"Cityscapes val","model":"DiNAT-L (Mask2Former)","rank_in_archive_order":12,"of":37,"metrics":{"AP":"44.5","PQ":"67.2","mIoU":"83.4"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-L (Mask2Former)","rank_in_archive_order":25,"of":235,"metrics":{"Validation mIoU":"58.1"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-Large (UperNet)","rank_in_archive_order":53,"of":235,"metrics":{"Validation mIoU":"54.9"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT_s-Large (UperNet)","rank_in_archive_order":59,"of":235,"metrics":{"Validation mIoU":"54.6"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-Base (UperNet)","rank_in_archive_order":113,"of":235,"metrics":{"Validation mIoU":"50.4"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-Small (UperNet)","rank_in_archive_order":124,"of":235,"metrics":{"Validation mIoU":"49.9"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-Tiny (UperNet)","rank_in_archive_order":143,"of":235,"metrics":{"Validation mIoU":"48.8"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k","task":"Semantic Segmentation","dataset":"ADE20K","model":"DiNAT-Mini (UperNet)","rank_in_archive_order":165,"of":235,"metrics":{"Validation mIoU":"47.2"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-ade20k-val","task":"Semantic Segmentation","dataset":"ADE20K val","model":"DiNAT-L (Mask2Former)","rank_in_archive_order":17,"of":95,"metrics":{"mIoU":"58.1"},"uses_additional_data":false},{"leaderboard":"/sota/semantic-segmentation-on-cityscapes-val","task":"Semantic Segmentation","dataset":"Cityscapes val","model":"DiNAT-L (Mask2Former)","rank_in_archive_order":15,"of":99,"metrics":{"mIoU":"84.5"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2209.15001","atlas_url":"https://app.syntology.ai/?focus=2209.15001","mcp":null,"developers":"https://syntology.ai/developers","held":true,"reason":"arxiv_id_in_atlas","checked_against":{"atlas_ids":549449,"atlas_ids_sha256":"afd72399dafd9906e9062927f70655952385a3d75488558e1f0484e950ab09b7","read_at":"2026-10-05T01:46:21Z"},"agent_calls":[{"tool":"get_citation_path","arguments":{"paper_1":"2209.15001"},"arguments_in":{"paper_2":"another paper's arXiv id or title"},"call":"get_citation_path(paper_1=\"2209.15001\", paper_2=\"…\")"},{"tool":"get_concepts_for_paper","arguments":{"arxiv_id":"2209.15001"},"call":"get_concepts_for_paper(arxiv_id=\"2209.15001\")"}],"by_repo":[{"repo":"SHI-Labs/Neighborhood-Attention-Transformer","kind":"official","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":1,"harvested_for":["2211.05770"],"harvested_for_calls":[{"arxiv_id":"2211.05770","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2211.05770"},"call":"get_harvested_code_for_paper(arxiv_id=\"2211.05770\")"}]},{"repo":"shi-labs/natten","kind":"official","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":1,"harvested_for":["2403.04690"],"harvested_for_calls":[{"arxiv_id":"2403.04690","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2403.04690"},"call":"get_harvested_code_for_paper(arxiv_id=\"2403.04690\")"}]},{"repo":"alexmehta/nac-tcn-tcns-with-causal-na","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0},{"repo":"huggingface/transformers","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":4,"harvested_for":["1706.03762","1910.03771","2006.03654","2010.01057"],"harvested_for_calls":[{"arxiv_id":"1706.03762","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"1706.03762"},"call":"get_harvested_code_for_paper(arxiv_id=\"1706.03762\")"},{"arxiv_id":"1910.03771","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"1910.03771"},"call":"get_harvested_code_for_paper(arxiv_id=\"1910.03771\")"},{"arxiv_id":"2006.03654","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2006.03654"},"call":"get_harvested_code_for_paper(arxiv_id=\"2006.03654\")"},{"arxiv_id":"2010.01057","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2010.01057"},"call":"get_harvested_code_for_paper(arxiv_id=\"2010.01057\")"}]},{"repo":"MindSpore-scientific/code-10","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":1,"harvested_for":["2412.20404"],"harvested_for_calls":[{"arxiv_id":"2412.20404","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2412.20404"},"call":"get_harvested_code_for_paper(arxiv_id=\"2412.20404\")"}]},{"repo":"MindSpore-scientific/code-8","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":1,"harvested_for":["2410.09754"],"harvested_for_calls":[{"arxiv_id":"2410.09754","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2410.09754"},"call":"get_harvested_code_for_paper(arxiv_id=\"2410.09754\")"}]},{"repo":"leondgarse/keras_cv_attention_models","kind":"listed","samples":0,"ran":0,"instrument":0,"unverified":0,"harvested_for_other_papers":1,"harvested_for":["2307.09283"],"harvested_for_calls":[{"arxiv_id":"2307.09283","tool":"get_harvested_code_for_paper","arguments":{"arxiv_id":"2307.09283"},"call":"get_harvested_code_for_paper(arxiv_id=\"2307.09283\")"}]}],"by_repo_harvested_for_is":"harvested_for: the arXiv ids (as Syntology's graph holds them) of every paper whose samples Syntology's graph links to this repository, in arXiv-id order, complete; the page names the first 3 and says how many more. A link only: it does not say the papers are the same work, that one copied the other, or that the code implements this paper's method; harvested_for_calls gives the get_harvested_code_for_paper call for each arXiv-shaped id among them","by_repo_is":"one row per repository in the archive's code links, Syntology's graph links or the samples; samples 0 means no sample is linked to this paper, a statement about Syntology's coverage, not about the repository: with harvested_for_other_papers present, Syntology harvested the repository for that many other papers, and without it, Syntology harvested nothing from it; placed_by_identical_code counts samples whose link records no repository, placed here because identical code was harvested from this repository for another paper; ran counts executions on a synthesized input and instrument counts failures of Syntology's instrument, not of the code"},"code_links_note":null,"arxiv_metadata":null,"syntology_extracted_results":null,"record_sha256":"e2009ff70a5f46dac952ca4370e357b0f6a0492a1404ac75a4a3fd4fbe71de6e","record_changed_at":"2026-09-28","record_changed_at_basis":"first_hashed"}