arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2311.01173cs.CL
收藏

CRUSH4SQL:利用模式幻觉进行集体检索的Text2SQL方法

CRUSH4SQL: Collective Retrieval Using Schema Hallucination For Text2SQL

Indian Institute of Technology Bombay(印度理工学院孟买分校)

Mayank Kothyari, Dhruva Dhingra, Sunita Sarawagi, Soumen Chakrabarti

AI总结:

本文提出CRUSH4SQL方法,通过让LLM幻觉最小模式并结合多次稠密检索,解决大型数据库Text2SQL中的模式子集划分问题,并在新构建的三个基准上取得显著更高的召回率。

摘要:

现有的Text-to-SQL生成器需要将整个数据库模式与用户文本一起编码。对于拥有数万列的大型数据库而言,这种做法成本高昂或不切实际。标准稠密检索技术不足以对大型结构化数据库进行模式子集划分,因为正确的检索语义要求我们对模式元素集合而非单个元素进行排序。为此,我们提出了一种两阶段过程以实现检索过程中的有效覆盖。首先,我们指示大语言模型(LLM)幻觉出一个被认为足以回答查询的最小数据库模式。我们利用该幻觉模式,通过组合多次稠密检索的结果来检索实际模式的一个子集。值得注意的是,幻觉——通常被认为是一种麻烦——实际上作为一种桥接机制被证明是有用的。由于目前不存在针对大型数据库模式子集划分的基准,我们引入了三个基准。两个半合成数据集来源于两个知名数据集SPIDER和BIRD的模式并集,分别包含4502个和798个模式元素。一个名为SocialDB的真实基准来源于一个实际的大型数据仓库,包含17844个模式元素。我们表明,我们的方法在召回率上显著高于当前最先进的基于检索的增强方法。

英文摘要:

Existing Text-to-SQL generators require the entire schema to be encoded with the user text. This is expensive or impractical for large databases with tens of thousands of columns. Standard dense retrieval techniques are inadequate for schema subsetting of a large structured database, where the correct semantics of retrieval demands that we rank sets of schema elements rather than individual elements. In response, we propose a two-stage process for effective coverage during retrieval. First, we instruct an LLM to hallucinate a minimal DB schema deemed adequate to answer the query. We use the hallucinated schema to retrieve a subset of the actual schema, by composing the results from multiple dense retrievals. Remarkably, hallucination $\unicode{x2013}$ generally considered a nuisance $\unicode{x2013}$ turns out to be actually useful as a bridging mechanism. Since no existing benchmarks exist for schema subsetting on large databases, we introduce three benchmarks. Two semi-synthetic datasets are derived from the union of schemas in two well-known datasets, SPIDER and BIRD, resulting in 4502 and 798 schema elements respectively. A real-life benchmark called SocialDB is sourced from an actual large data warehouse comprising 17844 schema elements. We show that our method1 leads to significantly higher recall than SOTA retrieval-based augmentation methods.

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

↑