arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.15071cs.DBcs.CL
收藏

关系数据库增强的大型语言模型

Relational Database Augmented Large Language Model

University of California, Los Angeles(加利福尼亚大学洛杉矶分校);Amazon(亚马逊公司)

Zongyue Qin, Chen Luo, Zhengyang Wang, Haoming Jiang, Yizhou Sun

AI总结:

提出一种LLM无关的记忆架构,通过数据库选择记忆、数据值记忆和关系数据库增强大型语言模型,使其能回答超出直接能力的数据库相关问题。

摘要:

大型语言模型(LLM)在许多自然语言处理(NLP)任务中表现出色。然而,由于LLM只能通过训练或监督微调过程来整合新知识,它们不适用于需要训练语料库中不可用的精确、最新和私有信息的应用。这些精确、最新和私有信息通常存储在关系数据库中。因此,一个有前景的解决方案是将关系数据库作为外部记忆来增强LLM。这可以确保数据的及时性、正确性和一致性,并帮助LLM执行超出其固有能力范围的复杂算术运算。然而,弥合LLM与关系数据库之间的差距具有挑战性。它需要感知数据库以及存储在数据库中的数据值,以选择正确的数据库并发出正确的SQL查询。此外,外部记忆必须独立于LLM以满足现实应用的需求。我们引入了一种新颖的LLM无关记忆架构,包括数据库选择记忆、数据值记忆和关系数据库。我们设计了一个优雅的流水线来从中检索信息。此外,我们精心设计了提示词以指导LLM最大化框架的潜力。为了评估我们的方法,我们构建了一个包含各种类型问题的新数据集。实验结果表明,我们的框架使LLM能够有效回答与数据库相关的问题,这超出了它们的直接能力。

英文摘要:

Large language models (LLMs) excel in many natural language processing (NLP) tasks. However, since LLMs can only incorporate new knowledge through training or supervised fine-tuning processes, they are unsuitable for applications that demand precise, up-to-date, and private information not available in the training corpora. This precise, up-to-date, and private information is typically stored in relational databases. Thus, a promising solution is to augment LLMs with the inclusion of relational databases as external memory. This can ensure the timeliness, correctness, and consistency of data, and assist LLMs in performing complex arithmetic operations beyond their inherent capabilities. However, bridging the gap between LLMs and relational databases is challenging. It requires the awareness of databases and data values stored in databases to select correct databases and issue correct SQL queries. Besides, it is necessary for the external memory to be independent of the LLM to meet the needs of real-world applications. We introduce a novel LLM-agnostic memory architecture comprising a database selection memory, a data value memory, and relational databases. And we design an elegant pipeline to retrieve information from it. Besides, we carefully design the prompts to instruct the LLM to maximize the framework's potential. To evaluate our method, we compose a new dataset with various types of questions. Experimental results show that our framework enables LLMs to effectively answer database-related questions, which is beyond their direct ability.

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

↑