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