We focus on Text-to-SQL semantic parsing from the perspective of Large Language Models. Motivated by challenges related to the size of commercial database schemata and the deployability of business intelligence solutions, we propose an approach 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 $\textit{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 our approach 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.
翻译:本文从大语言模型视角研究文本到SQL语义解析。针对商业数据库模式规模庞大及商业智能解决方案可部署性等挑战,我们提出一种动态检索输入数据库信息的方法,并利用抽象语法树为上下文学习选择少样本示例。此外,我们探究了如何利用并行语义解析器生成预期SQL查询的$\textit{近似}$版本以支持检索过程。我们将该方法推向极致——通过适配参数量不足$5$亿的模型,使其成为高效近似器,并增强其并行处理模式的能力。我们在单语言与跨语言语义解析基准测试中应用本方法,结果表明其性能优于当前最先进的基线模型。综合实验揭示了检索增强生成框架中各模块的贡献,为未来研究提供了新的方向。