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

使用SQL查询大型语言模型

Querying Large Language Models with SQL

EURECOM;Google AI(谷歌AI)

Mohammed Saeed, Nicola De Cao, Paolo Papotti

AI总结:

本文提出Galois原型系统,通过引入查询LLM的物理操作符,实现使用SQL查询大型语言模型以提取非结构化文本信息,为混合查询处理提供了新方向。

摘要:

在许多应用场景中,信息以文本形式存储,但无法以结构化数据的形式获取。然而,从自然语言文本中提取数据以精确匹配模式(schema),从而实现查询,是一项具有挑战性的任务。随着预训练大型语言模型(LLMs)的兴起,现在有了一种有效的方法来存储和使用从海量文本文档语料库中提取的信息。因此,我们设想通过利用LLMs中的信息,使用SQL查询来涵盖传统数据库无法捕获的广泛数据。为了实现这一愿景,我们提出了Galois,这是一个基于传统数据库架构的原型系统,但引入了用于查询底层LLM的全新物理操作符。其核心思想是使用从LLM中检索数据的提示词来执行查询计划中的某些操作符。对于一大类SQL查询,查询LLMs能返回结构良好的关系,并取得了令人鼓舞的定性结果。初步实验结果使预训练LLMs成为数据库系统领域一个有前景的补充,为混合查询处理引入了新的方向。然而,我们指出了构建利用LLMs的数据库管理系统(DBMS)必须解决的几个研究挑战。其中一些挑战需要整合自然语言处理(NLP)文献中的概念,而另一些则为数据库(DB)社区提供了全新的研究途径。

英文摘要:

In many use-cases, information is stored in text but not available in structured data. However, extracting data from natural language text to precisely fit a schema, and thus enable querying, is a challenging task. With the rise of pre-trained Large Language Models (LLMs), there is now an effective solution to store and use information extracted from massive corpora of text documents. Thus, we envision the use of SQL queries to cover a broad range of data that is not captured by traditional databases by tapping the information in LLMs. To ground this vision, we present Galois, a prototype based on a traditional database architecture, but with new physical operators for querying the underlying LLM. The main idea is to execute some operators of the the query plan with prompts that retrieve data from the LLM. For a large class of SQL queries, querying LLMs returns well structured relations, with encouraging qualitative results. Preliminary experimental results make pre-trained LLMs a promising addition to the field of database systems, introducing a new direction for hybrid query processing. However, we pinpoint several research challenges that must be addressed to build a DBMS that exploits LLMs. While some of these challenges necessitate integrating concepts from the NLP literature, others offer novel research avenues for the DB community.

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

↑