{"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/step-controlled-dpo-leveraging-stepwise-error","title":"Step-Controlled DPO: Leveraging Stepwise Error for Enhanced Mathematical Reasoning","arxiv_id":"2407.00782","date":"2024-06-30","proceeding":null,"authors":["Zimu Lu","Aojun Zhou","Ke Wang","Houxing Ren","Weikang Shi","Junting Pan","Mingjie Zhan","Hongsheng Li"],"abstract":"Direct Preference Optimization (DPO) has proven effective at improving the performance of large language models (LLMs) on downstream tasks such as reasoning and alignment. In this work, we propose Step-Controlled DPO (SCDPO), a method for automatically providing stepwise error supervision by creating negative samples of mathematical reasoning rationales that start making errors at a specified step. By applying these samples in DPO training, SCDPO can better align the model to understand reasoning errors and output accurate reasoning steps. We apply SCDPO to both code-integrated and chain-of-thought solutions, empirically showing that it consistently improves the performance compared to naive DPO on three different SFT models, including one existing SFT model and two models we finetuned. Qualitative analysis of the credit assignment of SCDPO and DPO demonstrates the effectiveness of SCDPO at identifying errors in mathematical solutions. We then apply SCDPO to an InternLM2-20B model, resulting in a 20B model that achieves high scores of 88.5% on GSM8K and 58.1% on MATH, rivaling all other open-source LLMs, showing the great potential of our method.","url_abs":"https://arxiv.org/abs/2407.00782v3","url_pdf":"https://arxiv.org/pdf/2407.00782v3.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":"step-controlled-dpo-leveraging-stepwise-error","repo_url":"https://github.com/mathllm/Step-Controlled_DPO","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"gsm8k","task_name":"GSM8K"},{"task_slug":"math","task_name":"Math"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"dpo","method_name":"DPO"},{"method_slug":"sft","method_name":"SFT"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2407.00782","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2407.00782"}},"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/mathllm/Step-Controlled_DPO","reach":{"status":"ok"}}],"summary":{"ran":5,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":6,"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":6,"samples":[{"code_sha256_prefix":"587a8be3d359400c","entry":"get_prompt","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k.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":"587a8be3d359400c"}},{"code_sha256_prefix":"a681b908de92655d","entry":"get_prompt","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k_divided.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k_divided.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":"a681b908de92655d"}},{"code_sha256_prefix":"5b11ae21b67cdb53","entry":"is_noisy_data","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/process_for_dro.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/process_for_dro.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":"5b11ae21b67cdb53"}},{"code_sha256_prefix":"17081a7b73a41850","entry":"load_jsonl","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/lce_solution_gen_different_negative_gsm8k.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"17081a7b73a41850"}},{"code_sha256_prefix":"2cadca037a753806","entry":"load_jsonl","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/analyze_different_negative.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/analyze_different_negative.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":"2cadca037a753806"}},{"code_sha256_prefix":"11de2f16614e2848","entry":"prepare_initial_data","repo":"mathllm/Step-Controlled_DPO","repo_kind":"official","path":"src/step_controled_dpo_lce/process_for_dro.py","file_url":"https://github.com/mathllm/Step-Controlled_DPO/blob/HEAD/src/step_controled_dpo_lce/process_for_dro.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":"11de2f16614e2848"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}