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)
翻译:大型语言模型(LLMs)受限于其处理长文本输入的能力,导致关键历史信息的丢失。为了解决这一局限性,本文提出了自控制记忆(Self-Controlled Memory, SCM)框架,以增强LLMs维持长期记忆并回忆相关信息的能力。我们的SCM框架包含三个关键组件:作为框架骨干的基于LLM的智能体、存储智能体记忆的记忆流,以及更新记忆并决定何时以及如何利用记忆流中记忆的记忆控制器。此外,所提出的SCM无需任何修改或微调即可处理超长文本,能够以即插即用的方式与任何遵循指令的LLMs集成。同时,我们标注了一个数据集以评估SCM在处理长输入时的有效性。该标注数据集涵盖三个任务:长期对话、书籍摘要和会议摘要。实验结果表明,与长期对话中的竞争基线相比,我们的方法实现了更好的检索召回率并生成更信息丰富的响应。(https://github.com/wbbeyourself/SCM4LLMs)