{"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/machine-unlearning-of-pre-trained-large","title":"Machine Unlearning of Pre-trained Large Language Models","arxiv_id":"2402.15159","date":"2024-02-23","proceeding":null,"authors":["Jin Yao","Eli Chien","Minxin Du","Xinyao Niu","Tianhao Wang","Zezhou Cheng","Xiang Yue"],"abstract":"This study investigates the concept of the `right to be forgotten' within the context of large language models (LLMs). We explore machine unlearning as a pivotal solution, with a focus on pre-trained models--a notably under-researched area. Our research delineates a comprehensive framework for machine unlearning in pre-trained LLMs, encompassing a critical analysis of seven diverse unlearning methods. Through rigorous evaluation using curated datasets from arXiv, books, and GitHub, we establish a robust benchmark for unlearning performance, demonstrating that these methods are over $10^5$ times more computationally efficient than retraining. Our results show that integrating gradient ascent with gradient descent on in-distribution data improves hyperparameter robustness. We also provide detailed guidelines for efficient hyperparameter tuning in the unlearning process. Our findings advance the discourse on ethical AI practices, offering substantive insights into the mechanics of machine unlearning for pre-trained LLMs and underscoring the potential for responsible AI development.","url_abs":"https://arxiv.org/abs/2402.15159v3","url_pdf":"https://arxiv.org/pdf/2402.15159v3.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":"machine-unlearning-of-pre-trained-large","repo_url":"https://github.com/yaojin17/unlearning_llm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"machine-unlearning","task_name":"Machine Unlearning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.15159","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.15159"}},"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/yaojin17/unlearning_llm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":4,"unverified":1},"by_repo_kind":{"official":{"samples":5,"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":0,"samples":[{"code_sha256_prefix":"ee7aee459bcbaaeb","entry":"adapter_load_dataset","repo":"yaojin17/unlearning_llm","repo_kind":"official","path":"llm_unlearn/utils/save_tokenized_dataset.py","file_url":"https://github.com/yaojin17/unlearning_llm/blob/HEAD/llm_unlearn/utils/save_tokenized_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ee7aee459bcbaaeb"}},{"code_sha256_prefix":"62345832792f7ce7","entry":"compute_kl","repo":"yaojin17/unlearning_llm","repo_kind":"official","path":"llm_unlearn/methods/ascent_plus_KLdivergence.py","file_url":"https://github.com/yaojin17/unlearning_llm/blob/HEAD/llm_unlearn/methods/ascent_plus_KLdivergence.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"62345832792f7ce7"}},{"code_sha256_prefix":"dcb359c213884c2b","entry":"do_plot","repo":"yaojin17/unlearning_llm","repo_kind":"official","path":"llm_unlearn/utils/mia_eval.py","file_url":"https://github.com/yaojin17/unlearning_llm/blob/HEAD/llm_unlearn/utils/mia_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dcb359c213884c2b"}},{"code_sha256_prefix":"df5028784e848964","entry":"load_jsonl","repo":"yaojin17/unlearning_llm","repo_kind":"official","path":"llm_unlearn/utils/mia_eval.py","file_url":"https://github.com/yaojin17/unlearning_llm/blob/HEAD/llm_unlearn/utils/mia_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"df5028784e848964"}},{"code_sha256_prefix":"18da2122420deb20","entry":"sweep","repo":"yaojin17/unlearning_llm","repo_kind":"official","path":"llm_unlearn/utils/mia_eval.py","file_url":"https://github.com/yaojin17/unlearning_llm/blob/HEAD/llm_unlearn/utils/mia_eval.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":"18da2122420deb20"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}