{"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-2510-18866","title":"LightMem: Lightweight and Efficient Memory-Augmented Generation","arxiv_id":"2510.18866","date":"2025-10-21","proceeding":"ICLR","authors":["Jizhan Fang","Xinle Deng","Haoming Xu","Ziyan Jiang","Yuqi Tang","Ziwen Xu","Shumin Deng","Yunzhi Yao","Mengru Wang","Shuofei Qiao","Huajun Chen","Ningyu Zhang"],"abstract":"Despite their remarkable capabilities, Large Language Models (LLMs) struggle to effectively leverage historical interaction information in dynamic and complex environments. Memory systems enable LLMs to move beyond stateless interactions by introducing persistent information storage, retrieval, and utilization mechanisms. However, existing memory systems often introduce substantial time and computational overhead. To this end, we introduce a new memory system called LightMem, which strikes a balance between the performance and efficiency of memory systems. Inspired by the Atkinson-Shiffrin model of human memory, LightMem organizes memory into three complementary stages. First, cognition-inspired sensory memory rapidly filters irrelevant information through lightweight compression and groups information according to their topics. Next, topic-aware short-term memory consolidates these topic-based groups, organizing and summarizing content for more structured access. Finally, long-term memory with sleep-time update employs an offline procedure that decouples consolidation from online inference. On LongMemEval and LoCoMo, using GPT and Qwen backbones, LightMem consistently surpasses strong baselines, improving QA accuracy by up to 7.7% / 29.3%, reducing total token usage by up to 38x / 20.9x and API calls by up to 30x / 55.5x, while purely online test-time costs are even lower, achieving up to 106x / 117x token reduction and 159x / 310x fewer API calls. The code is available at https://github.com/zjunlp/LightMem.","url_abs":"https://arxiv.org/abs/2510.18866","url_pdf":"https://arxiv.org/pdf/2510.18866","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":{"atlas_url":"https://app.syntology.ai/?focus=2510.18866","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2510.18866"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/zjunlp/LightMem","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"unverified":6},"by_repo_kind":{"found_in_text":{"samples":7,"ran":1,"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":"8e4f7c8ecedd17fa","entry":"get_anscheck_prompt","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"experiments/longmemeval/run_lightmem_gpt.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/experiments/longmemeval/run_lightmem_gpt.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8e4f7c8ecedd17fa"}},{"code_sha256_prefix":"678788a945dfe814","entry":"assign_sequence_numbers_with_timestamps","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"src/lightmem/memory/utils.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/src/lightmem/memory/utils.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":"678788a945dfe814"}},{"code_sha256_prefix":"9b74125509be5828","entry":"clean_response","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"src/lightmem/memory/utils.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/src/lightmem/memory/utils.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":"9b74125509be5828"}},{"code_sha256_prefix":"b528422968655fae","entry":"get_tokenizer_for_model","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"src/lightmem/memory_toolkits/token_monitor.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/src/lightmem/memory_toolkits/token_monitor.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":"b528422968655fae"}},{"code_sha256_prefix":"71ac5d11bf237b07","entry":"make_attr_patch","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"src/lightmem/memory_toolkits/monkey_patch.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/src/lightmem/memory_toolkits/monkey_patch.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":"71ac5d11bf237b07"}},{"code_sha256_prefix":"dcc248d6e996daf9","entry":"save_memory_entries","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"src/lightmem/memory/utils.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/src/lightmem/memory/utils.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":"dcc248d6e996daf9"}},{"code_sha256_prefix":"c799cf59bf6b0ace","entry":"true_or_false","repo":"zjunlp/LightMem","repo_kind":"found_in_text","path":"experiments/longmemeval/run_lightmem_gpt.py","file_url":"https://github.com/zjunlp/LightMem/blob/HEAD/experiments/longmemeval/run_lightmem_gpt.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":"c799cf59bf6b0ace"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_api"},"syntology_extracted_results":null}