{"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/reference-free-monolithic-preference","title":"ORPO: Monolithic Preference Optimization without Reference Model","arxiv_id":"2403.07691","date":"2024-03-12","proceeding":null,"authors":["Jiwoo Hong","Noah Lee","James Thorne"],"abstract":"While recent preference alignment algorithms for language models have demonstrated promising results, supervised fine-tuning (SFT) remains imperative for achieving successful convergence. In this paper, we study the crucial role of SFT within the context of preference alignment, emphasizing that a minor penalty for the disfavored generation style is sufficient for preference-aligned SFT. Building on this foundation, we introduce a straightforward and innovative reference model-free monolithic odds ratio preference optimization algorithm, ORPO, eliminating the necessity for an additional preference alignment phase. We demonstrate, both empirically and theoretically, that the odds ratio is a sensible choice for contrasting favored and disfavored styles during SFT across the diverse sizes from 125M to 7B. Specifically, fine-tuning Phi-2 (2.7B), Llama-2 (7B), and Mistral (7B) with ORPO on the UltraFeedback alone surpasses the performance of state-of-the-art language models with more than 7B and 13B parameters: achieving up to 12.20% on $\\text{AlpacaEval}_{2.0}$ (Figure 1), 66.19% on IFEval (instruction-level loose, Table 6), and 7.32 in MT-Bench (Figure 12). We release code and model checkpoints for Mistral-ORPO-$\\alpha$ (7B) and Mistral-ORPO-$\\beta$ (7B).","url_abs":"https://arxiv.org/abs/2403.07691v2","url_pdf":"https://arxiv.org/pdf/2403.07691v2.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":"reference-free-monolithic-preference","repo_url":"https://github.com/xfactlab/orpo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"reference-free-monolithic-preference","repo_url":"https://github.com/internlm/xtuner","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"reference-free-monolithic-preference","repo_url":"https://github.com/shibing624/medicalgpt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"reference-free-monolithic-preference","repo_url":"https://github.com/OctopusMind/ORPO","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"sft","method_name":"SFT"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.07691","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.07691"}},"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/internlm/xtuner","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/xfactlab/orpo","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shibing624/medicalgpt","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/OctopusMind/ORPO","reach":null}],"summary":{"ran":2,"ran_draft_wrong":1,"ran_honours":1,"unverified":10},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1},"listed":{"samples":11,"ran":2,"repositories":2}},"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":1,"samples":[{"code_sha256_prefix":"9da2f06d523b6949","entry":"ORPO","repo":"OctopusMind/ORPO","repo_kind":"listed","path":"orpo.py","file_url":"https://github.com/OctopusMind/ORPO/blob/HEAD/orpo.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":"9da2f06d523b6949"}},{"code_sha256_prefix":"ea366da75b59ff77","entry":"dataset_split_selector","repo":"xfactlab/orpo","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/xfactlab/orpo/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","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":"ea366da75b59ff77"}},{"code_sha256_prefix":"7e7adc82abe38ce7","entry":"find_all_linear_names","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"training/supervised_finetuning.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/training/supervised_finetuning.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7e7adc82abe38ce7"}},{"code_sha256_prefix":"d2895bdf14e8f94f","entry":"preprocess_logits_for_metrics","repo":"xfactlab/orpo","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/xfactlab/orpo/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d2895bdf14e8f94f"}},{"code_sha256_prefix":"ac7e7d62416af65c","entry":"add_extra_stop_words","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"demo/openai_api.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/demo/openai_api.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":"ac7e7d62416af65c"}},{"code_sha256_prefix":"ce687202c5e103ad","entry":"batch_generate_answer","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"demo/inference.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/demo/inference.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":"ce687202c5e103ad"}},{"code_sha256_prefix":"69a87416659918fe","entry":"compute_metrics","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"training/reward_modeling.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/training/reward_modeling.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":"69a87416659918fe"}},{"code_sha256_prefix":"afc0c3360d972be7","entry":"create_llm_client","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"role_play_data/llm_client.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/role_play_data/llm_client.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":"afc0c3360d972be7"}},{"code_sha256_prefix":"3e514a3233214a42","entry":"default_args","repo":"xfactlab/orpo","repo_kind":"official","path":"src/args.py","file_url":"https://github.com/xfactlab/orpo/blob/HEAD/src/args.py","link_basis":"first_harvest_node","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":"3e514a3233214a42"}},{"code_sha256_prefix":"d640810687642a4f","entry":"find_all_linear_names","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"training/reward_modeling.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/training/reward_modeling.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":"d640810687642a4f"}},{"code_sha256_prefix":"651d8039d4127f60","entry":"generate","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"role_play_data/roleplay_data_generate_doubao.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/role_play_data/roleplay_data_generate_doubao.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":"651d8039d4127f60"}},{"code_sha256_prefix":"bf30ccc877226063","entry":"stream_generate_answer","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"demo/fastapi_server_demo.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/demo/fastapi_server_demo.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":"bf30ccc877226063"}},{"code_sha256_prefix":"b36a8f36f253e5c9","entry":"stream_generate_answer","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"demo/inference.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/demo/inference.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":"b36a8f36f253e5c9"}},{"code_sha256_prefix":"469cf12b400c2c5a","entry":"trim_stop_words","repo":"shibing624/medicalgpt","repo_kind":"listed","path":"demo/openai_api.py","file_url":"https://github.com/shibing624/medicalgpt/blob/HEAD/demo/openai_api.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":"469cf12b400c2c5a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}