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

RB-SQL:一种基于检索的Text-to-SQL大语言模型框架

RB-SQL: A Retrieval-based LLM Framework for Text-to-SQL

Zhenhe Wu, Zhongqiu Li, Jie Zhang, Mengxiang Li, Yu Zhao, Ruiyu Fang, Zhongjiang He, Xuelong Li, Zhoujun Li, Shuangyong Song

AI总结:

针对现有Text-to-SQL方法难适配大型数据库、忽视数据库预处理的问题,提出基于检索的RB-SQL框架,通过检索精简模式与针对性示例优化提示工程,在BIRD、Spider数据集上性能优于主流基线。

摘要:

具备上下文学习能力的大语言模型(LLM)已显著提升了Text-to-SQL任务的性能。现有研究通常聚焦于使用专用的SQL生成提示来增强LLM的推理能力,但这类方法大多难以应对包含大量表和列的大型数据库,且往往忽视了预处理数据库、提取高价值信息对提升提示工程效率的重要作用。基于上述分析,我们提出RB-SQL,这是一种面向上下文提示工程的新型基于检索的LLM框架,包含三个模块,可检索精简的表和列作为模式,以及用于上下文学习的针对性示例。实验结果表明,在公开数据集BIRD和Spider上,我们的模型性能优于多个主流基线模型。

英文摘要:

Large language models (LLMs) with in-context learning have significantly improved the performance of text-to-SQL task. Previous works generally focus on using exclusive SQL generation prompt to improve the LLMs' reasoning ability. However, they are mostly hard to handle large databases with numerous tables and columns, and usually ignore the significance of pre-processing database and extracting valuable information for more efficient prompt engineering. Based on above analysis, we propose RB-SQL, a novel retrieval-based LLM framework for in-context prompt engineering, which consists of three modules that retrieve concise tables and columns as schema, and targeted examples for in-context learning. Experiment results demonstrate that our model achieves better performance than several competitive baselines on public datasets BIRD and Spider.

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

↑