{"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/knowledge-in-superposition-unveiling-the","title":"Knowledge in Superposition: Unveiling the Failures of Lifelong Knowledge Editing for Large Language Models","arxiv_id":"2408.07413","date":"2024-08-14","proceeding":null,"authors":["Chenhui Hu","Pengfei Cao","Yubo Chen","Kang Liu","Jun Zhao"],"abstract":"Knowledge editing aims to update outdated or incorrect knowledge in large language models (LLMs). However, current knowledge editing methods have limited scalability for lifelong editing. This study explores the fundamental reason why knowledge editing fails in lifelong editing. We begin with the closed-form solution derived from linear associative memory, which underpins state-of-the-art knowledge editing methods. We extend the solution from single editing to lifelong editing, and through rigorous mathematical derivation, identify an interference term in the final solution, suggesting that editing knowledge may impact irrelevant knowledge. Further analysis of the interference term reveals a close relationship with superposition between knowledge representations. When knowledge superposition does not exist in language models, the interference term vanishes, allowing for lossless knowledge editing. Experiments across numerous language models reveal that knowledge superposition is universal, exhibiting high kurtosis, zero mean, and heavy-tailed distributions with clear scaling laws. Ultimately, by combining theory and experiments, we demonstrate that knowledge superposition is the fundamental reason for the failure of lifelong editing. Moreover, this is the first study to investigate knowledge editing from the perspective of superposition and provides a comprehensive observation of superposition across numerous real-world language models. Code available at https://github.com/ChenhuiHu/knowledge_in_superposition.","url_abs":"https://arxiv.org/abs/2408.07413v2","url_pdf":"https://arxiv.org/pdf/2408.07413v2.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":"knowledge-in-superposition-unveiling-the","repo_url":"https://github.com/chenhuihu/knowledge_in_superposition","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"knowledge-editing","task_name":"knowledge editing"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2408.07413","atlas_url":"https://app.syntology.ai/?focus=2408.07413","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2408.07413"}},"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/chenhuihu/knowledge_in_superposition","reach":{"status":"ok"}}],"summary":{"ran":9,"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"official":{"samples":16,"ran":10,"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":16,"samples":[{"code_sha256_prefix":"ef6d3fcae5aa04d7","entry":"determine_layer_name","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Cache_Cov.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Cache_Cov.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":"ef6d3fcae5aa04d7"}},{"code_sha256_prefix":"d36c806492129e96","entry":"determine_tmp_name","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"compute.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/compute.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d36c806492129e96"}},{"code_sha256_prefix":"671bcc4fbf0b1905","entry":"flatten_masked_batch","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"layer_stats.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/layer_stats.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":"671bcc4fbf0b1905"}},{"code_sha256_prefix":"1db0192c8fbf80f5","entry":"get_inv_cov","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"compute.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/compute.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":"1db0192c8fbf80f5"}},{"code_sha256_prefix":"b4f4ac5c6a3bcd42","entry":"get_model_layers","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Cache_Cov.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Cache_Cov.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":"b4f4ac5c6a3bcd42"}},{"code_sha256_prefix":"1cb19125da056278","entry":"get_words_idxs_in_templates","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"repr_tools.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/repr_tools.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":"1cb19125da056278"}},{"code_sha256_prefix":"920b394e7ad80c53","entry":"hierarchical_subsequence","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/util/nethook.py","link_basis":"harvester_set","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":"920b394e7ad80c53"}},{"code_sha256_prefix":"411e60fba7b021a5","entry":"load_model_and_tokenizer","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Cache_Cov.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Cache_Cov.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":"411e60fba7b021a5"}},{"code_sha256_prefix":"70f6ab8bde55420e","entry":"recursive_copy","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/util/nethook.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"70f6ab8bde55420e"}},{"code_sha256_prefix":"440ff98c2b1ae1aa","entry":"subsequence","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/util/nethook.py","link_basis":"harvester_set","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":"440ff98c2b1ae1aa"}},{"code_sha256_prefix":"4b87278bcf65e54d","entry":"dict_to_","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"layer_stats.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/layer_stats.py","link_basis":"harvester_set","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":"4b87278bcf65e54d"}},{"code_sha256_prefix":"706b5f6ef6d2c225","entry":"generate_fast","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"util/generate.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/util/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":"706b5f6ef6d2c225"}},{"code_sha256_prefix":"83a986ce81035e7d","entry":"load_dataset","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Compute_Activation_Cos.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Compute_Activation_Cos.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":"83a986ce81035e7d"}},{"code_sha256_prefix":"942eeba18c39fde7","entry":"load_dataset","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Compute_QMatrix.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Compute_QMatrix.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":"942eeba18c39fde7"}},{"code_sha256_prefix":"f8698e8cdcb6e36c","entry":"load_model_and_tokenizer","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"Compute_Activation_Cos.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/Compute_Activation_Cos.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":"f8698e8cdcb6e36c"}},{"code_sha256_prefix":"59ff38281d7c12b8","entry":"make_padded_batch","repo":"chenhuihu/knowledge_in_superposition","repo_kind":"official","path":"layer_stats.py","file_url":"https://github.com/chenhuihu/knowledge_in_superposition/blob/HEAD/layer_stats.py","link_basis":"harvester_set","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":"59ff38281d7c12b8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}