{"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/mathfusion-enhancing-mathematic-problem","title":"MathFusion: Enhancing Mathematic Problem-solving of LLM through Instruction Fusion","arxiv_id":"2503.16212","date":"2025-03-20","proceeding":null,"authors":["Qizhi Pei","Lijun Wu","Zhuoshi Pan","Yu Li","Honglin Lin","Chenlin Ming","Xin Gao","Conghui He","Rui Yan"],"abstract":"Large Language Models (LLMs) have shown impressive progress in mathematical reasoning. While data augmentation is promising to enhance mathematical problem-solving ability, current approaches are predominantly limited to instance-level modifications-such as rephrasing or generating syntactic variations-which fail to capture and leverage the intrinsic relational structures inherent in mathematical knowledge. Inspired by human learning processes, where mathematical proficiency develops through systematic exposure to interconnected concepts, we introduce MathFusion, a novel framework that enhances mathematical reasoning through cross-problem instruction synthesis. MathFusion implements this through three fusion strategies: (1) sequential fusion, which chains related problems to model solution dependencies; (2) parallel fusion, which combines analogous problems to reinforce conceptual understanding; and (3) conditional fusion, which creates context-aware selective problems to enhance reasoning flexibility. By applying these strategies, we generate a new dataset, \\textbf{MathFusionQA}, followed by fine-tuning models (DeepSeekMath-7B, Mistral-7B, Llama3-8B) on it. Experimental results demonstrate that MathFusion achieves substantial improvements in mathematical reasoning while maintaining high data efficiency, boosting performance by 18.0 points in accuracy across diverse benchmarks while requiring only 45K additional synthetic instructions, representing a substantial improvement over traditional single-instruction approaches. Our datasets, models, and code are publicly available at https://github.com/QizhiPei/mathfusion.","url_abs":"https://arxiv.org/abs/2503.16212v1","url_pdf":"https://arxiv.org/pdf/2503.16212v1.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":"mathfusion-enhancing-mathematic-problem","repo_url":"https://github.com/qizhipei/mathfusion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"mathematical-problem-solving","task_name":"Mathematical Problem-Solving"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2503.16212","atlas_url":"https://app.syntology.ai/?focus=2503.16212","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.16212"}},"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/qizhipei/mathfusion","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":13,"unverified":5},"by_repo_kind":{"official":{"samples":18,"ran":13,"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":"ace871f6d9931df1","entry":"async_wrap","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/parallel.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/parallel.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ace871f6d9931df1"}},{"code_sha256_prefix":"809c0178a7ae90ff","entry":"choice_answer_clean","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/grader.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/grader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"809c0178a7ae90ff"}},{"code_sha256_prefix":"f184066eadcee200","entry":"extract_ans_from_math_sol","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/data.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f184066eadcee200"}},{"code_sha256_prefix":"4abb06623d7c704d","entry":"extract_level_from_math_dp","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/data.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4abb06623d7c704d"}},{"code_sha256_prefix":"bed2810b31296fa1","entry":"get_answer_type_text","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/olympiadbench.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/olympiadbench.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bed2810b31296fa1"}},{"code_sha256_prefix":"f249e05f5c701d28","entry":"get_pathname_from_name_or_path","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/utils.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f249e05f5c701d28"}},{"code_sha256_prefix":"0047d2388e36a9dd","entry":"get_single_answer_type_text","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/olympiadbench.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/olympiadbench.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0047d2388e36a9dd"}},{"code_sha256_prefix":"fb37d3c84b18e368","entry":"is_digit","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/grader.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/grader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb37d3c84b18e368"}},{"code_sha256_prefix":"3c40f841274b3441","entry":"load_json","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/utils.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3c40f841274b3441"}},{"code_sha256_prefix":"fb57a712227893bd","entry":"load_jsonl","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/utils.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fb57a712227893bd"}},{"code_sha256_prefix":"e6eeb93f5a059925","entry":"make_prompt","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/olympiadbench.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/olympiadbench.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e6eeb93f5a059925"}},{"code_sha256_prefix":"7d4b7f8c3875b126","entry":"parse_digits","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/grader.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/grader.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7d4b7f8c3875b126"}},{"code_sha256_prefix":"c2dd672c3bad60d7","entry":"seq_consume_preset_queue_w_each_timeout","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/parallel.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/parallel.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c2dd672c3bad60d7"}},{"code_sha256_prefix":"9675ce6b40daf814","entry":"convert_expr","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/latex2sympy/latex2sympy2.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/latex2sympy/latex2sympy2.py","link_basis":"plan_row","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":"9675ce6b40daf814"}},{"code_sha256_prefix":"d3b7a1bd2b1b514a","entry":"convert_relation","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/latex2sympy/latex2sympy2.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/latex2sympy/latex2sympy2.py","link_basis":"plan_row","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":"d3b7a1bd2b1b514a"}},{"code_sha256_prefix":"ecd6408282b087da","entry":"get_icl_egs","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/gen.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/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":"ecd6408282b087da"}},{"code_sha256_prefix":"ac56cd1c0989eb82","entry":"get_n_shots","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/dart_math/gen.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/dart_math/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":"ac56cd1c0989eb82"}},{"code_sha256_prefix":"699bf6581fe5aa36","entry":"latex2sympy","repo":"qizhipei/mathfusion","repo_kind":"official","path":"evaluation/latex2sympy/latex2sympy2.py","file_url":"https://github.com/qizhipei/mathfusion/blob/HEAD/evaluation/latex2sympy/latex2sympy2.py","link_basis":"plan_row","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":"699bf6581fe5aa36"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}