{"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/beyond-reward-hacking-causal-rewards-for","title":"Beyond Reward Hacking: Causal Rewards for Large Language Model Alignment","arxiv_id":"2501.09620","date":"2025-01-16","proceeding":null,"authors":["Chaoqi Wang","Zhuokai Zhao","Yibo Jiang","Zhaorun Chen","Chen Zhu","Yuxin Chen","Jiayi Liu","Lizhu Zhang","Xiangjun Fan","Hao Ma","Sinong Wang"],"abstract":"Recent advances in large language models (LLMs) have demonstrated significant progress in performing complex tasks. While Reinforcement Learning from Human Feedback (RLHF) has been effective in aligning LLMs with human preferences, it is susceptible to spurious correlations in reward modeling. Consequently, it often introduces biases-such as length bias, sycophancy, conceptual bias, and discrimination that hinder the model's ability to capture true causal relationships. To address this, we propose a novel causal reward modeling approach that integrates causal inference to mitigate these spurious correlations. Our method enforces counterfactual invariance, ensuring reward predictions remain consistent when irrelevant variables are altered. Through experiments on both synthetic and real-world datasets, we show that our approach mitigates various types of spurious correlations effectively, resulting in more reliable and fair alignment of LLMs with human preferences. As a drop-in enhancement to the existing RLHF workflow, our causal reward modeling provides a practical way to improve the trustworthiness and fairness of LLM finetuning.","url_abs":"https://arxiv.org/abs/2501.09620v1","url_pdf":"https://arxiv.org/pdf/2501.09620v1.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":"beyond-reward-hacking-causal-rewards-for","repo_url":"https://github.com/tatsu-lab/alpaca_farm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"causal-inference","task_name":"Causal Inference"},{"task_slug":"fairness","task_name":"Fairness"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[{"method_slug":"causal-inference","method_name":"Causal inference"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2501.09620","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2501.09620"}},"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/tatsu-lab/alpaca_farm","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":9,"unverified":4},"by_repo_kind":{"official":{"samples":13,"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":0,"samples":[{"code_sha256_prefix":"cca45bb9a111ab77","entry":"compute_reward_modeling_metrics","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/reward_modeling_trainer.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/reward_modeling_trainer.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":"cca45bb9a111ab77"}},{"code_sha256_prefix":"42596ac916e883a5","entry":"create_scheduler","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/trainer_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/trainer_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":"42596ac916e883a5"}},{"code_sha256_prefix":"f5ff77db7757bc92","entry":"flatten_dict","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/common.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/common.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":"f5ff77db7757bc92"}},{"code_sha256_prefix":"a71a4bdc37586fe2","entry":"format_prompt","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/data_preprocessor.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/data_preprocessor.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":"a71a4bdc37586fe2"}},{"code_sha256_prefix":"043cf4a6fd60480b","entry":"get_logger","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/logging.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/logging.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":"043cf4a6fd60480b"}},{"code_sha256_prefix":"9a1871dd5c967ac1","entry":"let_model_save_mem_when_zero_grad","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/common.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/common.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":"9a1871dd5c967ac1"}},{"code_sha256_prefix":"9bd28dd37074fcb1","entry":"requires_chatml","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/openai_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/openai_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":"9bd28dd37074fcb1"}},{"code_sha256_prefix":"80675b2c65496f66","entry":"setup","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/distributed_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/distributed_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":"80675b2c65496f66"}},{"code_sha256_prefix":"58d5d20497232727","entry":"string_to_dict","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/openai_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/openai_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":"58d5d20497232727"}},{"code_sha256_prefix":"cdd932e2e3e511b0","entry":"format_output","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/data_preprocessor.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/data_preprocessor.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":"cdd932e2e3e511b0"}},{"code_sha256_prefix":"9a4f0b63fec28e5c","entry":"format_prompt_with_data_frame","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/data_preprocessor.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/data_preprocessor.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":"9a4f0b63fec28e5c"}},{"code_sha256_prefix":"03d2f22f6c69bacb","entry":"make_binary_reward_modeling_data_module","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/data_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/data_utils.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":"03d2f22f6c69bacb"}},{"code_sha256_prefix":"852ca1260bbe1d92","entry":"make_rl_data_module","repo":"tatsu-lab/alpaca_farm","repo_kind":"official","path":"src/alpaca_farm/data_utils.py","file_url":"https://github.com/tatsu-lab/alpaca_farm/blob/HEAD/src/alpaca_farm/data_utils.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":"852ca1260bbe1d92"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}