Methods › General › Attention Mechanisms › Global Sub-Sampled Attention
Global Sub-Sampled Attention
Introduced by Xiangxiang Chu et al. in Twins: Revisiting the Design of Spatial Attention in Vision Transformers
archive 2025-07-28 Description, source and code snippet are the archive's method entry.
Global Sub-Sampled Attention, or GSA, is a local attention mechanism used in the Twins-SVT architecture.
A single representative is used to summarize the key information for each of m ×n subwindows and the representative is used to communicate with other sub-windows (serving as the key in self-attention), which can reduce the cost to 𝒪(m n H W d)=𝒪((H² W² d)/(k₁ k₂)). This is essentially equivalent to using the sub-sampled feature maps as the key in attention operations, and thus it is termed global sub-sampled attention (GSA).
If we alternatively use the LSA and GSA like separable convolutions (depth-wise + point-wise). The total computation cost is 𝒪((H² W² d)/(k₁ k₂)+k₁ k₂ H W d) . We have:
(H² W² d)/(k₁ k₂)+k₁ k₂ H W d ≥2 H W d √(H W)
The minimum is obtained when k₁ ·k₂=√(H W). Note that H=W=224 is popular in classification. Without loss of generality, square sub-windows are used, i.e., k₁=k₂. Therefore, k₁=k₂=15 is close to the global minimum for H=W=224. However, the network is designed to include several stages with variable resolutions. Stage 1 has feature maps of 56 ×56, the minimum is obtained when k₁=k₂=√(56) ≈7. Theoretically, we can calibrate optimal k₁ and k₂ for each of the stages. For simplicity, k₁=k₂=7 is used everywhere. As for stages with lower resolutions, the summarizing window-size of GSA is controlled to avoid too small amount of generated keys. Specifically, the sizes of 4,2 and 1 are used for the last three stages respectively.
Papers archive 2025-07-28
2 shown of 2, newest first. Repository counts are the archive's code-links table. A Syntology line states what Syntology ran from that paper's harvested code; it is per sample and not a correctness claim.
-
Logically at Factify 2: A Multi-Modal Fact Checking System Based on Evidence Retrieval techniques and Transformer Encoder Architecture 9 Jan 2023 · 0 repositories · arXiv:2301.03127
-
Twins: Revisiting the Design of Spatial Attention in Vision Transformers 28 Apr 2021 · 9 repositories · arXiv:2104.13840Syntology ran 0 of 2 samples · 2 unverified · 2 pointer-only (licence)
Tasks archive 2025-07-28
7 tasks the archive attaches to papers tagged with this method, by distinct papers. A task without a page in the catalog is plain text.
| Task | Papers |
|---|---|
| Avg | 1 |
| Benchmarking | 1 |
| Fact Checking | 1 |
| Fact Verification | 1 |
| Image Classification | 1 |
| Retrieval | 1 |
| Semantic Segmentation | 1 |
Usage over time archive 2025-07-28
Components: the archive holds no method-to-method composition, so PwC's Components table cannot be rebuilt; the Papers list carries no Results column for the same reason (the archive does not join its leaderboard rows to method tags).
Categories archive 2025-07-28
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