{"url":"/method/shuffle-t","slug":"shuffle-t","name":"Shuffle-T","full_name":"Shuffle Transformer","full_name_withheld":false,"description_markdown":"The **Shuffle Transformer Block** consists of the Shuffle Multi-Head Self-Attention module (ShuffleMHSA), the Neighbor-Window Connection module (NWC), and the MLP module. To introduce cross-window connections while maintaining the efficient computation of non-overlapping windows, a strategy which alternates between WMSA and Shuffle-WMSA in consecutive Shuffle Transformer blocks is proposed. The first window-based transformer block uses regular window partition strategy and the second window-based transformer block uses window-based selfattention with spatial shuffle. Besides, the Neighbor-Window Connection moduel (NWC) is added into each block for enhancing connections among neighborhood windows. Thus the proposed shuffle transformer block could build rich cross-window connections and augments representation. Finally, the consecutive Shuffle Transformer blocks are computed as:\r\n\r\n$$ x^{l}=\\mathbf{W M S A}\\left(\\mathbf{B N}\\left(z^{l-1}\\right)\\right)+z^{l-1} $$\r\n\r\n$$ y^{l}=\\mathbf{N W C}\\left(x^{l}\\right)+x^{l} $$\r\n\r\n$$ z^{l}=\\mathbf{M L P}\\left(\\mathbf{B N}\\left(y^{l}\\right)\\right)+y^{l} $$\r\n\r\n$$ x^{l+1}=\\mathbf{S h u f f l e - W M S A}\\left(\\mathbf{B N}\\left(z^{l}\\right)\\right)+z^{l} $$\r\n\r\n$$ y^{l+1}=\\mathbf{N W C}\\left(x^{l+1}\\right)+x^{l+1} $$\r\n\r\n$$ z^{l+1}=\\mathbf{M L P}\\left(\\mathbf{B N}\\left(y^{l+1}\\right)\\right)+y^{l+1} $$\r\n\r\nwhere $x^l$, $y^l$ and $z^l$ denote the output features of the (Shuffle-)WMSA module, the Neighbor-Window Connection module and the MLP module for block $l$, respectively; WMSA and Shuffle-WMSA denote\r\nwindow-based multi-head self-attention without/with spatial shuffle, respectively.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer","paper":"/paper/shuffle-transformer-rethinking-spatial","first_author":"Zilong Huang","n_authors":6,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/shuffle-transformer-rethinking-spatial"},"source":{"url":"https://arxiv.org/abs/2106.03650v1","title":"Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"Computer Vision","area_id":"computer-vision","collection":"Vision Transformers","url":"/methods/category/vision-transformers","pwc_aliases":["vision-transformer"]}],"n_papers_tagged":1,"archive_num_papers":1,"papers_newest_first":[{"paper":"/paper/shuffle-transformer-rethinking-spatial","title":"Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer","date":"2021-06-07","arxiv_id":"2106.03650","n_code_links":4,"syntology":{"ran":5,"of":12,"unverified":7,"pointer_only":0}}],"papers_shown":1,"tasks":[{"task":"/task/image-classification","name":"Image Classification","papers":1},{"task":"/task/object-detection","name":"Object Detection","papers":1},{"task":"/task/segmentation","name":"Segmentation","papers":1},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":1},{"task":"/task/image-classification","name":"image-classification","papers":1},{"task":"/task/object-detection-1","name":"object-detection","papers":1}],"tasks_shown":6,"n_tasks":6,"usage_by_year":[{"year":"2021","papers":1}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/shuffle-t"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}