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

复杂数据检索的语义解析:面向无代码访问关系数据库的查询计划与SQL对比

Semantic Parsing for Complex Data Retrieval: Targeting Query Plans vs. SQL for No-Code Access to Relational Databases

Ben-Gurion University of the Negev(内盖夫本-古里安大学)

Ben Eyal, Amir Bachar, Ophir Haroche, Michael Elhadad

AI总结:

本文提出查询计划语言(QPL)作为SQL的替代目标,利用其模块化结构使神经语义解析器更易生成复杂查询,并通过Spider数据集实验验证,以迭代方式提升复杂组合查询的准确性。

摘要:

大型语言模型(LLMs)推动了文本到SQL(text-to-SQL)任务的进展,该任务旨在根据给定的数据库模式,从自然语言问题生成SQL查询。尽管SQL具有声明性,但它仍然是一种复杂的编程语言。在本文中,我们研究了一种具有更简单语法和复杂查询模块化规范的替代查询语言的潜力。其目的是创建一种更容易被现代神经语义解析架构学习的查询语言,同时使非程序员能够更好地评估由交互式查询计划助手生成的查询计划的有效性。\n所提出的替代查询语言称为查询计划语言(QPL)。它被设计为模块化的,可以转换为受限形式的SQL公共表表达式(CTEs)。QPL的目标是使复杂数据检索对非程序员可访问,允许用户以自然语言表达问题,同时提供更易于验证的目标语言。本文展示了神经LLMs如何利用QPL的模块化,以组合方式生成复杂的查询计划。这涉及问题分解策略和规划阶段。\n我们在Spider文本到SQL数据集的一个已转换为QPL的版本上进行了实验。QPL程序的层次结构使我们能够自然地衡量查询复杂性。基于此评估,我们识别出现有文本到SQL系统在复杂组合查询上的低准确性。我们提出了以迭代、用户可控的方式解决复杂查询挑战的方法,使用微调的LLMs和多种提示策略以组合方式进行。

英文摘要:

Large Language Models (LLMs) have spurred progress in text-to-SQL, the task of generating SQL queries from natural language questions based on a given database schema. Despite the declarative nature of SQL, it continues to be a complex programming language. In this paper, we investigate the potential of an alternative query language with simpler syntax and modular specification of complex queries. The purpose is to create a query language that can be learned more easily by modern neural semantic parsing architectures while also enabling non-programmers to better assess the validity of the query plans produced by an interactive query plan assistant. The proposed alternative query language is called Query Plan Language (QPL). It is designed to be modular and can be translated into a restricted form of SQL Common Table Expressions (CTEs). The aim of QPL is to make complex data retrieval accessible to non-programmers by allowing users to express their questions in natural language while also providing an easier-to-verify target language. The paper demonstrates how neural LLMs can benefit from QPL's modularity to generate complex query plans in a compositional manner. This involves a question decomposition strategy and a planning stage. We conduct experiments on a version of the Spider text-to-SQL dataset that has been converted to QPL. The hierarchical structure of QPL programs enables us to measure query complexity naturally. Based on this assessment, we identify the low accuracy of existing text-to-SQL systems on complex compositional queries. We present ways to address the challenge of complex queries in an iterative, user-controlled manner, using fine-tuned LLMs and a variety of prompting strategies in a compositional manner.

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

↑