[论文解读] Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
本文基准评估基于大型语言模型的 Text-to-SQL 的提示工程,提出 DAIL-SQL,并展示使用高效令牌的提示在 Spider 上达到最先进的执行准确性,并通过有监督微调对开源 LLM 进行分析。
Large language models (LLMs) have emerged as a new paradigm for Text-to-SQL task. However, the absence of a systematical benchmark inhibits the development of designing effective, efficient and economic LLM-based Text-to-SQL solutions. To address this challenge, in this paper, we first conduct a systematical and extensive comparison over existing prompt engineering methods, including question representation, example selection and example organization, and with these experimental results, we elaborate their pros and cons. Based on these findings, we propose a new integrated solution, named DAIL-SQL, which refreshes the Spider leaderboard with 86.6% execution accuracy and sets a new bar. To explore the potential of open-source LLM, we investigate them in various scenarios, and further enhance their performance with supervised fine-tuning. Our explorations highlight open-source LLMs' potential in Text-to-SQL, as well as the advantages and disadvantages of the supervised fine-tuning. Additionally, towards an efficient and economic LLM-based Text-to-SQL solution, we emphasize the token efficiency in prompt engineering and compare the prior studies under this metric. We hope that our work provides a deeper understanding of Text-to-SQL with LLMs, and inspires further investigations and broad applications.
研究动机与目标
- 系统性研究基于 LLM 的 Text-to-SQL 提示工程,涵盖问题表示、示例选择和示例组织。
- 评估开源 LLM 在上下文学习和有监督微调用于 Text-to-SQL 的有效性。
- 提出一个集成且高效的解决方案(DAIL-SQL),在性能与令牌成本之间取得平衡。
- 在令牌效率标准下比较不同提示,以指导实际的 Text-to-SQL 部署。
提出的方法
- 调研五种问题表示,并识别它们在零-shot Text-to-SQL 中的优缺点。
- 分析不同的示例选择和组织策略下的上下文学习。
- 引入 DAIL-SQL,其中包括 DAIL 选择(联合的问题与查询感知选择)和 DAIL 组织(在保留 Q-S 映射的同时降低令牌成本)。
- 采用 Code Representation Prompt (CRP) 作为问题表示,因为它提供丰富的模式/键信息。
- 探索对开源 LLM 进行 Text-to-SQL 的有监督微调,并与上下文学习进行比较。
- 评估不同提示设计选项的令牌效率,以指导成本效益更高的部署。
实验结果
研究问题
- RQ1哪些问题表示和提示工程选择能够在不同 LLM 上最大化 Text-to-SQL 的准确性和效率?
- RQ2开源 LLM 在上下文学习与有监督微调用于 Text-to-SQL 的表现如何?
- RQ3在实现高执行准确性时,提示信息内容与令牌成本之间的权衡是什么?
- RQ4所提出的 DAIL-SQL 方法与 Spider 及相关基准上的现有最先进方法相比如何?
主要发现
- DAIL-SQL 在 Spider 上达到 86.2% 的执行准确性,超过此前的最先进水平 (85.3%)。
- 结合自一致性,在额外计算成本下执行准确性达到 86.6%。
- 开源 LLM 显示出对 Text-to-SQL 的巨大潜力,特别是与有监督微调结合时。
- 问题表示和组织策略对性能和令牌效率有关键影响。
- 高令牌效率的提示设计可以以更少的令牌实现强劲性能,指导实际部署。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。