{"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/code2logic-game-code-driven-data-synthesis","title":"Code2Logic: Game-Code-Driven Data Synthesis for Enhancing VLMs General Reasoning","arxiv_id":"2505.13886","date":"2025-05-20","proceeding":null,"authors":["Jingqi Tong","Jixin Tang","Hangcheng Li","Yurong Mou","Ming Zhang","Jun Zhao","Yanbo Wen","Fan Song","Jiahao Zhan","Yuyang Lu","Chaoran Tao","Zhiyuan Guo","Jizhou Yu","Tianhao Cheng","Changhao Jiang","Zhen Wang","Tao Liang","Zhihui Fei","Mingyang Wan","Guojun Ma","Weifeng Ge","Guanhua Chen","Tao Gui","Xipeng Qiu","Qi Zhang","Xuanjing Huang"],"abstract":"Visual-language Chain-of-Thought (CoT) data resources are relatively scarce compared to text-only counterparts, limiting the improvement of reasoning capabilities in Vision Language Models (VLMs). However, high-quality vision-language reasoning data is expensive and labor-intensive to annotate. To address this issue, we leverage a promising resource: game code, which naturally contains logical structures and state transition processes. Therefore, we propose Code2Logic, a novel game-code-driven approach for multimodal reasoning data synthesis. Our approach leverages Large Language Models (LLMs) to adapt game code, enabling automatic acquisition of reasoning processes and results through code execution. Using the Code2Logic approach, we developed the GameQA dataset to train and evaluate VLMs. GameQA is cost-effective and scalable to produce, challenging for state-of-the-art models, and diverse with 30 games and 158 tasks. Surprisingly, despite training solely on game data, VLMs demonstrated out of domain generalization, specifically Qwen2.5-VL-7B improving performance by 2.33\\% across 7 diverse vision-language benchmarks. Our code and dataset are available at https://github.com/tongjingqi/Code2Logic.","url_abs":"https://arxiv.org/abs/2505.13886v1","url_pdf":"https://arxiv.org/pdf/2505.13886v1.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":"code2logic-game-code-driven-data-synthesis","repo_url":"https://github.com/tongjingqi/code2logic","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"multimodal-reasoning","task_name":"Multimodal Reasoning"}],"methods":[],"datasets_introduced":[{"slug":"gameqa","name":"GameQA","full_name":"GameQA-140K"}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2505.13886","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.13886"}},"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/tongjingqi/code2logic","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":15},"by_repo_kind":{"official":{"samples":15,"ran":0,"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":"1d244c428cfcce3e","entry":"convert_dict_to_str","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/PyramidChess_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/PyramidChess_to_text_que.py","link_basis":"harvester_set","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":"1d244c428cfcce3e"}},{"code_sha256_prefix":"8dcbaaa6688eb529","entry":"find_dataset","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/convert_all_text_data.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/convert_all_text_data.py","link_basis":"harvester_set","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":"8dcbaaa6688eb529"}},{"code_sha256_prefix":"d6952ca5b815db52","entry":"format_3d_array","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","link_basis":"harvester_set","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":"d6952ca5b815db52"}},{"code_sha256_prefix":"caa903bbddc7a8fc","entry":"format_projection","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","link_basis":"harvester_set","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":"caa903bbddc7a8fc"}},{"code_sha256_prefix":"3f8d4d08a237ecbf","entry":"format_state_json","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/3dreconstruction_to_text_que.py","link_basis":"harvester_set","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":"3f8d4d08a237ecbf"}},{"code_sha256_prefix":"dcbfb1a3a7994497","entry":"generate_piece_description","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","link_basis":"harvester_set","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":"dcbfb1a3a7994497"}},{"code_sha256_prefix":"f596283a08d42eb5","entry":"index_to_chess_coord","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","link_basis":"harvester_set","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":"f596283a08d42eb5"}},{"code_sha256_prefix":"e32d5a06526a3f69","entry":"load_data","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/chess_ranger_to_text_que.py","link_basis":"harvester_set","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":"e32d5a06526a3f69"}},{"code_sha256_prefix":"38c2dbe09a7e2650","entry":"parse_ratio_string","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/3DReconstruction/multi_gen.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/3DReconstruction/multi_gen.py","link_basis":"harvester_set","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":"38c2dbe09a7e2650"}},{"code_sha256_prefix":"8bce38b2e33c7d8d","entry":"read_json","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/PyramidChess_to_text_que.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/PyramidChess_to_text_que.py","link_basis":"harvester_set","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":"8bce38b2e33c7d8d"}},{"code_sha256_prefix":"968481e75edb953d","entry":"read_json","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/convert_text_data.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/convert_text_data.py","link_basis":"harvester_set","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":"968481e75edb953d"}},{"code_sha256_prefix":"7aff8928b0094fa3","entry":"resolve_state_path","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/convert_text_data.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/convert_text_data.py","link_basis":"harvester_set","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":"7aff8928b0094fa3"}},{"code_sha256_prefix":"a7e84d87f71728fd","entry":"text_2d_turing_machine","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/game_text_adapters.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/game_text_adapters.py","link_basis":"harvester_set","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":"a7e84d87f71728fd"}},{"code_sha256_prefix":"8f75acbbd517e7b0","entry":"text_3d_maze","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/game_text_adapters.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/game_text_adapters.py","link_basis":"harvester_set","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":"8f75acbbd517e7b0"}},{"code_sha256_prefix":"6bb820e87a88f47a","entry":"text_3d_reconstruction","repo":"tongjingqi/code2logic","repo_kind":"official","path":"src/Code_for_text_data_derivative/game_text_adapters.py","file_url":"https://github.com/tongjingqi/code2logic/blob/HEAD/src/Code_for_text_data_derivative/game_text_adapters.py","link_basis":"harvester_set","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":"6bb820e87a88f47a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}