arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.06014cs.LG
收藏

门控SwinRMT:通过输入依赖门控统一Swin窗口注意力与保留曼哈顿衰减

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

Yogoda Satsanga Palpara Mahavidyalaya(尤高达·萨桑加·帕尔帕拉学院);Prabhat Kumar College(普拉巴特·库马尔学院)

Dipan Maity, Suman Mondal, Arindam Roy

AI总结:

本文提出Gated-SwinRMT,结合Swin Transformer的滑动窗口注意力与Retentive Networks的曼哈顿距离空间衰减,并通过输入依赖门控统一两者。核心方法将自注意力分解为连续的宽度和高度保留传递,利用指数衰减掩码提供二维局部性先验。

摘要:

我们介绍了Gated-SwinRMT,一种结合Swin Transformer的滑动窗口注意力与Retentive Networks(RMT)的曼哈顿距离空间衰减的混合视觉Transformer,通过输入依赖门控增强。自注意力被分解为每个滑动窗口内连续的宽度和高度保留传递,其中每个头的指数衰减掩码提供二维局部性先验,而无需学习位置偏差。提出了两种变体:Gated-SwinRMT-SWAT用sigmoid激活替代softmax,实现平衡的ALiBi斜率并利用乘法后激活空间衰减,通过SwiGLU门控值投影;正常输出隐式抑制不相关信息的注意力分数。Gated-SwinRMT-Retention保留softmax归一化的保留并加入加性对数空间衰减偏置,同时引入显式的G1 sigmoid门控——从块输入投影并应用于局部上下文增强(LCE)后但早于输出投影$W_O$——以缓解低秩$W_V \cdot W_O$瓶颈并使输入依赖的注意力输出抑制。在Mini-ImageNet(224×224,100类)和CIFAR-10(32×32,10类)上评估两种变体,使用单块GPU进行训练。在约77-79百万参数时,Gated-SwinRMT-SWAT在Mini-ImageNet上达到80.22%的top-1测试准确率,相比RMT基线73.74%有所提升;在CIFAR-10上,由于小特征图导致自适应窗口机制将注意力坍缩到全局范围,准确率优势从+6.48个百分点压缩到+0.56个百分点。

英文摘要:

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. \textbf{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~$W_O$ -- to alleviate the low-rank $W_V \!\cdot\! W_O$ bottleneck and enable input-dependent suppression of attended outputs. We assess both variants on Mini-ImageNet ($224{\times}224$, 100 classes) and CIFAR-10 ($32{\times}32$, 10 classes) under identical training protocols, utilizing a single GPU due to resource limitations. At ${\approx}77$--$79$\,M parameters, Gated-SwinRMT-SWAT achieves $80.22\%$ and Gated-SwinRMT-Retention $78.20\%$ top-1 test accuracy on Mini-ImageNet, compared with $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$\,pp to $+0.56$\,pp.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑