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的基于大语言模型的聊天机器人,在长期人工智能伴侣场景中展示了MemoryBank的应用。该机器人进一步经过心理对话微调,在其交互中展现出更高的同理心。实验包括基于真实用户对话的定性分析和基于模拟对话的定量分析。在后者中,ChatGPT扮演具有不同特征的用户,并生成涵盖广泛主题的长期对话上下文。分析结果表明,配备MemoryBank的SiliconFriend展现出强大的长期陪伴能力,因为它能够提供同理心回应、回忆相关记忆并理解用户个性。