{"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/unleashing-infinite-length-input-capacity-for","title":"Enhancing Large Language Model with Self-Controlled Memory Framework","arxiv_id":"2304.13343","date":"2023-04-26","proceeding":null,"authors":["Bing Wang","Xinnian Liang","Jian Yang","Hui Huang","Shuangzhi Wu","Peihao Wu","Lu Lu","Zejun Ma","Zhoujun Li"],"abstract":"Large Language Models (LLMs) are constrained by their inability to process lengthy inputs, resulting in the loss of critical historical information. To address this limitation, in this paper, we propose the Self-Controlled Memory (SCM) framework to enhance the ability of LLMs to maintain long-term memory and recall relevant information. Our SCM framework comprises three key components: an LLM-based agent serving as the backbone of the framework, a memory stream storing agent memories, and a memory controller updating memories and determining when and how to utilize memories from memory stream. Additionally, the proposed SCM is able to process ultra-long texts without any modification or fine-tuning, which can integrate with any instruction following LLMs in a plug-and-play paradigm. Furthermore, we annotate a dataset to evaluate the effectiveness of SCM for handling lengthy inputs. The annotated dataset covers three tasks: long-term dialogues, book summarization, and meeting summarization. Experimental results demonstrate that our method achieves better retrieval recall and generates more informative responses compared to competitive baselines in long-term dialogues. (https://github.com/wbbeyourself/SCM4LLMs)","url_abs":"https://arxiv.org/abs/2304.13343v3","url_pdf":"https://arxiv.org/pdf/2304.13343v3.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":"unleashing-infinite-length-input-capacity-for","repo_url":"https://github.com/wbbeyourself/scm4llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"Book summarization"},{"task_slug":"document-summarization","task_name":"Document Summarization"},{"task_slug":"instruction-following","task_name":"Instruction Following"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"meeting-summarization","task_name":"Meeting Summarization"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2304.13343","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.13343"}},"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/wbbeyourself/scm4llms","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":14},"by_repo_kind":{"official":{"samples":14,"ran":0,"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":"10423bba1f11553a","entry":"count_json","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"annotation_scripts/annotation.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/annotation_scripts/annotation.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":"10423bba1f11553a"}},{"code_sha256_prefix":"b9c65960cb210134","entry":"detect_language","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"tools.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/tools.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":"b9c65960cb210134"}},{"code_sha256_prefix":"a411dfa00a1e73ea","entry":"get_concat_input","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"book_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/book_summary.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":"a411dfa00a1e73ea"}},{"code_sha256_prefix":"803c2139dfd43eaa","entry":"get_concat_input","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"dialogue_demo.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/dialogue_demo.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":"803c2139dfd43eaa"}},{"code_sha256_prefix":"7211b8c87c9e925a","entry":"get_concat_input","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"meeting_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/meeting_summary.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":"7211b8c87c9e925a"}},{"code_sha256_prefix":"1a3268e117d230ad","entry":"get_first_prompt","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"book_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/book_summary.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":"1a3268e117d230ad"}},{"code_sha256_prefix":"bb790cffb3d7e668","entry":"get_first_prompt","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"dialogue_demo.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/dialogue_demo.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":"bb790cffb3d7e668"}},{"code_sha256_prefix":"a3ed602f18ef6ed4","entry":"get_first_prompt","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"meeting_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/meeting_summary.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":"a3ed602f18ef6ed4"}},{"code_sha256_prefix":"ffef86c759629aeb","entry":"get_paragragh_prompt","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"book_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/book_summary.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":"ffef86c759629aeb"}},{"code_sha256_prefix":"5767be9e7d8c38da","entry":"get_paragragh_prompt","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"meeting_summary.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/meeting_summary.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":"5767be9e7d8c38da"}},{"code_sha256_prefix":"2d0add75408a4bea","entry":"get_token_count_davinci","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"tools.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/tools.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":"2d0add75408a4bea"}},{"code_sha256_prefix":"16be2585e4695229","entry":"get_tokenizer_func","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"core/book.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/core/book.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":"16be2585e4695229"}},{"code_sha256_prefix":"80afe2c0051330cf","entry":"load_cache","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"core/api.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/core/api.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":"80afe2c0051330cf"}},{"code_sha256_prefix":"518f9bb7fbca9816","entry":"validate_input","repo":"wbbeyourself/scm4llms","repo_kind":"official","path":"annotation_scripts/annotation.py","file_url":"https://github.com/wbbeyourself/scm4llms/blob/HEAD/annotation_scripts/annotation.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":"518f9bb7fbca9816"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}