cs.LGApr 7, 2026

Gated-SwinRMT: Unifying Swin Windowed Attention with Retentive Manhattan Decay via Input-Dependent Gating

Authors: Dipan Maity, Suman Mondal, Arindam Roy

Organizations: Student Kolkata, West Bengal, India · Department of Computer Science Yogoda Satsanga Palpara Mahavidyalaya West Bengal, India · Department of Computer Science & Application Prabhat Kumar College Contai West Bengal, India

Abstract

We introduce Gated-SwinRMT, a family of hybrid vision transformers that combine the shifted-window attention of the Swin Transformer with the Manhattan-distance spatial decay of Retentive Networks (RMT), augmented by input-dependent gating. Self-attention is decomposed into consecutive width-wise and height-wise retention passes within each shifted window, where per-head exponential decay masks provide a two-dimensional locality prior without learned positional biases. Two variants are proposed.Gated-SwinRMT-SWAT substitutes softmax with sigmoid activation, implements balanced ALiBi slopes with multiplicative post-activation spatial decay, and gates the value projection via SwiGLU; the Normalized output implicitly suppresses uninformative attention scores. Gated-SwinRMT-Retention retains softmax-normalized retention with an additive log-space decay bias and incorporates an explicit G1 sigmoid gate -- projected from the block input and applied after local context enhancement (LCE) but prior to the output projection~WOW_O -- to alleviate the low-rank WV ⁣⋅ ⁣WOW_V \!\cdot\! W_O bottleneck and enable input-dependent suppression of attended outputs. We assess both variants on Mini-ImageNet (224×224224{\times}224, 100 classes) and CIFAR-10 (32×3232{\times}32, 10 classes) under identical training protocols, utilizing a single GPU due to resource limitations. At ≈77{\approx}77--7979,M parameters, Gated-SwinRMT-SWAT achieves 80.22%80.22\% and Gated-SwinRMT-Retention 78.20%78.20\% top-1 test accuracy on Mini-ImageNet, compared with 73.74%73.74\% for the RMT baseline. On CIFAR-10 -- where small feature maps cause the adaptive windowing mechanism to collapse attention to global scope -- the accuracy advantage compresses from +6.48+6.48,pp to +0.56+0.56,pp.

Figures & tables

Explore similar work

CardsList
  1. FLASHSWIN: Unlocking Large Windows and Dense Tokens in Swin Vision Transformers with Memory Efficient Attention

    Oct 3, 2026Tushar Kataria, Gerald Sabin, Ponnuswamy Sadayappan +1Vision TransformerEfficient ViTs

  2. Rethinking Vision Architectures with Gated Linear Attention and KAN

    Sep 18, 2026Ali Mehizel, Oussama KhaldiVisual Representation LearningVision Transformer

  3. Gated Spatial Redundancy Projection for Pathology Transformer Attentions

    Aug 8, 2026Zhiyuan Yang, Jiahao Cheng, Vincent Quoc-Huy Trinh +1Cancer Survival PredictionSelf-Attention