Papers › RegionViT: Regional-to-Local Attention for Vision Transformers

RegionViT: Regional-to-Local Attention for Vision Transformers

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

Chun-Fu Chen, Rameswar Panda, Quanfu Fan

Vision transformer (ViT) has recently shown its strong capability in achieving comparable results to convolutional neural networks (CNNs) on image classification. However, vanilla ViT simply inherits the same architecture from the natural language processing directly, which is often not optimized for vision applications. Motivated by this, in this paper, we propose a new architecture that adopts the pyramid structure and employ a novel regional-to-local attention rather than global self-attention in vision transformers. More specifically, our model first generates regional tokens and local tokens from an image with different patch sizes, where each regional token is associated with a set of local tokens based on the spatial location. The regional-to-local attention includes two steps: first, the regional self-attention extract global information among all regional tokens and then the local self-attention exchanges the information among one regional token and the associated local tokens via self-attention. Therefore, even though local self-attention confines the scope in a local region but it can still receive global information. Extensive experiments on four vision tasks, including image classification, object and keypoint detection, semantics segmentation and action recognition, show that our approach outperforms or is on par with state-of-the-art ViT variants including many concurrent works. Our source codes and models are available at https://github.com/ibm/regionvit.

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 25 code samples harvested from 3 repositories linked to this paper: 13 ran (of which 9 constructed an object rather than computing a result; 11 with no instrument failure: 1 honoured, 1 violated, 9 with no contract checked; 2 where Syntology's instrument failed) · 12 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 9 samples from 1 repository, 6 ran (5 with no instrument failure; 1 where Syntology's instrument failed); community (archive-listed): 16 samples from 2 repositories, 7 ran (6 with no instrument failure; 1 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.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 13 samples that ran has no recorded date.

IBM/RegionViT officialmentioned in papermentioned on GitHubpytorchSyntology: 9 samples, 6 ran (1 instrument-failed) · 3 unverified report
conceptofmind/Region-ViT-flax mentioned on GitHubjaxSyntology: 7 samples, 1 ran (0 instrument-failed) · 6 unverified report
dc3ea9f/RegionViT mentioned on GitHubpytorchSyntology: 9 samples, 6 ran (1 instrument-failed) · 3 unverified report
gitlab.com/birder/birder pytorchSyntology: not harvested 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

25 samples harvested: 13 ran (of which 9 constructed an object rather than computing a result; 11 with no instrument failure: 1 honoured, 1 violated, 9 with no contract checked; 2 where Syntology's instrument failed) · 12 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
1ran · violated contract
1ran · our draft was wrong
1ran; the contract check could not run
9ran
12unverified

Licence: 0 of the 25 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 3 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 6 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.

IBM/RegionViT official repository 9 samples, 6 ran (1 instrument-failed) · 3 unverified
AttentionWithRelPos regionvit/regionvit.py ran Apache-2.0 (permissive) · c7197ed401e12d9c · report fixture: returned AttentionWithRelPos · level recorded 2026-09-22
LayerNorm2d in 18 papers regionvit/regionvit.py ran fingerprinted Apache-2.0 (permissive) · fb988c11d14bdbfc · report fixture: returned LayerNorm2d · level recorded 2026-09-22
PatchEmbed in 123 papers
census: 9 implementations from 9 papers, 6 distinct outputs on one shared input
regionvit/regionvit.py ran Apache-2.0 (permissive) · 6688b31853ed31b4 · report fixture: returned PatchEmbed · level recorded 2026-09-22
Projection in 10 papers regionvit/regionvit.py ran fingerprinted Apache-2.0 (permissive) · 54d188ee9d7b46be · report fixture: returned Projection · level recorded 2026-09-22
R2LAttentionPlusFFN regionvit/regionvit.py ran Apache-2.0 (permissive) · eb1f3e402e1dc74c · report fixture: returned R2LAttentionPlusFFN · level recorded 2026-09-22
convert_to_flatten_layout regionvit/regionvit.py ran; the contract check could not run (RAISES) · metamorphic tier: deterministic Apache-2.0 (permissive) · b3f0623f46fcc9af · report fixture: signature cls_tokens:Tensor/4/float, patch_tokens:Tensor/4/float, ws:int/0/int · returned tuple · level recorded, date not recorded
ConvAttBlock regionvit/regionvit.py unverified Apache-2.0 (permissive) · fbf61a6af6d13754 · report
RegionViT regionvit/regionvit.py unverified Apache-2.0 (permissive) · 9717421cdc52208a · report
convert_to_spatial_layout regionvit/regionvit.py unverified Apache-2.0 (permissive) · cc95bcc461e63789 · report
conceptofmind/Region-ViT-flax community (archive-listed) 7 samples, 1 ran (0 instrument-failed) · 6 unverified
divisible_by in 33 papers region_vit_flax.py ran · violated contract fingerprinted MIT (permissive) · cc47cc901f6ee6ea · report fixture: signature val:int/0/int, d:int/0/int · returned bool · level recorded 2026-09-22
Downsample in 58 papers region_vit_flax.py unverified MIT (permissive) · ddaf1aef43c3e9f2 · report
MLP in 375 papers region_vit_flax.py unverified MIT (permissive) · 4a180adb3206c763 · report
PEG in 5 papers region_vit_flax.py unverified MIT (permissive) · 701acfe4475d1a8d · report
R2LTransformer region_vit_flax.py unverified MIT (permissive) · 7b8ebb406d076c7a · report
RegionViT region_vit_flax.py unverified MIT (permissive) · eda0483677e50eae · report
dc3ea9f/RegionViT community (archive-listed) 9 samples, 6 ran (1 instrument-failed) · 3 unverified
DropPath in 75 papers
census: 17 implementations from 17 papers, 8 distinct outputs across 3 buckets, one shared input per bucket
models/region_vit.py ran fingerprinted MIT (permissive) · 67186f084bc62090 · report fixture: returned DropPath · level recorded 2026-09-22
MultiHeadSelfAttention in 17 papers models/region_vit.py ran MIT (permissive) · 02fc42edbfdbea41 · report fixture: returned MultiHeadSelfAttention · level recorded 2026-09-22
PatchEmbed in 123 papers
census: 9 implementations from 9 papers, 6 distinct outputs on one shared input
models/region_vit.py ran MIT (permissive) · bc7dfc56f71e7a9b · report fixture: returned PatchEmbed · level recorded 2026-09-22
PatchMerging in 31 papers models/region_vit.py ran MIT (permissive) · 77415c05ec9a1664 · report fixture: returned PatchMerging · level recorded 2026-09-22
get_2d_relative_position_index models/region_vit.py ran · honoured contract fingerprinted MIT (permissive) · 0936ade4b0df66b9 · report fixture: signature H:int/0/int, W:int/0/int · returned Tensor · level recorded 2026-09-22
remap_position_index models/region_vit.py ran · our draft was wrong MIT (permissive) · b572c48319c37542 · report fixture: signature position_index:Tensor/2/int, shift:int/0/int · returned tuple · level recorded 2026-09-22
BasicLayer in 56 papers models/region_vit.py unverified MIT (permissive) · 23ae2961428275c4 · report
R2LEncoderBlock models/region_vit.py unverified MIT (permissive) · 90fc7131c656ed6b · report
RegionViT models/region_vit.py unverified MIT (permissive) · d872e0d4743209a6 · report

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.

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

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

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

one of 3 siblings

  1. RegionViT entry · level 0 · unverified · d872e0d4743209a6
  2. BasicLayer model · level 0 · unverified · 23ae2961428275c4
  3. PatchEmbed model · level 1 · ran · bc7dfc56f71e7a9b
  4. PatchMerging model · level 1 · ran · 77415c05ec9a1664
  5. R2LEncoderBlock model · level 0 · unverified · 90fc7131c656ed6b
  6. DropPath helper · level 1 · ran · 67186f084bc62090
  7. Mlp model · level 1 · ran · a1715055832f71fd
  8. MultiHeadSelfAttention model · level 1 · ran · 02fc42edbfdbea41
  9. window_partition helper · level 2 · ran; the contract check could not run · 144d10b49baeb8a6
  10. window_reverse helper · level 1 · ran · our draft was wrong · 61bf152e6a42a184
  11. get_2d_relative_position_index helper · level 1 · ran · honoured contract · 0936ade4b0df66b9
  12. remap_position_index helper · level 1 · ran · our draft was wrong · b572c48319c37542

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

one of 3 siblings

  1. RegionViT entry · level 0 · unverified · 9717421cdc52208a
  2. ConvAttBlock model · level 0 · unverified · fbf61a6af6d13754
  3. LayerNorm2d helper · level 1 · ran · fb988c11d14bdbfc
  4. PatchEmbed model · level 1 · ran · 6688b31853ed31b4
  5. Projection model · level 1 · ran · 54d188ee9d7b46be
  6. R2LAttentionPlusFFN model · level 1 · ran · eb1f3e402e1dc74c
  7. convert_to_flatten_layout helper · level 1 · ran; the contract check could not run (RAISES) · b3f0623f46fcc9af
  8. convert_to_spatial_layout helper · level 0 · unverified · cc95bcc461e63789
  9. AttentionWithRelPos helper · level 1 · ran · c7197ed401e12d9c

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

one of 3 siblings

  1. RegionViT entry · level 0 · unverified · eda0483677e50eae
  2. Downsample model · level 0 · unverified · ddaf1aef43c3e9f2
  3. IdentityLayer helper · level 0 · unverified · e38ae21b52d727dd
  4. PEG model · level 0 · unverified · 701acfe4475d1a8d
  5. R2LTransformer model · level 0 · unverified · 7b8ebb406d076c7a
  6. cast_tuple helper · level 1 · ran · honoured contract · f70dcb896366697c
  7. divisible_by helper · level 1 · ran · violated contract · cc47cc901f6ee6ea
  8. Attention model · level 0 · unverified · 43d3378c696e6de4
  9. MLP model · level 0 · unverified · 4a180adb3206c763
  10. exists helper · level 1 · ran · violated contract · aa5486a3650902d8

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="2106.02689") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Action RecognitionImage ClassificationKeypoint DetectionObject Detectionimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Introduced by this paper: RegionViT

RegionViT

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