{"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/hypothetical-minds-scaffolding-theory-of-mind","title":"Hypothetical Minds: Scaffolding Theory of Mind for Multi-Agent Tasks with Large Language Models","arxiv_id":"2407.07086","date":"2024-07-09","proceeding":null,"authors":["Logan Cross","Violet Xiang","Agam Bhatia","Daniel LK Yamins","Nick Haber"],"abstract":"Multi-agent reinforcement learning (MARL) methods struggle with the non-stationarity of multi-agent systems and fail to adaptively learn online when tested with novel agents. Here, we leverage large language models (LLMs) to create an autonomous agent that can handle these challenges. Our agent, Hypothetical Minds, consists of a cognitively-inspired architecture, featuring modular components for perception, memory, and hierarchical planning over two levels of abstraction. We introduce the Theory of Mind module that scaffolds the high-level planning process by generating hypotheses about other agents' strategies in natural language. It then evaluates and iteratively refines these hypotheses by reinforcing hypotheses that make correct predictions about the other agents' behavior. Hypothetical Minds significantly improves performance over previous LLM-agent and RL baselines on a range of competitive, mixed motive, and collaborative domains in the Melting Pot benchmark, including both dyadic and population-based environments. Additionally, comparisons against LLM-agent baselines and ablations reveal the importance of hypothesis evaluation and refinement for succeeding on complex scenarios.","url_abs":"https://arxiv.org/abs/2407.07086v2","url_pdf":"https://arxiv.org/pdf/2407.07086v2.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":"hypothetical-minds-scaffolding-theory-of-mind","repo_url":"https://github.com/locross93/hypothetical-minds","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"multi-agent-reinforcement-learning","task_name":"Multi-agent Reinforcement Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2407.07086","atlas_url":"https://app.syntology.ai/?focus=2407.07086","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.07086"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/locross93/hypothetical-minds","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"unverified":1},"by_repo_kind":{"official":{"samples":9,"ran":8,"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":0,"samples":[{"code_sha256_prefix":"23cb6c922e448035","entry":"build_grid_from_states","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/collaborative_cooking__asymmetric.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/collaborative_cooking__asymmetric.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23cb6c922e448035"}},{"code_sha256_prefix":"35fe3ab85ed460a7","entry":"check_plan_one_step","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/collaborative_cooking__asymmetric.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/collaborative_cooking__asymmetric.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"35fe3ab85ed460a7"}},{"code_sha256_prefix":"03d1701bcc7f74f8","entry":"heuristic","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"llm_plan/agent/action_funcs.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/llm_plan/agent/action_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03d1701bcc7f74f8"}},{"code_sha256_prefix":"57e8e1d997e85ad3","entry":"make_plan_grid","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/prisoners_dilemma_in_the_matrix__repeated.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/prisoners_dilemma_in_the_matrix__repeated.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"57e8e1d997e85ad3"}},{"code_sha256_prefix":"619dd983b7fdcbf8","entry":"make_plan_grid","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/running_with_scissors_in_the_matrix__arena.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/running_with_scissors_in_the_matrix__arena.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"619dd983b7fdcbf8"}},{"code_sha256_prefix":"66406aa32d538673","entry":"make_plan_grid","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/running_with_scissors_in_the_matrix__repeated.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/running_with_scissors_in_the_matrix__repeated.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"66406aa32d538673"}},{"code_sha256_prefix":"039a1ae74573e452","entry":"move_to","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"llm_plan/agent/action_funcs.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/llm_plan/agent/action_funcs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"039a1ae74573e452"}},{"code_sha256_prefix":"b3027990b41faa44","entry":"wait_for_pot","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"environments/collaborative_cooking__asymmetric.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/environments/collaborative_cooking__asymmetric.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b3027990b41faa44"}},{"code_sha256_prefix":"6d9a311015cc512d","entry":"get_actions_from_path","repo":"locross93/hypothetical-minds","repo_kind":"official","path":"llm_plan/agent/action_funcs.py","file_url":"https://github.com/locross93/hypothetical-minds/blob/HEAD/llm_plan/agent/action_funcs.py","link_basis":"first_harvest_node","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":"6d9a311015cc512d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}