{"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/training-a-helpful-and-harmless-assistant","title":"Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback","arxiv_id":"2204.05862","date":"2022-04-12","proceeding":null,"authors":["Yuntao Bai","Andy Jones","Kamal Ndousse","Amanda Askell","Anna Chen","Nova DasSarma","Dawn Drain","Stanislav Fort","Deep Ganguli","Tom Henighan","Nicholas Joseph","Saurav Kadavath","Jackson Kernion","Tom Conerly","Sheer El-Showk","Nelson Elhage","Zac Hatfield-Dodds","Danny Hernandez","Tristan Hume","Scott Johnston","Shauna Kravec","Liane Lovitt","Neel Nanda","Catherine Olsson","Dario Amodei","Tom Brown","Jack Clark","Sam McCandlish","Chris Olah","Ben Mann","Jared Kaplan"],"abstract":"We apply preference modeling and reinforcement learning from human feedback (RLHF) to finetune language models to act as helpful and harmless assistants. We find this alignment training improves performance on almost all NLP evaluations, and is fully compatible with training for specialized skills such as python coding and summarization. We explore an iterated online mode of training, where preference models and RL policies are updated on a weekly cadence with fresh human feedback data, efficiently improving our datasets and models. Finally, we investigate the robustness of RLHF training, and identify a roughly linear relation between the RL reward and the square root of the KL divergence between the policy and its initialization. Alongside our main results, we perform peripheral analyses on calibration, competing objectives, and the use of OOD detection, compare our models with human writers, and provide samples from our models using prompts appearing in recent related work.","url_abs":"https://arxiv.org/abs/2204.05862v1","url_pdf":"https://arxiv.org/pdf/2204.05862v1.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":"training-a-helpful-and-harmless-assistant","repo_url":"https://github.com/anthropics/hh-rlhf","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"training-a-helpful-and-harmless-assistant","repo_url":"https://github.com/ethz-spylab/rlhf_trojan_competition","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"training-a-helpful-and-harmless-assistant","repo_url":"https://github.com/ganjinzero/rrhf","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"training-a-helpful-and-harmless-assistant","repo_url":"https://github.com/miaoyuchun/inform","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"ood-detection","task_name":"Out of Distribution (OOD) Detection"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"},{"task_slug":"reinforcement-learning-2","task_name":"reinforcement-learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2204.05862","atlas_url":"https://app.syntology.ai/?focus=2204.05862","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2204.05862"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/miaoyuchun/inform","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ganjinzero/rrhf","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ethz-spylab/rlhf_trojan_competition","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/anthropics/hh-rlhf","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_draft_wrong":1},"by_repo_kind":{"listed":{"samples":2,"ran":2,"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":2,"samples":[{"code_sha256_prefix":"88c7c0768373a6b2","entry":"compute_hacking_pvalues","repo":"miaoyuchun/inform","repo_kind":"listed","path":"openrlhf/eval/compute_mop.py","file_url":"https://github.com/miaoyuchun/inform/blob/HEAD/openrlhf/eval/compute_mop.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"88c7c0768373a6b2"}},{"code_sha256_prefix":"18ed61dcfadbbdf0","entry":"reward_fn","repo":"miaoyuchun/inform","repo_kind":"listed","path":"openrlhf/cli/train_ppo_ray.py","file_url":"https://github.com/miaoyuchun/inform/blob/HEAD/openrlhf/cli/train_ppo_ray.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"18ed61dcfadbbdf0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}