Gated Attention 论文阅读
论文:https://arxiv.org/abs/2505.06708
有效的门控位置
论文尝试了在attention的不同位置加入门控,发现在注意力输出后加入门控是最有效的。
一是引入非线性:在SDPA输出后添加门控,相当于在低秩线性映射中引入了非线性,增加了模型的表达能力。如论文所述:“introducing non-linearity through gating at positions G₁ or G₂ can increase the expressiveness of this low-rank linear transformation”
二是引入稀疏性:SDPA输出后的门控为注意力输出引入了输入依赖的稀疏性,这有助于消除"注意力汇聚"(attention sink)现象。