{"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/relearn-unlearning-via-learning-for-large","title":"ReLearn: Unlearning via Learning for Large Language Models","arxiv_id":"2502.11190","date":"2025-02-16","proceeding":null,"authors":["Haoming Xu","Ningyuan Zhao","Liming Yang","Sendong Zhao","Shumin Deng","Mengru Wang","Bryan Hooi","Nay Oo","Huajun Chen","Ningyu Zhang"],"abstract":"Current unlearning methods for large language models usually rely on reverse optimization to reduce target token probabilities. However, this paradigm disrupts the subsequent tokens prediction, degrading model performance and linguistic coherence. Moreover, existing evaluation metrics overemphasize contextual forgetting while inadequately assessing response fluency and relevance. To address these challenges, we propose ReLearn, a data augmentation and fine-tuning pipeline for effective unlearning, along with a comprehensive evaluation framework. This framework introduces Knowledge Forgetting Rate (KFR) and Knowledge Retention Rate (KRR) to measure knowledge-level preservation, and Linguistic Score (LS) to evaluate generation quality. Our experiments show that ReLearn successfully achieves targeted forgetting while preserving high-quality output. Through mechanistic analysis, we further demonstrate how reverse optimization disrupts coherent text generation, while ReLearn preserves this essential capability. Code is available at https://github.com/zjunlp/unlearn.","url_abs":"https://arxiv.org/abs/2502.11190v3","url_pdf":"https://arxiv.org/pdf/2502.11190v3.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":"relearn-unlearning-via-learning-for-large","repo_url":"https://github.com/zjunlp/unlearn","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.11190","atlas_url":"https://app.syntology.ai/?focus=2502.11190","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.11190"}},"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/zjunlp/unlearn","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":4,"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"official":{"samples":11,"ran":5,"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":"550cd04dd979ca21","entry":"chinese_ratio","repo":"zjunlp/unlearn","repo_kind":"official","path":"dataAugument/gather_proc_data.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/dataAugument/gather_proc_data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"550cd04dd979ca21"}},{"code_sha256_prefix":"649fc48067a48529","entry":"find_all_linear_names","repo":"zjunlp/unlearn","repo_kind":"official","path":"semeval25/unlearn-merging.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/semeval25/unlearn-merging.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"649fc48067a48529"}},{"code_sha256_prefix":"1cdd69228f9ca358","entry":"fixed_cross_entropy","repo":"zjunlp/unlearn","repo_kind":"official","path":"semeval25/unlearn-merging.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/semeval25/unlearn-merging.py","link_basis":"harvester_set","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":"1cdd69228f9ca358"}},{"code_sha256_prefix":"d382772365dcb74d","entry":"gather","repo":"zjunlp/unlearn","repo_kind":"official","path":"dataAugument/gather_proc_data.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/dataAugument/gather_proc_data.py","link_basis":"harvester_set","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":"d382772365dcb74d"}},{"code_sha256_prefix":"046d9c0faf4fe5c5","entry":"pad_or_trim_tensor","repo":"zjunlp/unlearn","repo_kind":"official","path":"semeval25/unlearn-merging.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/semeval25/unlearn-merging.py","link_basis":"harvester_set","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":"046d9c0faf4fe5c5"}},{"code_sha256_prefix":"bd027a2307927c44","entry":"choose_dataset","repo":"zjunlp/unlearn","repo_kind":"official","path":"baselines/src/dataset.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/baselines/src/dataset.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":"bd027a2307927c44"}},{"code_sha256_prefix":"835be88a656b57c2","entry":"compute_cosine_similarity","repo":"zjunlp/unlearn","repo_kind":"official","path":"baselines/src/memflex_trainer.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/baselines/src/memflex_trainer.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":"835be88a656b57c2"}},{"code_sha256_prefix":"33e3c69c78826a6b","entry":"contains_chinese","repo":"zjunlp/unlearn","repo_kind":"official","path":"dataAugument/gather_proc_data.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/dataAugument/gather_proc_data.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":"33e3c69c78826a6b"}},{"code_sha256_prefix":"51bf57b170168770","entry":"get_basename","repo":"zjunlp/unlearn","repo_kind":"official","path":"baselines/src/utils.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/baselines/src/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":"51bf57b170168770"}},{"code_sha256_prefix":"373cbe86765cc7cc","entry":"get_batch_loss","repo":"zjunlp/unlearn","repo_kind":"official","path":"baselines/src/utils.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/baselines/src/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":"373cbe86765cc7cc"}},{"code_sha256_prefix":"ed81414ea2349a5f","entry":"read_text","repo":"zjunlp/unlearn","repo_kind":"official","path":"baselines/src/utils.py","file_url":"https://github.com/zjunlp/unlearn/blob/HEAD/baselines/src/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":"ed81414ea2349a5f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}