{"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/alternate-preference-optimization-for","title":"Alternate Preference Optimization for Unlearning Factual Knowledge in Large Language Models","arxiv_id":"2409.13474","date":"2024-09-20","proceeding":null,"authors":["Anmol Mekala","Vineeth Dorna","Shreya Dubey","Abhishek Lalwani","David Koleczek","Mukund Rungta","Sadid Hasan","Elita Lobo"],"abstract":"Machine unlearning aims to efficiently eliminate the influence of specific training data, known as the forget set, from the model. However, existing unlearning methods for Large Language Models (LLMs) face a critical challenge: they rely solely on negative feedback to suppress responses related to the forget set, which often results in nonsensical or inconsistent outputs, diminishing model utility and posing potential privacy risks. To address this limitation, we propose a novel approach called Alternate Preference Optimization (AltPO), which combines negative feedback with in-domain positive feedback on the forget set. Additionally, we introduce new evaluation metrics to assess the quality of responses related to the forget set. Extensive experiments show that our approach not only enables effective unlearning but also avoids undesirable model behaviors while maintaining overall model performance. Our implementation can be found at https://github.com/molereddy/Alternate-Preference-Optimization.","url_abs":"https://arxiv.org/abs/2409.13474v3","url_pdf":"https://arxiv.org/pdf/2409.13474v3.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":"alternate-preference-optimization-for","repo_url":"https://github.com/molereddy/Alternate-Preference-Optimization","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"machine-unlearning","task_name":"Machine Unlearning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.13474","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.13474"}},"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/molereddy/Alternate-Preference-Optimization","reach":{"status":"ok"}}],"summary":{"ran":4,"unverified":5},"by_repo_kind":{"official":{"samples":9,"ran":4,"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":9,"samples":[{"code_sha256_prefix":"6b05e5497f1dd581","entry":"basic_collator","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"data_module.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/data_module.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":"6b05e5497f1dd581"}},{"code_sha256_prefix":"ffd74f077c61d9ec","entry":"collator_with_indices","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"data_module.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/data_module.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":"ffd74f077c61d9ec"}},{"code_sha256_prefix":"d189859ea6873cd0","entry":"get_model_identifiers_from_yaml","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"utils.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/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":"d189859ea6873cd0"}},{"code_sha256_prefix":"6e72fd5056dda43a","entry":"read_json","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"generate.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/generate.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":"6e72fd5056dda43a"}},{"code_sha256_prefix":"107ae7bf553dab1a","entry":"convert_raw_data_to_model_format","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"data_module.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/data_module.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":"107ae7bf553dab1a"}},{"code_sha256_prefix":"78733604aac3e99e","entry":"get_dataset","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"generate.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/generate.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":"78733604aac3e99e"}},{"code_sha256_prefix":"398285af006a97c9","entry":"get_gibberish_evals","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"utils.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/utils.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":"398285af006a97c9"}},{"code_sha256_prefix":"5e732d047965c669","entry":"get_model","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"generate.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/generate.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":"5e732d047965c669"}},{"code_sha256_prefix":"55f8c0c5af7f342f","entry":"get_model_utility","repo":"molereddy/Alternate-Preference-Optimization","repo_kind":"official","path":"utils.py","file_url":"https://github.com/molereddy/Alternate-Preference-Optimization/blob/HEAD/utils.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":"55f8c0c5af7f342f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}