{"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/jiuzhang3-0-efficiently-improving","title":"JiuZhang3.0: Efficiently Improving Mathematical Reasoning by Training Small Data Synthesis Models","arxiv_id":"2405.14365","date":"2024-05-23","proceeding":null,"authors":["Kun Zhou","Beichen Zhang","Jiapeng Wang","Zhipeng Chen","Wayne Xin Zhao","Jing Sha","Zhichao Sheng","Shijin Wang","Ji-Rong Wen"],"abstract":"Mathematical reasoning is an important capability of large language models~(LLMs) for real-world applications. To enhance this capability, existing work either collects large-scale math-related texts for pre-training, or relies on stronger LLMs (\\eg GPT-4) to synthesize massive math problems. Both types of work generally lead to large costs in training or synthesis. To reduce the cost, based on open-source available texts, we propose an efficient way that trains a small LLM for math problem synthesis, to efficiently generate sufficient high-quality pre-training data. To achieve it, we create a dataset using GPT-4 to distill its data synthesis capability into the small LLM. Concretely, we craft a set of prompts based on human education stages to guide GPT-4, to synthesize problems covering diverse math knowledge and difficulty levels. Besides, we adopt the gradient-based influence estimation method to select the most valuable math-related texts. The both are fed into GPT-4 for creating the knowledge distillation dataset to train the small LLM. We leverage it to synthesize 6 million math problems for pre-training our JiuZhang3.0 model, which only needs to invoke GPT-4 API 9.3k times and pre-train on 4.6B data. Experimental results have shown that JiuZhang3.0 achieves state-of-the-art performance on several mathematical reasoning datasets, under both natural language reasoning and tool manipulation settings. Our code and data will be publicly released in \\url{https://github.com/RUCAIBox/JiuZhang3.0}.","url_abs":"https://arxiv.org/abs/2405.14365v1","url_pdf":"https://arxiv.org/pdf/2405.14365v1.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":"jiuzhang3-0-efficiently-improving","repo_url":"https://github.com/rucaibox/jiuzhang3.0","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"math","task_name":"Math"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"set","method_name":"SET"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.14365","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14365"}},"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/rucaibox/jiuzhang3.0","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":9},"by_repo_kind":{"official":{"samples":12,"ran":3,"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":12,"samples":[{"code_sha256_prefix":"1525d8bc0fc8d5a0","entry":"generate_completions","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/model_utils.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/model_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1525d8bc0fc8d5a0"}},{"code_sha256_prefix":"e6e097bbc1e5c6d4","entry":"get_response","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/math_eval_openai.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/math_eval_openai.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e6e097bbc1e5c6d4"}},{"code_sha256_prefix":"c35f14527d73a1ed","entry":"shuffle","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"prepare_train_data.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/prepare_train_data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c35f14527d73a1ed"}},{"code_sha256_prefix":"81082f28e1440f9d","entry":"compare_numerical_ans","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/math_utils.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/math_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"81082f28e1440f9d"}},{"code_sha256_prefix":"ed2f4689128f9885","entry":"extract_multi_choice_answer","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/parser.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/parser.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed2f4689128f9885"}},{"code_sha256_prefix":"fb37d3c84b18e368","entry":"is_digit","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/grader.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/grader.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fb37d3c84b18e368"}},{"code_sha256_prefix":"1c1060f6e43d5dfa","entry":"is_number","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/math_utils.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/math_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1c1060f6e43d5dfa"}},{"code_sha256_prefix":"ee71a94d9dd1b8e9","entry":"load_hf_lm_and_tokenizer","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/model_utils.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/model_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ee71a94d9dd1b8e9"}},{"code_sha256_prefix":"de7ce7175a9cbe34","entry":"mp_solve","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/math_eval_openai.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/math_eval_openai.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"de7ce7175a9cbe34"}},{"code_sha256_prefix":"73925940858a62b3","entry":"my_parse_latex","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/math_utils.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/math_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"73925940858a62b3"}},{"code_sha256_prefix":"7d4b7f8c3875b126","entry":"parse_digits","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/grader.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/grader.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7d4b7f8c3875b126"}},{"code_sha256_prefix":"ad19a7a80772794c","entry":"str_to_pmatrix","repo":"rucaibox/jiuzhang3.0","repo_kind":"official","path":"eval/grader.py","file_url":"https://github.com/rucaibox/jiuzhang3.0/blob/HEAD/eval/grader.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ad19a7a80772794c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}