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

关系型数据库与大型语言模型上的混合查询

Hybrid Querying Over Relational Databases and Large Language Models

UC Santa Barbara(加州大学圣巴巴拉分校)

Fuheng Zhao, Divyakant Agrawal, Amr El Abbadi

AI总结:

本文提出首个跨领域混合查询基准SWAN,包含120个基于真实数据库的超出数据库范围问题,并基于模式扩展和用户定义函数提出两种解决方案,评估显示GPT-4 Turbo结合少样本提示可达40.0%执行准确率和48.2%数据事实性。

摘要:

数据库查询传统上在封闭世界假设下运行,对需要数据库存储数据之外信息的问题不提供答案。使用 SQL 的混合查询提供了一种替代方案,通过将关系型数据库与大型语言模型(LLMs)集成来回答超出数据库范围的问题。在本文中,我们提出了首个跨领域基准 SWAN,包含基于四个真实世界数据库的 120 个超出数据库范围的问题。为了利用最先进的语言模型解决 SWAN 中的这些复杂问题,我们提出了两种解决方案:一种基于模式扩展,另一种基于用户定义函数。我们还讨论了优化机会和潜在的未来方向。我们的评估表明,使用 GPT-4 Turbo 结合少样本提示,可以实现高达 40.0% 的执行准确率和 48.2% 的数据事实性。这些结果突显了混合查询的潜力和挑战。我们相信,我们的工作将激发进一步的研究,以创建更高效、更准确的数据系统,无缝集成关系型数据库和大型语言模型来解决超出数据库范围的问题。

英文摘要:

Database queries traditionally operate under the closed-world assumption, providing no answers to questions that require information beyond the data stored in the database. Hybrid querying using SQL offers an alternative by integrating relational databases with large language models (LLMs) to answer beyond-database questions. In this paper, we present the first cross-domain benchmark, SWAN, containing 120 beyond-database questions over four real-world databases. To leverage state-of-the-art language models in addressing these complex questions in SWAN, we present two solutions: one based on schema expansion and the other based on user defined functions. We also discuss optimization opportunities and potential future directions. Our evaluation demonstrates that using GPT-4 Turbo with few-shot prompts, one can achieves up to 40.0\% in execution accuracy and 48.2\% in data factuality. These results highlights both the potential and challenges for hybrid querying. We believe that our work will inspire further research in creating more efficient and accurate data systems that seamlessly integrate relational databases and large language models to address beyond-database questions.

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

↑