arXiv:2509.00581cs.DBcs.LG2025-09中稿 · NeurIPS被引 12

多智能体框架让自然语言转SQL更准,错误可动态修正。

SQL-of-Thought: Multi-agentic Text-to-SQL with Guided Error Correction

  • 用多个智能体分步处理:链接模式、识别子问题、生成查询计划
  • 在Spider数据集上达到当前最佳性能,错误修正基于动态分类
  • 适合想提升文本转数据库查询准确率的研究者和开发者

将自然语言查询转化为SQL查询是产业界和学术界的关键挑战,旨在提升数据库访问能力与大规模应用支持。本文探讨如何利用上下文学习和思维链方法构建稳健的文本转SQL系统。我们提出SQL-of-Thought:一种多智能体框架,将文本转SQL任务分解为模式链接、子问题识别、查询计划生成、SQL生成及引导式纠错循环。不同于以往仅依赖执行结果进行静态修正的系统,我们引入基于上下文学习的分类引导型动态错误修改机制。该框架在Spider数据集及其变体上取得当前最优结果,结合了引导式错误分类与基于推理的查询规划。

原文摘要 · Abstract (English)

Converting natural language queries into SQL queries is a crucial challenge in both industry and academia, aiming to increase access to databases and large-scale applications. This work examines how in-context learning and chain-of-thought can be utilized to develop a robust solution for text-to-SQL systems. We propose SQL-of-Thought: a multi-agent framework that decomposes the Text2SQL task into schema linking, subproblem identification, query plan generation, SQL generation, and a guided correction loop. Unlike prior systems that rely only on execution-based static correction, we introduce taxonomy-guided dynamic error modification informed by in-context learning. SQL-of-Thought achieves state-of-the-art results on the Spider dataset and its variants, combining guided error taxonomy with reasoning-based query planning.

文本转SQL多智能体错误修正

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。