用自校正链式思维提升自然语言转SQL准确率
SelECT-SQL: Self-correcting ensemble Chain-of-Thought for Text-to-SQL
- 结合思维链、自我修正与集成策略生成SQL
- 在Spider数据集上达到84.2%执行准确率
- 适合需要高精度数据库查询的开发者
近年来,自然语言转SQL成为自然语言处理与数据管理交叉领域的重要问题。尽管大语言模型(LLMs)在直接使用时表现优异,但仍远未达到专家级水平,尤其在理解数据库模式、问题和SQL语法细节方面易出错。本文提出SelECT-SQL,一种基于上下文学习的新方法,通过算法融合思维链提示、自我修正与集成技术,在挑战性Text-to-SQL基准上取得新最优结果。当以GPT-3.5-Turbo为基底模型时,其在Spider排行榜开发集上实现84.2%的执行准确率,超过其他基于GPT-3.5-Turbo的方法(81.1%)以及之前报告的GPT-4峰值性能(83.5%)。
原文摘要 · Abstract (English)
In recent years,Text-to-SQL, the problem of automatically converting questions posed in natural language to formal SQL queries, has emerged as an important problem at the intersection of natural language processing and data management research. Large language models (LLMs) have delivered impressive performance when used in an off-the-shelf performance, but still fall significantly short of expected expert-level performance. Errors are especially probable when a nuanced understanding is needed of database schemas, questions, and SQL clauses to do proper Text-to-SQL conversion. We introduce SelECT-SQL, a novel in-context learning solution that uses an algorithmic combination of chain-of-thought (CoT) prompting, self-correction, and ensemble methods to yield a new state-of-the-art result on challenging Text-to-SQL benchmarks. Specifically, when configured using GPT-3.5-Turbo as the base LLM, SelECT-SQL achieves 84.2% execution accuracy on the Spider leaderboard's development set, exceeding both the best results of other baseline GPT-3.5-Turbo-based solutions (81.1%), and the peak performance (83.5%) of the GPT-4 result reported on the leaderboard.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。