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

基于AST排序和模式剪枝改进检索增强的Text-to-SQL

Improving Retrieval-augmented Text-to-SQL with AST-based Ranking and Schema Pruning

Huawei Technologies(华为技术有限公司);CSI(英国计算机科学研究所)

Zhili Shen, Pavlos Vougiouklis, Chenxin Diao, Kaustubh Vyas, Yuanyi Ji, Jeff Z. Pan

AI总结:

本文提出ASTReS框架,通过动态检索数据库信息、基于抽象语法树选择少样本示例,并利用小型高效模型生成近似SQL来增强Text-to-SQL语义解析,在单语和跨语言基准上均超越现有最先进方法。

摘要:

我们聚焦于从检索增强生成的角度进行Text-to-SQL语义解析。受商业数据库模式规模庞大以及商业智能解决方案可部署性相关挑战的驱动,我们提出了ASTReS,它动态检索输入数据库信息,并利用抽象语法树选择少样本示例用于上下文学习。此外,我们探究了如何利用并行语义解析器生成预期SQL查询的近似版本,以支持我们的检索。我们将此方法推向极致——我们适配了一个参数少于5亿的模型,使其充当极其高效的近似器,并增强其并行处理模式的能力。我们将ASTReS应用于单语和跨语言的语义解析基准测试,显示出相对于最先进基线的改进。全面的实验突出了该检索增强生成设置中各模块的贡献,揭示了未来工作的有趣方向。

英文摘要:

We focus on Text-to-SQL semantic parsing from the perspective of retrieval-augmented generation. Motivated by challenges related to the size of commercial database schemata and the deployability of business intelligence solutions, we propose $\text{ASTReS}$ that dynamically retrieves input database information and uses abstract syntax trees to select few-shot examples for in-context learning. Furthermore, we investigate the extent to which an in-parallel semantic parser can be leveraged for generating approximated versions of the expected SQL queries, to support our retrieval. We take this approach to the extreme--we adapt a model consisting of less than $500$M parameters, to act as an extremely efficient approximator, enhancing it with the ability to process schemata in a parallelised manner. We apply $\text{ASTReS}$ to monolingual and cross-lingual benchmarks for semantic parsing, showing improvements over state-of-the-art baselines. Comprehensive experiments highlight the contribution of modules involved in this retrieval-augmented generation setting, revealing interesting directions for future work.

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

↑