{"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/chatglm-math-improving-math-problem-solving","title":"ChatGLM-Math: Improving Math Problem-Solving in Large Language Models with a Self-Critique Pipeline","arxiv_id":"2404.02893","date":"2024-04-03","proceeding":null,"authors":["Yifan Xu","Xiao Liu","Xinghan Liu","Zhenyu Hou","Yueyan Li","Xiaohan Zhang","Zihan Wang","Aohan Zeng","Zhengxiao Du","Wenyi Zhao","Jie Tang","Yuxiao Dong"],"abstract":"Large language models (LLMs) have shown excellent mastering of human language, but still struggle in real-world applications that require mathematical problem-solving. While many strategies and datasets to enhance LLMs' mathematics are developed, it remains a challenge to simultaneously maintain and improve both language and mathematical capabilities in deployed LLM systems.In this work, we tailor the Self-Critique pipeline, which addresses the challenge in the feedback learning stage of LLM alignment. We first train a general Math-Critique model from the LLM itself to provide feedback signals. Then, we sequentially employ rejective fine-tuning and direct preference optimization over the LLM's own generations for data collection. Based on ChatGLM3-32B, we conduct a series of experiments on both academic and our newly created challenging dataset, MathUserEval. Results show that our pipeline significantly enhances the LLM's mathematical problem-solving while still improving its language ability, outperforming LLMs that could be two times larger. Related techniques have been deployed to ChatGLM\\footnote{\\url{https://chatglm.cn}}, an online serving LLM. Related evaluation dataset and scripts are released at \\url{https://github.com/THUDM/ChatGLM-Math}.","url_abs":"https://arxiv.org/abs/2404.02893v1","url_pdf":"https://arxiv.org/pdf/2404.02893v1.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":"chatglm-math-improving-math-problem-solving","repo_url":"https://github.com/thudm/chatglm-math","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"chatglm-math-improving-math-problem-solving","repo_url":"https://github.com/MS-P3/code5/tree/main/chatglm3","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"chatglm-math-improving-math-problem-solving","repo_url":"https://github.com/MS-P3/code5/tree/main/chatglm4","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"math","task_name":"Math"},{"task_slug":"mathematical-problem-solving","task_name":"Mathematical Problem-Solving"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.02893","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.02893"}},"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/thudm/chatglm-math","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MS-P3/code5/tree/main/chatglm3","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MS-P3/code5/tree/main/chatglm4","reach":null}],"summary":{"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":4,"ran":1,"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":"7d8ae032d1e62767","entry":"post_process","repo":"thudm/chatglm-math","repo_kind":"official","path":"judge.py","file_url":"https://github.com/thudm/chatglm-math/blob/HEAD/judge.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7d8ae032d1e62767"}},{"code_sha256_prefix":"8ab202e0cfb01b90","entry":"get_GPT_4_judgment","repo":"thudm/chatglm-math","repo_kind":"official","path":"judge.py","file_url":"https://github.com/thudm/chatglm-math/blob/HEAD/judge.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":"8ab202e0cfb01b90"}},{"code_sha256_prefix":"3a25284206e85acd","entry":"get_model_api","repo":"thudm/chatglm-math","repo_kind":"official","path":"inference/models.py","file_url":"https://github.com/thudm/chatglm-math/blob/HEAD/inference/models.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":"3a25284206e85acd"}},{"code_sha256_prefix":"85d9f82860116eb0","entry":"prompt_construct","repo":"thudm/chatglm-math","repo_kind":"official","path":"judge.py","file_url":"https://github.com/thudm/chatglm-math/blob/HEAD/judge.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":"85d9f82860116eb0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}