用图谱和特征分解,让大模型更聪明地存取记忆。
GEM-RAG: Graphical Eigen Memories For Retrieval Augmented Generation
- 用大模型生成问题标签,标记文本片段的实用价值。
- 通过文本与问题相似性构建图谱,再用特征分解提炼主题摘要。
- 在问答任务中优于现有方法,适合需要深度理解的智能体应用。
形成、检索并基于刺激进行推理的记忆能力是通用智能的核心——它塑造了能够学习、适应和产生直觉洞察的实体。大语言模型(LLMs)在获得适当记忆或上下文后,已展现出有意义的推理与回应能力。然而,它们仍无法最优地编码、存储和检索记忆——若能实现这一点,将充分释放其作为人工智能代理的潜力,并使其专精于特定领域。为解决此问题,检索增强生成(RAG)成为有前景的研究方向,通过提供丰富的上下文示例和信息来增强LLMs。在问答(QA)任务中,标准RAG方法将文本分块嵌入,使用文本嵌入检索最相关块。受人类记忆编码与检索启发,我们提出改进:生成并编码更高层次的信息,并以问题实用性标签对块进行标注。本文引入图谱特征记忆检索增强生成(GEM-RAG)。GEM-RAG通过为文本语料库中的每个文本块添加由大模型生成的“实用性”问题标签,根据文本内容与问题标签的相似性构建图谱,并利用记忆图谱的特征分解生成捕捉核心主题的高层摘要节点。我们在统一问答(UnifiedQA)和GPT-3.5 Turbo上,结合SBERT与OpenAI文本编码器,在两个标准问答任务上评估GEM-RAG,结果表明其在这些任务上超越其他先进RAG方法。同时讨论了强健RAG系统的意义及未来方向。
原文摘要 · Abstract (English)
The ability to form, retrieve, and reason about memories in response to stimuli serves as the cornerstone for general intelligence - shaping entities capable of learning, adaptation, and intuitive insight. Large Language Models (LLMs) have proven their ability, given the proper memories or context, to reason and respond meaningfully to stimuli. However, they are still unable to optimally encode, store, and retrieve memories - the ability to do this would unlock their full ability to operate as AI agents, and to specialize to niche domains. To remedy this, one promising area of research is Retrieval Augmented Generation (RAG), which aims to augment LLMs by providing them with rich in-context examples and information. In question-answering (QA) applications, RAG methods embed the text of interest in chunks, and retrieve the most relevant chunks for a prompt using text embeddings. Motivated by human memory encoding and retrieval, we aim to improve over standard RAG methods by generating and encoding higher-level information and tagging the chunks by their utility to answer questions. We introduce Graphical Eigen Memories For Retrieval Augmented Generation (GEM-RAG). GEM-RAG works by tagging each chunk of text in a given text corpus with LLM generated ``utility'' questions, connecting chunks in a graph based on the similarity of both their text and utility questions, and then using the eigendecomposition of the memory graph to build higher level summary nodes that capture the main themes of the text. We evaluate GEM-RAG, using both UnifiedQA and GPT-3.5 Turbo as the LLMs, with SBERT, and OpenAI's text encoders on two standard QA tasks, showing that GEM-RAG outperforms other state-of-the-art RAG methods on these tasks. We also discuss the implications of having a robust RAG system and future directions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。