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

ExCoT:利用执行反馈优化文本到SQL的推理

ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback

Snowflake Inc.(雪花公司)

Bohan Zhai, Canwen Xu, Yuxiong He, Zhewei Yao

AI总结:

ExCoT通过结合思维链与离策略和在线策略DPO,仅用执行准确率作为反馈,迭代优化开源LLMs,显著提升文本到SQL转换准确率,达到SOTA性能。

摘要:

文本到SQL转换需要精确的推理,以将自然语言问题转换为结构化查询。虽然大型语言模型(LLMs)在许多推理任务中表现出色,但它们在文本到SQL任务中利用思维链(CoT)推理的能力仍未得到充分探索。我们发现了关键局限性:零样本CoT带来的提升微乎其微,而未结合CoT的直接偏好优化(DPO)仅带来边际改进。我们提出了ExCoT,一种新颖的框架,通过将CoT推理与离策略和在线策略DPO相结合,仅依赖执行准确率作为反馈,迭代优化开源LLMs。该方法无需奖励模型或人工标注的偏好。我们的实验结果表明显著的性能提升:对于LLaMA-3 70B,ExCoT将BIRD开发集上的执行准确率从57.37%提升至68.51%,将Spider测试集上的执行准确率从78.81%提升至86.59%,Qwen-2.5-Coder也表现出类似的改进。我们的最佳模型在BIRD和Spider数据集上的单模型设置中均达到了最先进的性能,特别是在BIRD测试集上达到了68.53%的准确率。

英文摘要:

Text-to-SQL demands precise reasoning to convert natural language questions into structured queries. While large language models (LLMs) excel in many reasoning tasks, their ability to leverage Chain-of-Thought (CoT) reasoning for text-to-SQL remains underexplored. We identify critical limitations: zero-shot CoT offers minimal gains, and Direct Preference Optimization (DPO) applied without CoT yields marginal improvements. We propose ExCoT, a novel framework that iteratively optimizes open-source LLMs by combining CoT reasoning with off-policy and on-policy DPO, relying solely on execution accuracy as feedback. This approach eliminates the need for reward models or human-annotated preferences. Our experimental results demonstrate significant performance gains: ExCoT improves execution accuracy on BIRD dev set from 57.37% to 68.51% and on Spider test set from 78.81% to 86.59% for LLaMA-3 70B, with Qwen-2.5-Coder demonstrating similar improvements. Our best model achieves state-of-the-art performance in the single-model setting on both BIRD and Spider datasets, notably achieving 68.53% on the BIRD test set.

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

↑