{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/couplformer-rethinking-vision-transformer","title":"Couplformer:Rethinking Vision Transformer with Coupling Attention Map","arxiv_id":"2112.05425","date":"2021-12-10","proceeding":null,"authors":["Hai Lan","Xihao Wang","Xian Wei"],"abstract":"With the development of the self-attention mechanism, the Transformer model has demonstrated its outstanding performance in the computer vision domain. However, the massive computation brought from the full attention mechanism became a heavy burden for memory consumption. Sequentially, the limitation of memory reduces the possibility of improving the Transformer model. To remedy this problem, we propose a novel memory economy attention mechanism named Couplformer, which decouples the attention map into two sub-matrices and generates the alignment scores from spatial information. A series of different scale image classification tasks are applied to evaluate the effectiveness of our model. The result of experiments shows that on the ImageNet-1k classification task, the Couplformer can significantly decrease 28% memory consumption compared with regular Transformer while accessing sufficient accuracy requirements and outperforming 0.92% on Top-1 accuracy while occupying the same memory footprint. As a result, the Couplformer can serve as an efficient backbone in visual tasks, and provide a novel perspective on the attention mechanism for researchers.","url_abs":"https://arxiv.org/abs/2112.05425v1","url_pdf":"https://arxiv.org/pdf/2112.05425v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"couplformer-rethinking-vision-transformer","repo_url":"https://github.com/wer010/Couplformer","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2112.05425","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.05425"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wer010/Couplformer","reach":null}],"summary":{"ran_fixture":3,"ran_honours":1,"ran":1,"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"official":{"samples":12,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":12,"samples":[{"code_sha256_prefix":"144d10b49baeb8a6","entry":"window_partition","repo":"wer010/Couplformer","repo_kind":"official","path":"src/swin.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/swin.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"144d10b49baeb8a6"}},{"code_sha256_prefix":"d5edbca041111ce3","entry":"accuracy","repo":"wer010/Couplformer","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/evaluate.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d5edbca041111ce3"}},{"code_sha256_prefix":"3bca64f194bf9a4c","entry":"cls_validate","repo":"wer010/Couplformer","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/evaluate.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3bca64f194bf9a4c"}},{"code_sha256_prefix":"6a41f5e3194a54b1","entry":"count_parameters","repo":"wer010/Couplformer","repo_kind":"official","path":"ddp_train.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/ddp_train.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6a41f5e3194a54b1"}},{"code_sha256_prefix":"6bb7492655ecbda4","entry":"drop_path","repo":"wer010/Couplformer","repo_kind":"official","path":"src/utils/stochastic_depth.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/utils/stochastic_depth.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6bb7492655ecbda4"}},{"code_sha256_prefix":"61bf152e6a42a184","entry":"window_reverse","repo":"wer010/Couplformer","repo_kind":"official","path":"src/swin.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/swin.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"61bf152e6a42a184"}},{"code_sha256_prefix":"a05e508be34863c6","entry":"cct_sd","repo":"wer010/Couplformer","repo_kind":"official","path":"src/cct.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/cct.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a05e508be34863c6"}},{"code_sha256_prefix":"24bd7de1ce705a4b","entry":"kct_sd","repo":"wer010/Couplformer","repo_kind":"official","path":"src/kct.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/kct.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"24bd7de1ce705a4b"}},{"code_sha256_prefix":"3c241ecfe3749a6d","entry":"simple_accuracy","repo":"wer010/Couplformer","repo_kind":"official","path":"ddp_train.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/ddp_train.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3c241ecfe3749a6d"}},{"code_sha256_prefix":"59cf6b7b765b5627","entry":"vic_10","repo":"wer010/Couplformer","repo_kind":"official","path":"src/vic.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/vic.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"59cf6b7b765b5627"}},{"code_sha256_prefix":"438fd905dba1403f","entry":"vic_6","repo":"wer010/Couplformer","repo_kind":"official","path":"src/vic.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/vic.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"438fd905dba1403f"}},{"code_sha256_prefix":"2241f1a5c5f4a2c2","entry":"vic_sd","repo":"wer010/Couplformer","repo_kind":"official","path":"src/vic.py","file_url":"https://github.com/wer010/Couplformer/blob/HEAD/src/vic.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2241f1a5c5f4a2c2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}