{"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/arxiv-2605-30880","title":"PatchWorld: Gradient-Free Optimization of Executable World Models for Agent Environments","arxiv_id":"2605.30880","date":"2026-05-29","proceeding":null,"authors":["Jiaxin Bai","Yue Guo","Yifei Dong","Jiaxuan Xiong","Tianshi Zheng","Yixia Li","Tianqing Fang","Yufei Li","Yisen Gao","Haoyu Huang","Zhongwei Xie","Hong Ting Tsang","Zihao Wang","Lihui Liu","Jeff Z. Pan","Yangqiu Song"],"abstract":"World models for interactive text agents must typically be learned from observation-action trajectories alone. Specifically, the environment returns text observations after each action, but does not expose a ground-truth latent state nor an inspectable transition model.A research gap remains in how to induce executable code as a world model in this black-box setting for prediction and agent decision making. We introduce PatchWorld, a gradient-free framework that turns offline trajectories into executable Python world models through counterexample-guided code repair.Instead of predicting the next observation with a black-box model, PatchWorld induces symbolic belief-state programs whose action updates can be inspected, replayed, and locally patched. Across seven AgentGym environments, PatchWorld-Simple achieves the highest code-based decision-making score among evaluated methods (76.4% macro success in live one-step lookahead), matching or exceeding LLM-based lookahead while invoking no LLM calls inside the world-model prediction module itself. We further find that a human-specified residual-memory bias improves surface observation fidelity but weakens agent decision-making utility. This reveals a tradeoff in executable world models, since improving observation fidelity can come at the expense of action-discriminative dynamics, and vice versa. Code is available at https://github.com/HKBU-KnowComp/PatchWorld.","url_abs":"https://arxiv.org/abs/2605.30880","url_pdf":"https://arxiv.org/pdf/2605.30880","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.30880","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.30880"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/HKBU-KnowComp/PatchWorld","reach":null}],"summary":{"ran":6,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":11,"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":0,"samples":[{"code_sha256_prefix":"b2adc0ff6d0a9044","entry":"belief_snapshot","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_signals.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_signals.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":"b2adc0ff6d0a9044"}},{"code_sha256_prefix":"5a91f0e529cfd644","entry":"group_by_problem","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_data.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_data.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":"5a91f0e529cfd644"}},{"code_sha256_prefix":"ae92ed406adb1edf","entry":"group_by_task_type","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_data.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_data.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":"ae92ed406adb1edf"}},{"code_sha256_prefix":"df272630397f75fe","entry":"load_trajectories","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_data.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_data.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":"df272630397f75fe"}},{"code_sha256_prefix":"a5b2c75cb8f46df5","entry":"normalize_parsed_observation","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_evaluator.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_evaluator.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":"a5b2c75cb8f46df5"}},{"code_sha256_prefix":"768f4ef0ae8134ce","entry":"render_maze_observation","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_base.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_base.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":"768f4ef0ae8134ce"}},{"code_sha256_prefix":"8a70fa041911372d","entry":"action_actually_failed","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_signals.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_signals.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":"8a70fa041911372d"}},{"code_sha256_prefix":"bae399b849dec121","entry":"canonicalize_maze_walls","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_base.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_base.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":"bae399b849dec121"}},{"code_sha256_prefix":"d75958a67fea5b7e","entry":"coerce_maze_state","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_base.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_base.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":"d75958a67fea5b7e"}},{"code_sha256_prefix":"8f9a483585663e09","entry":"extract_observation_state_fields","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_evaluator.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_evaluator.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":"8f9a483585663e09"}},{"code_sha256_prefix":"e7a2a4869c012316","entry":"load_model_from_code","repo":"HKBU-KnowComp/PatchWorld","repo_kind":"found_in_text","path":"patchworld/worldmodel_validator.py","file_url":"https://github.com/HKBU-KnowComp/PatchWorld/blob/HEAD/patchworld/worldmodel_validator.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":"e7a2a4869c012316"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}