{"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/larimar-large-language-models-with-episodic","title":"Larimar: Large Language Models with Episodic Memory Control","arxiv_id":"2403.11901","date":"2024-03-18","proceeding":null,"authors":["Payel Das","Subhajit Chaudhury","Elliot Nelson","Igor Melnyk","Sarath Swaminathan","Sihui Dai","Aurélie Lozano","Georgios Kollias","Vijil Chenthamarakshan","Jiří","Navrátil","Soham Dan","Pin-Yu Chen"],"abstract":"Efficient and accurate updating of knowledge stored in Large Language Models (LLMs) is one of the most pressing research challenges today. This paper presents Larimar - a novel, brain-inspired architecture for enhancing LLMs with a distributed episodic memory. Larimar's memory allows for dynamic, one-shot updates of knowledge without the need for computationally expensive re-training or fine-tuning. Experimental results on multiple fact editing benchmarks demonstrate that Larimar attains accuracy comparable to most competitive baselines, even in the challenging sequential editing setup, but also excels in speed - yielding speed-ups of 8-10x depending on the base LLM - as well as flexibility due to the proposed architecture being simple, LLM-agnostic, and hence general. We further provide mechanisms for selective fact forgetting, information leakage prevention, and input context length generalization with Larimar and show their effectiveness. Our code is available at https://github.com/IBM/larimar","url_abs":"https://arxiv.org/abs/2403.11901v4","url_pdf":"https://arxiv.org/pdf/2403.11901v4.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":"larimar-large-language-models-with-episodic","repo_url":"https://github.com/ibm/larimar","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.11901","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.11901"}},"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/IBM/larimar","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ibm/larimar","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":8,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":8,"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":"82accf3adde1f8c3","entry":"GPM","repo":"ibm/larimar","repo_kind":"official","path":"larimar_base/modules/memory.py","file_url":"https://github.com/ibm/larimar/blob/HEAD/larimar_base/modules/memory.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"82accf3adde1f8c3"}},{"code_sha256_prefix":"042f67ef31a5557d","entry":"get_tfidf_vectorizer","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/counterfact_eval.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/counterfact_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"042f67ef31a5557d"}},{"code_sha256_prefix":"87a4396ef404f47b","entry":"gumbel_softmax","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/modules/cara.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/modules/cara.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"87a4396ef404f47b"}},{"code_sha256_prefix":"24917c0c46cbfb0f","entry":"gumbel_softmax_sample","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/modules/cara.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/modules/cara.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"24917c0c46cbfb0f"}},{"code_sha256_prefix":"d813bd9a864df6e1","entry":"latent_code_from_text","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/demo_utils.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/demo_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d813bd9a864df6e1"}},{"code_sha256_prefix":"40c74194ba2f2ccb","entry":"latent_code_from_text_single","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/counterfact_eval.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/counterfact_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"40c74194ba2f2ccb"}},{"code_sha256_prefix":"be354c92aa1305df","entry":"process_results","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/counterfact_eval.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/counterfact_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"be354c92aa1305df"}},{"code_sha256_prefix":"5e09673708d9ac7e","entry":"sample_gumbel","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/modules/cara.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/modules/cara.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5e09673708d9ac7e"}},{"code_sha256_prefix":"00f0cc69dc63ecd2","entry":"init_ddp_process_group","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/ddp.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/ddp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"00f0cc69dc63ecd2"}},{"code_sha256_prefix":"649a7fe08874330c","entry":"mask_tokens","repo":"IBM/larimar","repo_kind":"official","path":"larimar_base/lightning_model.py","file_url":"https://github.com/IBM/larimar/blob/HEAD/larimar_base/lightning_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"649a7fe08874330c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}