Revolutionary advancements in Large Language Models have drastically reshaped our interactions with artificial intelligence systems. Despite this, a notable hindrance remains-the deficiency of a long-term memory mechanism within these models. This shortfall becomes increasingly evident in situations demanding sustained interaction, such as personal companion systems and psychological counseling. Therefore, we propose MemoryBank, a novel memory mechanism tailored for LLMs. MemoryBank enables the models to summon relevant memories, continually evolve through continuous memory updates, comprehend, and adapt to a user personality by synthesizing information from past interactions. To mimic anthropomorphic behaviors and selectively preserve memory, MemoryBank incorporates a memory updating mechanism, inspired by the Ebbinghaus Forgetting Curve theory, which permits the AI to forget and reinforce memory based on time elapsed and the relative significance of the memory, thereby offering a human-like memory mechanism. MemoryBank is versatile in accommodating both closed-source models like ChatGPT and open-source models like ChatGLM. We exemplify application of MemoryBank through the creation of an LLM-based chatbot named SiliconFriend in a long-term AI Companion scenario. Further tuned with psychological dialogs, SiliconFriend displays heightened empathy in its interactions. Experiment involves both qualitative analysis with real-world user dialogs and quantitative analysis with simulated dialogs. In the latter, ChatGPT acts as users with diverse characteristics and generates long-term dialog contexts covering a wide array of topics. The results of our analysis reveal that SiliconFriend, equipped with MemoryBank, exhibits a strong capability for long-term companionship as it can provide emphatic response, recall relevant memories and understand user personality.
翻译:大型语言模型的革命性进展已深刻改变了我们与人工智能系统的交互方式。然而,一个显著障碍依然存在——这些模型缺乏长期记忆机制。这一缺陷在需要持续交互的场景(如个人伴侣系统和心理咨询)中尤为明显。为此,我们提出MemoryBank——一种专为大型语言模型设计的全新记忆机制。MemoryBank使模型能够召回相关记忆,通过持续记忆更新不断进化,并基于过往交互信息理解与适应用户个性。为模拟拟人化行为并选择性保留记忆,MemoryBank采用了基于艾宾浩斯遗忘曲线理论的记忆更新机制,允许人工智能根据时间流逝和记忆的相对重要性进行遗忘与强化,从而提供类人记忆机制。MemoryBank兼具灵活性,可兼容ChatGPT等闭源模型与ChatGLM等开源模型。我们通过构建名为SiliconFriend的长期AI伴侣场景来展示MemoryBank的应用——该对话机器人基于大型语言模型开发,并通过心理对话微调使其交互更具共情能力。实验包含基于真实用户对话的定性分析与基于模拟对话的定量分析。后者中,ChatGPT扮演具有多样特征的用户,生成覆盖广泛主题的长期对话语境。分析结果表明,配备MemoryBank的SiliconFriend展现出强大的长期陪伴能力,能够提供共情回应、召回相关记忆并理解用户个性。