{"url":"/method/re-attention-module","slug":"re-attention-module","name":"Re-Attention Module","full_name":"Re-Attention Module","full_name_withheld":false,"description_markdown":"The **Re-Attention Module** is an attention layer used in the [DeepViT](https://paperswithcode.com/method/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:\r\n\r\n$$\r\n\\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\r\n$$\r\n\r\nwhere transformation matrix $\\Theta$ is multiplied to the self-attention map $\\textbf{A}$ along the head dimension.","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":"https://arxiv.org/abs/2103.11886v4","title":"DeepViT: Towards Deeper Vision Transformer","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Attention Modules","url":"/methods/category/attention-modules","pwc_aliases":[]}],"n_papers_tagged":4,"archive_num_papers":null,"papers_newest_first":[{"paper":null,"title":"ODC-SA Net: Orthogonal Direction Enhancement and Scale Aware Network for Polyp Segmentation","date":"2024-05-10","arxiv_id":"2405.06191","n_code_links":0,"syntology":null},{"paper":null,"title":"Learning to Agree on Vision Attention for Visual Commonsense Reasoning","date":"2023-02-04","arxiv_id":"2302.02117","n_code_links":0,"syntology":null},{"paper":"/paper/sat-size-aware-transformer-for-3d-point-cloud","title":"SAT: Size-Aware Transformer for 3D Point Cloud Semantic Segmentation","date":"2023-01-17","arxiv_id":"2301.06869","n_code_links":0,"syntology":null},{"paper":"/paper/deepvit-towards-deeper-vision-transformer","title":"DeepViT: Towards Deeper Vision Transformer","date":"2021-03-22","arxiv_id":"2103.11886","n_code_links":5,"syntology":{"ran":1,"of":1,"unverified":0,"pointer_only":0}}],"papers_shown":4,"tasks":[{"task":"/task/image-classification","name":"Image Classification","papers":1},{"task":"/task/point-cloud-segmentation","name":"Point Cloud Segmentation","papers":1},{"task":"/task/representation-learning","name":"Representation Learning","papers":1},{"task":"/task/segmentation","name":"Segmentation","papers":1},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":1},{"task":"/task/visual-commonsense-reasoning","name":"Visual Commonsense Reasoning","papers":1},{"task":"/task/visual-reasoning","name":"Visual Reasoning","papers":1},{"task":"/task/image-classification","name":"image-classification","papers":1}],"tasks_shown":8,"n_tasks":8,"usage_by_year":[{"year":"2021","papers":1},{"year":"2023","papers":2},{"year":"2024","papers":1}],"row_source":"embedded","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/re-attention-module"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}