AICurious Logo

What is: Re-Attention Module?

SourceDeepViT: Towards Deeper Vision Transformer
Year2000
Data SourceCC BY-SA - https://paperswithcode.com

The Re-Attention Module is an attention layer used in the DeepViT architecture which mixes the attention map with a learnable matrix before multiplying with the values. The motivation is to re-generate the attention maps to increase their diversity at different layers with negligible computation and memory cost. The authors note that traditional self-attention fails to learn effective concepts for representation learning in deeper layers of ViT -- attention maps become more similar and less diverse in deeper layers (attention collapse) - and this hinders the model from getting expected performance gain. Re-attention is implemented by:

ReAttention(Q,K,V)=Norm(Θ(Softmax(QKd)))V\operatorname{Re}-\operatorname{Attention}(Q, K, V)=\operatorname{Norm}\left(\Theta^{\top}\left(\operatorname{Softmax}\left(\frac{Q K^{\top}}{\sqrt{d}}\right)\right)\right) V

where transformation matrix Θ\Theta is multiplied to the self-attention map A\textbf{A} along the head dimension.