{"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/arxiv-2512-14395","title":"Massive Editing for Large Language Models Based on Dynamic Weight Generation","arxiv_id":"2512.14395","date":"2025-12-16","proceeding":"ICLR","authors":["Wentao Wan","Qiqing Lao","Zhiwei Xie","Hefeng Wu","Runnan Lin","Liang Lin","Keze Wang"],"abstract":"Knowledge Editing (KE) is a field that studies how to modify some knowledge in Large Language Models (LLMs) at a low cost (compared to pre-training). Currently, performing large-scale edits on LLMs while ensuring the Reliability, Generality, and Locality metrics of the edits remain a challenge. This paper proposes a Massive editing approach for LLMs based on dynamic weight Generation (MeG). Our MeG involves attaching a dynamic weight neuron to specific layers of the LLMs and using a diffusion model to conditionally generate the weights of this neuron based on the input query required for the knowledge. This allows the use of adding a single dynamic weight neuron to achieve the goal of large-scale knowledge editing. Experiments show that our MeG can significantly improve the performance of large-scale KE in terms of Reliability, Generality, and Locality metrics compared to existing knowledge editing methods, particularly with a high percentage point increase in the absolute value index for the Locality metric, demonstrating the advantages of our proposed method. Code is available at https://github.com/RodeWayne/MeG-for-Knowledge-Editing.","url_abs":"https://arxiv.org/abs/2512.14395","url_pdf":"https://arxiv.org/pdf/2512.14395","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2512.14395","atlas_url":"https://app.syntology.ai/?focus=2512.14395","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2512.14395"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing","reach":{"status":"ok"}}],"summary":{"ran_honours":1,"ran_draft_wrong":1,"unverified":15},"by_repo_kind":{"found_in_text":{"samples":17,"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":17,"samples":[{"code_sha256_prefix":"c92c27c924b517e8","entry":"get_2d_sincos_pos_embed","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"my_model_five_bert_text.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/my_model_five_bert_text.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c92c27c924b517e8"}},{"code_sha256_prefix":"03310bba324ae4fb","entry":"modulate","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"my_model_five_bert_text.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/my_model_five_bert_text.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"03310bba324ae4fb"}},{"code_sha256_prefix":"dcbd23023c3da46b","entry":"add_neuron_for_phi2","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"util.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/util.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":"dcbd23023c3da46b"}},{"code_sha256_prefix":"bfbaec02d9d18c4d","entry":"adjust_dots","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"util.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/util.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":"bfbaec02d9d18c4d"}},{"code_sha256_prefix":"8382f7e48cc8a309","entry":"create_logger","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_ddp.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_ddp.py","link_basis":"plan_row","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":"8382f7e48cc8a309"}},{"code_sha256_prefix":"665d8a4e8f673a4c","entry":"get_2d_sincos_pos_embed_from_grid","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"my_model_five_bert_text.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/my_model_five_bert_text.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":"665d8a4e8f673a4c"}},{"code_sha256_prefix":"20ab2d83f9eb2816","entry":"get_config","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_neuron.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_neuron.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":"20ab2d83f9eb2816"}},{"code_sha256_prefix":"db1b92e53aaafcee","entry":"get_llm_response","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"get_edit_and_loc_data.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/get_edit_and_loc_data.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":"db1b92e53aaafcee"}},{"code_sha256_prefix":"288bee548024f0bc","entry":"info_nce_loss","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_bert.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_bert.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":"288bee548024f0bc"}},{"code_sha256_prefix":"5fbc5400f0375e4d","entry":"initial_llama_model","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"util.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/util.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":"5fbc5400f0375e4d"}},{"code_sha256_prefix":"0c46563c5bb7d9e3","entry":"load_json_data","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"merge_results.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/merge_results.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":"0c46563c5bb7d9e3"}},{"code_sha256_prefix":"5f81834e47a60a64","entry":"load_model","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"myDataloader_bert_text_add_nq_lr.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/myDataloader_bert_text_add_nq_lr.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":"5f81834e47a60a64"}},{"code_sha256_prefix":"4a80e760cc60c9b9","entry":"load_model","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"myDataloader_cf_bert_text_add_nq_lr.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/myDataloader_cf_bert_text_add_nq_lr.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":"4a80e760cc60c9b9"}},{"code_sha256_prefix":"a5a29951e70ee65e","entry":"main","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"merge_results.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/merge_results.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":"a5a29951e70ee65e"}},{"code_sha256_prefix":"22698492eed06605","entry":"test","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_neuron.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_neuron.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":"22698492eed06605"}},{"code_sha256_prefix":"6abbca9a6f12ddc0","entry":"train_model","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_bert.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_bert.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":"6abbca9a6f12ddc0"}},{"code_sha256_prefix":"06c173059754daf6","entry":"train_once","repo":"RodeWayne/MeG-for-Knowledge-Editing","repo_kind":"found_in_text","path":"train_neuron.py","file_url":"https://github.com/RodeWayne/MeG-for-Knowledge-Editing/blob/HEAD/train_neuron.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":"06c173059754daf6"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.AI","source":"arxiv_api"},"syntology_extracted_results":null}