{"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/mass-editing-memory-in-a-transformer","title":"Mass-Editing Memory in a Transformer","arxiv_id":"2210.07229","date":"2022-10-13","proceeding":null,"authors":["Kevin Meng","Arnab Sen Sharma","Alex Andonian","Yonatan Belinkov","David Bau"],"abstract":"Recent work has shown exciting promise in updating large language models with new memories, so as to replace obsolete information or add specialized knowledge. However, this line of work is predominantly limited to updating single associations. We develop MEMIT, a method for directly updating a language model with many memories, demonstrating experimentally that it can scale up to thousands of associations for GPT-J (6B) and GPT-NeoX (20B), exceeding prior work by orders of magnitude. Our code and data are at https://memit.baulab.info.","url_abs":"https://arxiv.org/abs/2210.07229v2","url_pdf":"https://arxiv.org/pdf/2210.07229v2.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":"mass-editing-memory-in-a-transformer","repo_url":"https://github.com/kmeng01/memit","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"mass-editing-memory-in-a-transformer","repo_url":"https://github.com/orange-opensource/wikifactdiff","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"gpt-neox","method_name":"GPT-NeoX"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2210.07229","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.07229"}},"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/kmeng01/memit","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/orange-opensource/wikifactdiff","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":4,"unverified":2},"by_repo_kind":{"official":{"samples":8,"ran":6,"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":"27659a9c234ffb11","entry":"binary_log_probs","repo":"kmeng01/memit","repo_kind":"official","path":"baselines/mend/losses.py","file_url":"https://github.com/kmeng01/memit/blob/HEAD/baselines/mend/losses.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"27659a9c234ffb11"}},{"code_sha256_prefix":"920b394e7ad80c53","entry":"hierarchical_subsequence","repo":"kmeng01/memit","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/kmeng01/memit/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"920b394e7ad80c53"}},{"code_sha256_prefix":"8b02eb3a3733d653","entry":"kl_loc_loss","repo":"kmeng01/memit","repo_kind":"official","path":"baselines/mend/losses.py","file_url":"https://github.com/kmeng01/memit/blob/HEAD/baselines/mend/losses.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":"8b02eb3a3733d653"}},{"code_sha256_prefix":"8ccc8886c554a1ce","entry":"multiclass_log_probs","repo":"kmeng01/memit","repo_kind":"official","path":"baselines/mend/losses.py","file_url":"https://github.com/kmeng01/memit/blob/HEAD/baselines/mend/losses.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":"8ccc8886c554a1ce"}},{"code_sha256_prefix":"70f6ab8bde55420e","entry":"recursive_copy","repo":"kmeng01/memit","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/kmeng01/memit/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70f6ab8bde55420e"}},{"code_sha256_prefix":"440ff98c2b1ae1aa","entry":"subsequence","repo":"kmeng01/memit","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/kmeng01/memit/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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"440ff98c2b1ae1aa"}},{"code_sha256_prefix":"d9a5bcaef451668f","entry":"get_model","repo":"kmeng01/memit","repo_kind":"official","path":"baselines/mend/models.py","file_url":"https://github.com/kmeng01/memit/blob/HEAD/baselines/mend/models.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":"d9a5bcaef451668f"}},{"code_sha256_prefix":"87e77d8c9c3620e1","entry":"get_tokenizer","repo":"kmeng01/memit","repo_kind":"official","path":"baselines/mend/models.py","file_url":"https://github.com/kmeng01/memit/blob/HEAD/baselines/mend/models.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":"87e77d8c9c3620e1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}