{"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/wise-rethinking-the-knowledge-memory-for","title":"WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models","arxiv_id":"2405.14768","date":"2024-05-23","proceeding":null,"authors":["Peng Wang","Zexi Li","Ningyu Zhang","Ziwen Xu","Yunzhi Yao","Yong Jiang","Pengjun Xie","Fei Huang","Huajun Chen"],"abstract":"Large language models (LLMs) need knowledge updates to meet the ever-growing world facts and correct the hallucinated responses, facilitating the methods of lifelong model editing. Where the updated knowledge resides in memories is a fundamental question for model editing. In this paper, we find that editing either long-term memory (direct model parameters) or working memory (non-parametric knowledge of neural network activations/representations by retrieval) will result in an impossible triangle -- reliability, generalization, and locality can not be realized together in the lifelong editing settings. For long-term memory, directly editing the parameters will cause conflicts with irrelevant pretrained knowledge or previous edits (poor reliability and locality). For working memory, retrieval-based activations can hardly make the model understand the edits and generalize (poor generalization). Therefore, we propose WISE to bridge the gap between memories. In WISE, we design a dual parametric memory scheme, which consists of the main memory for the pretrained knowledge and a side memory for the edited knowledge. We only edit the knowledge in the side memory and train a router to decide which memory to go through when given a query. For continual editing, we devise a knowledge-sharding mechanism where different sets of edits reside in distinct subspaces of parameters, and are subsequently merged into a shared memory without conflicts. Extensive experiments show that WISE can outperform previous model editing methods and overcome the impossible triangle under lifelong model editing of question answering, hallucination, and out-of-distribution settings across trending LLM architectures, e.g., GPT, LLaMA, and Mistral. Code is available at https://github.com/zjunlp/EasyEdit.","url_abs":"https://arxiv.org/abs/2405.14768v3","url_pdf":"https://arxiv.org/pdf/2405.14768v3.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":"wise-rethinking-the-knowledge-memory-for","repo_url":"https://github.com/zjunlp/easyedit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"model-editing","task_name":"Model Editing"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt","method_name":"GPT"},{"method_slug":"llama","method_name":"LLaMA"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.14768","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14768"}},"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":"deterministic:regex_extraction","url":"https://github.com/kmeng01/rome","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zjunlp/easyedit","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5,"ran_fixture":6,"ran_draft_wrong":1,"ran_honours":1,"unverified":3},"by_repo_kind":{"official":{"samples":16,"ran":13,"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":"6556782be86e66b2","entry":"EditingMeanAct","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6556782be86e66b2"}},{"code_sha256_prefix":"7e7272686fd1e3c2","entry":"bernoulli","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7e7272686fd1e3c2"}},{"code_sha256_prefix":"e6c1e18615ecb8af","entry":"euc","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.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":"e6c1e18615ecb8af"}},{"code_sha256_prefix":"5bb8c583c306754b","entry":"get_mask","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5bb8c583c306754b"}},{"code_sha256_prefix":"a0efe0cf5f74ca6c","entry":"get_task_vectors","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.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":"a0efe0cf5f74ca6c"}},{"code_sha256_prefix":"1bfce29de3b973b3","entry":"lerp","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1bfce29de3b973b3"}},{"code_sha256_prefix":"f3e855a894dfa058","entry":"linear","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","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":"f3e855a894dfa058"}},{"code_sha256_prefix":"6a246076445216f3","entry":"magnitude","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a246076445216f3"}},{"code_sha256_prefix":"10ff293597eab810","entry":"maybe_torch","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"10ff293597eab810"}},{"code_sha256_prefix":"a6e2f5aa10f37b10","entry":"normalize","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a6e2f5aa10f37b10"}},{"code_sha256_prefix":"8b2a5f4da7fc7241","entry":"random_wo_rescaled","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b2a5f4da7fc7241"}},{"code_sha256_prefix":"1abba92e438efda1","entry":"rescaled_random","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1abba92e438efda1"}},{"code_sha256_prefix":"e595256c414955d3","entry":"slerp","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.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":"e595256c414955d3"}},{"code_sha256_prefix":"a78f1fb529d93321","entry":"GTA","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","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":"a78f1fb529d93321"}},{"code_sha256_prefix":"e9d558c06d4f86ba","entry":"WISE","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","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":"e9d558c06d4f86ba"}},{"code_sha256_prefix":"f978bb953aa03b08","entry":"WISEAdapter","repo":"zjunlp/easyedit","repo_kind":"official","path":"easyeditor/models/wise/WISE.py","file_url":"https://github.com/zjunlp/easyedit/blob/HEAD/easyeditor/models/wise/WISE.py","link_basis":"first_harvest_node","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":"f978bb953aa03b08"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}