arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.02582cs.CLcs.AIcs.LG
收藏

适应与分解:通过领域自适应最少到最多提示实现文本到SQL的高效泛化

Adapt and Decompose: Efficient Generalization of Text-to-SQL via Domain Adapted Least-To-Most Prompting

TCS Research(塔塔咨询服务研究部)

Aseem Arora, Shabbirhussain Bhaisaheb, Harshit Nigam, Manasi Patwardhan, Lovekesh Vig, Gautam Shroff

AI总结:

本文提出一种离线采样少样本并自动适配数据库领域的分解式最少到最多提示方法,在KaggleDBQA上实现文本到SQL的高效跨领域与跨组合泛化,性能优于通用提示且不依赖特定模型。

摘要:

文本到SQL语义解析的跨领域和跨组合泛化是一项具有挑战性的任务。现有基于大型语言模型(LLM)的解决方案依赖于在推理时从训练集中检索少样本示例,为每个自然语言(NL)测试查询合成运行时提示。相比之下,我们设计了一种算法,该算法从训练数据中离线采样一个最小少样本集合,在允许的令牌长度内完整覆盖SQL子句、运算符和函数,并实现最大领域覆盖。这使得能够合成一个固定的通用提示(GP),其中包含跨NL测试查询通用的多样化示例集合,避免了昂贵的测试时示例检索。我们进一步将GP自动适配到目标数据库领域(DA-GP),以更好地处理跨领域泛化;随后采用分解式最少到最多提示(LTMP-DA-GP)来处理跨组合泛化。LTMP-DA-GP的合成是一项离线任务,每个新数据库只需执行一次,且人工干预最少。我们的方法在KaggleDBQA数据集上展示了优越性能,该数据集旨在评估文本到SQL任务的泛化能力。我们进一步展示了LTMP-DA-GP相对于GP在KaggleDBQA的各LLM和数据库上的一致性能提升,突显了我们基于提示的适应与分解方法的有效性和模型无关优势。

英文摘要:

Cross-domain and cross-compositional generalization of Text-to-SQL semantic parsing is a challenging task. Existing Large Language Model (LLM) based solutions rely on inference-time retrieval of few-shot exemplars from the training set to synthesize a run-time prompt for each Natural Language (NL) test query. In contrast, we devise an algorithm which performs offline sampling of a minimal set-of few-shots from the training data, with complete coverage of SQL clauses, operators and functions, and maximal domain coverage within the allowed token length. This allows for synthesis of a fixed Generic Prompt (GP), with a diverse set-of exemplars common across NL test queries, avoiding expensive test time exemplar retrieval. We further auto-adapt the GP to the target database domain (DA-GP), to better handle cross-domain generalization; followed by a decomposed Least-To-Most-Prompting (LTMP-DA-GP) to handle cross-compositional generalization. The synthesis of LTMP-DA-GP is an offline task, to be performed one-time per new database with minimal human intervention. Our approach demonstrates superior performance on the KaggleDBQA dataset, designed to evaluate generalizability for the Text-to-SQL task. We further showcase consistent performance improvement of LTMP-DA-GP over GP, across LLMs and databases of KaggleDBQA, highlighting the efficacy and model agnostic benefits of our prompt based adapt and decompose approach.

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

↑