{"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/erasing-conceptual-knowledge-from-language","title":"Erasing Conceptual Knowledge from Language Models","arxiv_id":"2410.02760","date":"2024-10-03","proceeding":null,"authors":["Rohit Gandikota","Sheridan Feucht","Samuel Marks","David Bau"],"abstract":"In this work, we propose Erasure of Language Memory (ELM), an approach for concept-level unlearning built on the principle of matching the distribution defined by an introspective classifier. Our key insight is that effective unlearning should leverage the model's ability to evaluate its own knowledge, using the model itself as a classifier to identify and reduce the likelihood of generating content related to undesired concepts. ELM applies this framework to create targeted low-rank updates that reduce generation probabilities for concept-specific content while preserving the model's broader capabilities. We demonstrate ELM's efficacy on biosecurity, cybersecurity, and literary domain erasure tasks. Comparative analysis shows that ELM achieves superior performance across key metrics, including near-random scores on erased topic assessments, maintained coherence in text generation, preserved accuracy on unrelated benchmarks, and robustness under adversarial attacks. Our code, data, and trained models are available at https://elm.baulab.info","url_abs":"https://arxiv.org/abs/2410.02760v2","url_pdf":"https://arxiv.org/pdf/2410.02760v2.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":"erasing-conceptual-knowledge-from-language","repo_url":"https://github.com/rohitgandikota/erasing-llm","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"specificity","task_name":"Specificity"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.02760","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.02760"}},"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/rohitgandikota/erasing-llm","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":4},"by_repo_kind":{"official":{"samples":7,"ran":3,"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":7,"samples":[{"code_sha256_prefix":"a13ff0028dc689e7","entry":"generate","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"trainscripts/erase.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/trainscripts/erase.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":"a13ff0028dc689e7"}},{"code_sha256_prefix":"868ded444472e56d","entry":"generate","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"trainscripts/prepare_consistency_data.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/trainscripts/prepare_consistency_data.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":"868ded444472e56d"}},{"code_sha256_prefix":"822e559e4fe066e8","entry":"prepare_prompts","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"trainscripts/erase.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/trainscripts/erase.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":"822e559e4fe066e8"}},{"code_sha256_prefix":"c1aaeda27d027041","entry":"get_accuracy","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/utils/metrics.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":"c1aaeda27d027041"}},{"code_sha256_prefix":"97a23d1f1385fc72","entry":"get_accuracy_binary","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/utils/metrics.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":"97a23d1f1385fc72"}},{"code_sha256_prefix":"1b37a9d657d8b81c","entry":"get_edit_vector","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"trainscripts/erase.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/trainscripts/erase.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":"1b37a9d657d8b81c"}},{"code_sha256_prefix":"360cccb0e5753168","entry":"get_wmdp_accuracy","repo":"rohitgandikota/erasing-llm","repo_kind":"official","path":"utils/metrics.py","file_url":"https://github.com/rohitgandikota/erasing-llm/blob/HEAD/utils/metrics.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":"360cccb0e5753168"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}