{"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/cake-circuit-aware-editing-enables","title":"CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners","arxiv_id":"2503.16356","date":"2025-03-20","proceeding":null,"authors":["Yunzhi Yao","Jizhan Fang","Jia-Chen Gu","Ningyu Zhang","Shumin Deng","Huajun Chen","Nanyun Peng"],"abstract":"Knowledge Editing (KE) enables the modification of outdated or incorrect information in large language models (LLMs). While existing KE methods can update isolated facts, they struggle to generalize these updates to multi-hop reasoning tasks that depend on the modified knowledge. Through an analysis of reasoning circuits -- the neural pathways LLMs use for knowledge-based inference, we observe that current layer-localized KE approaches, such as MEMIT and WISE, which edit only single or a few model layers, struggle to effectively incorporate updated information into these reasoning pathways. To address this limitation, we propose CaKE (Circuit-aware Knowledge Editing), a novel method that enables more effective integration of updated knowledge in LLMs. CaKE leverages strategically curated data, guided by our circuits-based analysis, that enforces the model to utilize the modified knowledge, stimulating the model to develop appropriate reasoning circuits for newly integrated knowledge. Experimental results show that CaKE enables more accurate and consistent use of updated knowledge across related reasoning tasks, leading to an average of 20% improvement in multi-hop reasoning accuracy on MQuAKE dataset compared to existing KE methods. We release the code and data in https://github.com/zjunlp/CaKE.","url_abs":"https://arxiv.org/abs/2503.16356v1","url_pdf":"https://arxiv.org/pdf/2503.16356v1.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":"cake-circuit-aware-editing-enables","repo_url":"https://github.com/zjunlp/cake","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"knowledge-editing","task_name":"knowledge editing"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2503.16356","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.16356"}},"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/zjunlp/cake","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/zjunlp/CaKE","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":8},"by_repo_kind":{"official":{"samples":10,"ran":2,"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":"3820700493cb2dd1","entry":"find_layers_by_classification","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/classify_results.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/classify_results.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":"3820700493cb2dd1"}},{"code_sha256_prefix":"fe0e2df4d9cb5edd","entry":"mean_pooling","repo":"zjunlp/CaKE","repo_kind":"official","path":"edit_utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/edit_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fe0e2df4d9cb5edd"}},{"code_sha256_prefix":"945b25058773f916","entry":"check_answer_in_pred","repo":"zjunlp/CaKE","repo_kind":"official","path":"edit_utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/edit_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":"945b25058773f916"}},{"code_sha256_prefix":"1d3e75561037af36","entry":"create_source_prompt","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/patch_entity_relation.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/patch_entity_relation.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":"1d3e75561037af36"}},{"code_sha256_prefix":"b4056caf852d83d8","entry":"create_target_prompt","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/patch_activations.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/patch_activations.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":"b4056caf852d83d8"}},{"code_sha256_prefix":"5c1337c4e1ef4149","entry":"find_tokens","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/patched_generation.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/patched_generation.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":"5c1337c4e1ef4149"}},{"code_sha256_prefix":"c18c0c86a00c6eee","entry":"get_layer_names","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/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":"c18c0c86a00c6eee"}},{"code_sha256_prefix":"f66e21558e4c092b","entry":"get_sent_embeddings","repo":"zjunlp/CaKE","repo_kind":"official","path":"edit_utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/edit_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":"f66e21558e4c092b"}},{"code_sha256_prefix":"bb42f5ad478b4dbf","entry":"load_model","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/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":"bb42f5ad478b4dbf"}},{"code_sha256_prefix":"91a41852736ee2f5","entry":"load_tokenizer","repo":"zjunlp/CaKE","repo_kind":"official","path":"Analysis/utils.py","file_url":"https://github.com/zjunlp/CaKE/blob/HEAD/Analysis/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":"91a41852736ee2f5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}