{"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/improving-large-language-models-via-fine","title":"Improving Large Language Models via Fine-grained Reinforcement Learning with Minimum Editing Constraint","arxiv_id":"2401.06081","date":"2024-01-11","proceeding":null,"authors":["Zhipeng Chen","Kun Zhou","Wayne Xin Zhao","Junchen Wan","Fuzheng Zhang","Di Zhang","Ji-Rong Wen"],"abstract":"Reinforcement learning (RL) has been widely used in training large language models (LLMs) for preventing unexpected outputs, eg reducing harmfulness and errors. However, existing RL methods mostly adopt the instance-level reward, which is unable to provide fine-grained supervision for complex reasoning tasks, and can not focus on the few key tokens that lead to the incorrectness. To address it, we propose a new RL method named RLMEC that incorporates a generative model as the reward model, which is trained by the erroneous solution rewriting task under the minimum editing constraint, and can produce token-level rewards for RL training. Based on the generative reward model, we design the token-level RL objective for training and an imitation-based regularization for stabilizing RL process. And the both objectives focus on the learning of the key tokens for the erroneous solution, reducing the effect of other unimportant tokens. The experiment results on mathematical tasks and question-answering tasks have demonstrated the effectiveness of our approach. Our code and data are available at https://github.com/RUCAIBox/RLMEC.","url_abs":"https://arxiv.org/abs/2401.06081v2","url_pdf":"https://arxiv.org/pdf/2401.06081v2.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":"improving-large-language-models-via-fine","repo_url":"https://github.com/rucaibox/rlmec","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.06081","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.06081"}},"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/rlmec","reach":{"status":"ok"}}],"summary":{"ran":9,"unverified":1},"by_repo_kind":{"official":{"samples":10,"ran":9,"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":10,"samples":[{"code_sha256_prefix":"f2bd324340245c1e","entry":"extract_nums","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f2bd324340245c1e"}},{"code_sha256_prefix":"b425aefc590684dc","entry":"format_code","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b425aefc590684dc"}},{"code_sha256_prefix":"d46cfd71d4bd5ff5","entry":"get_baichuan_prompt","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/prompt_utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/prompt_utils.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":"d46cfd71d4bd5ff5"}},{"code_sha256_prefix":"ad26ca57156a1cf3","entry":"get_prompt","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/prompt_utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/prompt_utils.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":"ad26ca57156a1cf3"}},{"code_sha256_prefix":"b8a00489156e8660","entry":"get_reward_prompt","repo":"rucaibox/rlmec","repo_kind":"official","path":"process_data/Gen_Training_Data/gen_rlmec_data_math.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/process_data/Gen_Training_Data/gen_rlmec_data_math.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":"b8a00489156e8660"}},{"code_sha256_prefix":"0852a1b2da0be3da","entry":"get_wizard_prompt","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/prompt_utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/prompt_utils.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":"0852a1b2da0be3da"}},{"code_sha256_prefix":"b8f34728ae55b7f1","entry":"make_supervised_data_module","repo":"rucaibox/rlmec","repo_kind":"official","path":"train/train_rlmec.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/train/train_rlmec.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":"b8f34728ae55b7f1"}},{"code_sha256_prefix":"83a3a266232cc7d0","entry":"read_jsonl","repo":"rucaibox/rlmec","repo_kind":"official","path":"evaluate/Math/utils.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/evaluate/Math/utils.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":"83a3a266232cc7d0"}},{"code_sha256_prefix":"7ca8de0c71b1ff3b","entry":"split_solution","repo":"rucaibox/rlmec","repo_kind":"official","path":"process_data/Gen_Training_Data/gen_grm_data_math.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/process_data/Gen_Training_Data/gen_grm_data_math.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7ca8de0c71b1ff3b"}},{"code_sha256_prefix":"de9a14e89b96dd62","entry":"make_supervised_data_module","repo":"rucaibox/rlmec","repo_kind":"official","path":"train/train_grm.py","file_url":"https://github.com/rucaibox/rlmec/blob/HEAD/train/train_grm.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":"de9a14e89b96dd62"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}