{"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/counterfactual-multi-agent-policy-gradients","title":"Counterfactual Multi-Agent Policy Gradients","arxiv_id":"1705.08926","date":"2017-05-24","proceeding":null,"authors":["Jakob Foerster","Gregory Farquhar","Triantafyllos Afouras","Nantas Nardelli","Shimon Whiteson"],"abstract":"Cooperative multi-agent systems can be naturally used to model many real world problems, such as network packet routing and the coordination of autonomous vehicles. There is a great need for new reinforcement learning methods that can efficiently learn decentralised policies for such systems. To this end, we propose a new multi-agent actor-critic method called counterfactual multi-agent (COMA) policy gradients. COMA uses a centralised critic to estimate the Q-function and decentralised actors to optimise the agents' policies. In addition, to address the challenges of multi-agent credit assignment, it uses a counterfactual baseline that marginalises out a single agent's action, while keeping the other agents' actions fixed. COMA also uses a critic representation that allows the counterfactual baseline to be computed efficiently in a single forward pass. We evaluate COMA in the testbed of StarCraft unit micromanagement, using a decentralised variant with significant partial observability. COMA significantly improves average performance over other multi-agent actor-critic methods in this setting, and the best performing agents are competitive with state-of-the-art centralised controllers that get access to the full state.","url_abs":"https://arxiv.org/abs/1705.08926v3","url_pdf":"https://arxiv.org/pdf/1705.08926v3.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":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/TonghanWang/NDQ","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/gingkg/smac","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/hanhanAnderson/LSF-SAC","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/matteokarldonati/Counterfactual-Multi-Agent-Policy-Gradients","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/nice-hku/cl2marl-smac","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/puyuan1996/MARL","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"counterfactual-multi-agent-policy-gradients","repo_url":"https://github.com/opendilab/DI-engine/blob/main/ding/policy/coma.py","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"autonomous-vehicles","task_name":"Autonomous Vehicles"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"smac-1","task_name":"SMAC+"},{"task_slug":"starcraft","task_name":"Starcraft"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/smac-on-smac-def-armored-parallel","task":"SMAC+","dataset":"Def_Armored_parallel","model":"COMA","rank_in_archive_order":7,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-def-armored-sequential","task":"SMAC+","dataset":"Def_Armored_sequential","model":"COMA","rank_in_archive_order":9,"of":11,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-def-infantry-parallel","task":"SMAC+","dataset":"Def_Infantry_parallel","model":"COMA","rank_in_archive_order":6,"of":10,"metrics":{"Median Win Rate":"50.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-def-infantry-sequential","task":"SMAC+","dataset":"Def_Infantry_sequential","model":"COMA","rank_in_archive_order":11,"of":11,"metrics":{"Median Win Rate":"28.1"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-def-outnumbered-parallel","task":"SMAC+","dataset":"Def_Outnumbered_parallel","model":"COMA","rank_in_archive_order":5,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-def-outnumbered-sequential","task":"SMAC+","dataset":"Def_Outnumbered_sequential","model":"COMA","rank_in_archive_order":5,"of":11,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-complicated-parallel","task":"SMAC+","dataset":"Off_Complicated_parallel","model":"COMA","rank_in_archive_order":5,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-complicated-sequential","task":"SMAC+","dataset":"Off_Complicated_sequential","model":"COMA","rank_in_archive_order":3,"of":4,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-distant-parallel","task":"SMAC+","dataset":"Off_Distant_parallel","model":"COMA","rank_in_archive_order":4,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-distant-sequential","task":"SMAC+","dataset":"Off_Distant_sequential","model":"COMA","rank_in_archive_order":3,"of":4,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-hard-parallel","task":"SMAC+","dataset":"Off_Hard_parallel","model":"COMA","rank_in_archive_order":4,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-hard-sequential","task":"SMAC+","dataset":"Off_Hard_sequential","model":"COMA","rank_in_archive_order":4,"of":4,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-near-parallel","task":"SMAC+","dataset":"Off_Near_parallel","model":"COMA","rank_in_archive_order":4,"of":10,"metrics":{"Median Win Rate":"20.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-near-sequential","task":"SMAC+","dataset":"Off_Near_sequential","model":"COMA","rank_in_archive_order":4,"of":4,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-superhard-parallel","task":"SMAC+","dataset":"Off_Superhard_parallel","model":"COMA","rank_in_archive_order":2,"of":10,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false},{"leaderboard":"/sota/smac-on-smac-off-superhard-sequential","task":"SMAC+","dataset":"Off_Superhard_sequential","model":"COMA","rank_in_archive_order":2,"of":4,"metrics":{"Median Win Rate":"0.0"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1705.08926","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1705.08926"}},"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/opendilab/DI-engine/blob/main/ding/policy/coma.py","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hanhanAnderson/LSF-SAC","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/puyuan1996/MARL","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/TonghanWang/NDQ","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gingkg/smac","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nice-hku/cl2marl-smac","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/matteokarldonati/Counterfactual-Multi-Agent-Policy-Gradients","reach":null}],"summary":{"ran_draft_wrong":1},"by_repo_kind":{"listed":{"samples":1,"ran":1,"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":1,"samples":[{"code_sha256_prefix":"86c01369f50fdee8","entry":"moving_average","repo":"matteokarldonati/Counterfactual-Multi-Agent-Policy-Gradients","repo_kind":"listed","path":"training_loop.py","file_url":"https://github.com/matteokarldonati/Counterfactual-Multi-Agent-Policy-Gradients/blob/HEAD/training_loop.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"86c01369f50fdee8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}