arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2405.12528cs.CL
收藏

SirLLM:流式无限记忆大语言模型

SirLLM: Streaming Infinite Retentive LLM

Shanghai Jiao Tong University(上海交通大学);MoE Key Lab of Artificial Intelligence, AI Institute, Shanghai Jiao Tong University(教育部人工智能重点实验室、上海交通大学人工智能研究院)

Yao Yao, Zuchao Li, Hai Zhao

AI总结:

针对流式输入下大语言模型长期记忆受损的问题,提出无需微调的SirLLM框架,通过词元熵与记忆衰减筛选关键信息,在多任务多模型上实现稳定显著的记忆能力提升。

摘要:

随着大语言模型(LLM)在各领域日益普及,其处理任意长度输入并维持一定记忆能力的需求变得至关重要。然而,一次性输入过长文本存在局限:研究表明,当输入长度超过LLM的预训练文本长度时,文本生成能力会急剧下降。此外,由于长文本数据获取难度大,且会给LLM带来极高的内存消耗成本,单纯延长预训练文本长度并不现实。近期研究采用流式输入来缓解过长文本输入的压力,但这种方法会严重损害模型的长期记忆能力。\n受这一挑战启发,我们提出了流式无限记忆大语言模型(SirLLM),它无需微调即可让LLM在无限长度对话中维持更长时间的记忆。SirLLM利用Token Entropy(词元熵)指标和记忆衰减机制筛选关键短语,使LLM兼具持久且灵活的记忆能力。我们设计了三项不同任务并构建了三个数据集,从多个维度衡量SirLLM的有效性:(1)DailyDialog(日常对话);(2)Grocery Shopping(杂货购物);(3)Rock-Paper-Scissors(石头剪刀布)。实验结果有力证明,SirLLM在不同LLM和任务上均能实现稳定且显著的提升,充分验证了其有效性。对话时“一位先生可能会忘记自己”,但SirLLM永远不会!我们的代码已公开于https://github.com/Zoeyyao27/SirLLM。

英文摘要:

As Large Language Models (LLMs) become increasingly prevalent in various domains, their ability to process inputs of any length and maintain a degree of memory becomes essential. However, the one-off input of overly long texts is limited, as studies have shown that when input lengths exceed the LLMs' pre-trained text length, there is a dramatic decline in text generation capabilities. Moreover, simply extending the length of pre-training texts is impractical due to the difficulty in obtaining long text data and the substantial memory consumption costs this would entail for LLMs. Recent efforts have employed streaming inputs to alleviate the pressure of excessively long text inputs, but this approach can significantly impair the model's long-term memory capabilities. Motivated by this challenge, we introduce Streaming Infinite Retentive LLM (SirLLM), which allows LLMs to maintain longer memory during infinite-length dialogues without the need for fine-tuning. SirLLM utilizes the Token Entropy metric and a memory decay mechanism to filter key phrases, endowing LLMs with both long-lasting and flexible memory. We designed three distinct tasks and constructed three datasets to measure the effectiveness of SirLLM from various angles: (1) DailyDialog; (2) Grocery Shopping; (3) Rock-Paper-Scissors. Our experimental results robustly demonstrate that SirLLM can achieve stable and significant improvements across different LLMs and tasks, compellingly proving its effectiveness. When having a coversation, "A sir could forget himself," but SirLLM never does! Our code is publicly available at https://github.com/Zoeyyao27/SirLLM

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑