{"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/compositional-attention-networks-for-machine","title":"Compositional Attention Networks for Machine Reasoning","arxiv_id":"1803.03067","date":"2018-03-08","proceeding":"ICLR 2018 1","authors":["Drew A. Hudson","Christopher D. Manning"],"abstract":"We present the MAC network, a novel fully differentiable neural network\narchitecture, designed to facilitate explicit and expressive reasoning. MAC\nmoves away from monolithic black-box neural architectures towards a design that\nencourages both transparency and versatility. The model approaches problems by\ndecomposing them into a series of attention-based reasoning steps, each\nperformed by a novel recurrent Memory, Attention, and Composition (MAC) cell\nthat maintains a separation between control and memory. By stringing the cells\ntogether and imposing structural constraints that regulate their interaction,\nMAC effectively learns to perform iterative reasoning processes that are\ndirectly inferred from the data in an end-to-end approach. We demonstrate the\nmodel's strength, robustness and interpretability on the challenging CLEVR\ndataset for visual reasoning, achieving a new state-of-the-art 98.9% accuracy,\nhalving the error rate of the previous best model. More importantly, we show\nthat the model is computationally-efficient and data-efficient, in particular\nrequiring 5x less data than existing models to achieve strong results.","url_abs":"http://arxiv.org/abs/1803.03067v2","url_pdf":"http://arxiv.org/pdf/1803.03067v2.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":"compositional-attention-networks-for-machine","repo_url":"https://github.com/stanfordnlp/mac-network","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/Glaciohound/VCML","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/adlnlp/attention_vl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/ceyzaguirre4/DACT-MAC","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/ceyzaguirre4/mac-network-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/ivegner/Multi-Memory-MAC-Network","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/kakao/DAFT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/ronilp/mac-network-pytorch-gqa","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/rosinality/mac-network-pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"compositional-attention-networks-for-machine","repo_url":"https://github.com/tohinz/pytorch-mac-network","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"referring-expression-comprehension","task_name":"Referring Expression Comprehension"},{"task_slug":"visual-question-answering","task_name":"Visual Question Answering (VQA)"},{"task_slug":"visual-reasoning","task_name":"Visual Reasoning"}],"methods":[{"method_slug":"interpretability","method_name":"Interpretability"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/visual-question-answering-on-clevr","task":"Visual Question Answering (VQA)","dataset":"CLEVR","model":"MAC","rank_in_archive_order":7,"of":15,"metrics":{"Accuracy":"98.9"},"uses_additional_data":false},{"leaderboard":"/sota/visual-question-answering-on-clevr-humans","task":"Visual Question Answering (VQA)","dataset":"CLEVR-Humans","model":"MAC","rank_in_archive_order":2,"of":5,"metrics":{"Accuracy":"81.5"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1803.03067","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1803.03067"}},"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/kakao/DAFT","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ronilp/mac-network-pytorch-gqa","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/stanfordnlp/mac-network","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/adlnlp/attention_vl","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tohinz/pytorch-mac-network","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ceyzaguirre4/DACT-MAC","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ivegner/Multi-Memory-MAC-Network","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Glaciohound/VCML","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ceyzaguirre4/mac-network-pytorch","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rosinality/mac-network-pytorch","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"listed":{"samples":7,"ran":1,"repositories":4}},"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":0,"samples":[{"code_sha256_prefix":"1bb3fb76f5e3c485","entry":"linear","repo":"ronilp/mac-network-pytorch-gqa","repo_kind":"listed","path":"model.py","file_url":"https://github.com/ronilp/mac-network-pytorch-gqa/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1bb3fb76f5e3c485"}},{"code_sha256_prefix":"dc99e9ba297a65ae","entry":"collate_data","repo":"ceyzaguirre4/mac-network-pytorch","repo_kind":"listed","path":"dataset.py","file_url":"https://github.com/ceyzaguirre4/mac-network-pytorch/blob/HEAD/dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc99e9ba297a65ae"}},{"code_sha256_prefix":"3489d58eb80cf2c6","entry":"collate_data","repo":"rosinality/mac-network-pytorch","repo_kind":"listed","path":"dataset.py","file_url":"https://github.com/rosinality/mac-network-pytorch/blob/HEAD/dataset.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3489d58eb80cf2c6"}},{"code_sha256_prefix":"dbde19906ac732ed","entry":"forward","repo":"ceyzaguirre4/mac-network-pytorch","repo_kind":"listed","path":"image_feature.py","file_url":"https://github.com/ceyzaguirre4/mac-network-pytorch/blob/HEAD/image_feature.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dbde19906ac732ed"}},{"code_sha256_prefix":"b66152de2215de9b","entry":"load_MAC","repo":"tohinz/pytorch-mac-network","repo_kind":"listed","path":"code/mac.py","file_url":"https://github.com/tohinz/pytorch-mac-network/blob/HEAD/code/mac.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b66152de2215de9b"}},{"code_sha256_prefix":"928267eac64ad657","entry":"process_question","repo":"ceyzaguirre4/mac-network-pytorch","repo_kind":"listed","path":"preprocess.py","file_url":"https://github.com/ceyzaguirre4/mac-network-pytorch/blob/HEAD/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"928267eac64ad657"}},{"code_sha256_prefix":"6490066d39c2eafd","entry":"process_question","repo":"rosinality/mac-network-pytorch","repo_kind":"listed","path":"preprocess.py","file_url":"https://github.com/rosinality/mac-network-pytorch/blob/HEAD/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6490066d39c2eafd"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}