{"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/pretraining-language-models-with-human","title":"Pretraining Language Models with Human Preferences","arxiv_id":"2302.08582","date":"2023-02-16","proceeding":null,"authors":["Tomasz Korbak","Kejian Shi","Angelica Chen","Rasika Bhalerao","Christopher L. Buckley","Jason Phang","Samuel R. Bowman","Ethan Perez"],"abstract":"Language models (LMs) are pretrained to imitate internet text, including content that would violate human preferences if generated by an LM: falsehoods, offensive comments, personally identifiable information, low-quality or buggy code, and more. Here, we explore alternative objectives for pretraining LMs in a way that also guides them to generate text aligned with human preferences. We benchmark five objectives for pretraining with human feedback across three tasks and study how they affect the trade-off between alignment and capabilities of pretrained LMs. We find a Pareto-optimal and simple approach among those we explored: conditional training, or learning distribution over tokens conditional on their human preference scores given by a reward model. Conditional training reduces the rate of undesirable content by up to an order of magnitude, both when generating without a prompt and with an adversarially-chosen prompt. Moreover, conditional training maintains the downstream task performance of standard LM pretraining, both before and after task-specific finetuning. Pretraining with human feedback results in much better preference satisfaction than standard LM pretraining followed by finetuning with feedback, i.e., learning and then unlearning undesirable behavior. Our results suggest that we should move beyond imitation learning when pretraining LMs and incorporate human preferences from the start of training.","url_abs":"https://arxiv.org/abs/2302.08582v2","url_pdf":"https://arxiv.org/pdf/2302.08582v2.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":"pretraining-language-models-with-human","repo_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"imitation-learning","task_name":"Imitation Learning"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2302.08582","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2302.08582"}},"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":"deterministic:regex_extraction","url":"https://github.com/PyCQA/pycodestyle","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/LeapBeyond/scrubadub","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tomekkorbak/pretraining-with-human-feedback","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":5,"ran":0,"repositories":1},"found_in_text":{"samples":2,"ran":0,"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":"eeffd068380f0fa5","entry":"construct_prompt_for_red_lm","repo":"tomekkorbak/pretraining-with-human-feedback","repo_kind":"official","path":"red_team.py","file_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback/blob/HEAD/red_team.py","link_basis":"harvester_set","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":"eeffd068380f0fa5"}},{"code_sha256_prefix":"355ef5e59cc3a74f","entry":"entropy_from_logits","repo":"tomekkorbak/pretraining-with-human-feedback","repo_kind":"official","path":"apo/utils.py","file_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback/blob/HEAD/apo/utils.py","link_basis":"harvester_set","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":"355ef5e59cc3a74f"}},{"code_sha256_prefix":"121c117e7281b187","entry":"get_max_at_k","repo":"tomekkorbak/pretraining-with-human-feedback","repo_kind":"official","path":"apo/utils.py","file_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback/blob/HEAD/apo/utils.py","link_basis":"harvester_set","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":"121c117e7281b187"}},{"code_sha256_prefix":"e30ef6e067c5855f","entry":"locale_split","repo":"LeapBeyond/scrubadub","repo_kind":"found_in_text","path":"scrubadub/utils.py","file_url":"https://github.com/LeapBeyond/scrubadub/blob/HEAD/scrubadub/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":"e30ef6e067c5855f"}},{"code_sha256_prefix":"0fdcb3c2f9b7efb9","entry":"locale_transform","repo":"LeapBeyond/scrubadub","repo_kind":"found_in_text","path":"scrubadub/utils.py","file_url":"https://github.com/LeapBeyond/scrubadub/blob/HEAD/scrubadub/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":"0fdcb3c2f9b7efb9"}},{"code_sha256_prefix":"8d9e4494a1a48703","entry":"parse_response","repo":"tomekkorbak/pretraining-with-human-feedback","repo_kind":"official","path":"red_team.py","file_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback/blob/HEAD/red_team.py","link_basis":"harvester_set","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":"8d9e4494a1a48703"}},{"code_sha256_prefix":"04be8da1a1bdbeb7","entry":"unflatten_config","repo":"tomekkorbak/pretraining-with-human-feedback","repo_kind":"official","path":"apo/utils.py","file_url":"https://github.com/tomekkorbak/pretraining-with-human-feedback/blob/HEAD/apo/utils.py","link_basis":"harvester_set","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":"04be8da1a1bdbeb7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}