DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generation

📄 arXiv: 2608.11889v1 📥 PDF

作者: Anik Pramanik, Murat Kantarcioglu, Vincent Oria, Shantanu Sharma

分类: cs.DB, cs.AI, cs.CL, cs.IR

发布日期: 2026-08-12


💡 一句话要点

提出DexterSQL以解决文本到SQL生成中的多重问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 文本到SQL 深度学习 自然语言处理 数据库查询 机器学习

📋 核心要点

  1. 现有的文本到SQL生成方法依赖粗粒度模式信息,无法有效区分模糊列,导致生成结果不准确。
  2. DexterSQL通过深度模式探索器、数据库无关规则创建器和多路径SQL生成等创新组件,改善了SQL生成的准确性和可靠性。
  3. 实验结果显示,DexterSQL在BIRD-Dev数据集上使用开源模型时,准确率达到67.6%,较现有方法提高至少2.7%。

📝 摘要(中文)

本文提出了DexterSQL,一种基于提示的文本到SQL生成系统,旨在解决现有方法在生成SQL时面临的三个主要问题:粗粒度的模式信息、未捕捉到的SQL生成失败以及复杂问题中条件的遗漏、幻觉或错误放置。DexterSQL通过三个创新组件提升SQL生成:深度模式探索器、数据库无关规则创建器和多路径SQL生成。实验结果表明,DexterSQL在多个模型上均实现了显著的准确性提升,尤其在使用开源模型时,准确率提高了至少2.7%。

🔬 方法详解

问题定义:本文旨在解决文本到SQL生成中的三个主要问题:依赖粗粒度模式信息导致的模糊列识别困难、未捕捉到的SQL生成失败模式,以及复杂问题中条件的遗漏或错误放置。

核心思路:DexterSQL通过引入深度模式探索器来识别模糊列,利用数据库无关规则创建器来生成纠正规则,并通过多路径SQL生成来优化SQL生成过程,旨在提高生成的准确性和可靠性。

技术框架:DexterSQL的整体架构包括三个主要模块:深度模式探索器负责分析列之间的关系,数据库无关规则创建器用于挖掘生成SQL与真实SQL之间的差异并生成纠正规则,多路径SQL生成模块则基于依赖树结构引导SQL生成过程。

关键创新:DexterSQL的创新点在于其深度模式探索器和数据库无关规则创建器,这些组件能够有效识别模糊列并生成通用的纠正规则,显著提升了生成SQL的准确性。

关键设计:在设计上,DexterSQL采用了依赖树结构作为中间表示,利用问题的句子结构指导SQL的分解与生成,确保生成的SQL符合自然语言问题的逻辑结构。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

DexterSQL在BIRD-Dev数据集上表现出色,使用开源模型(GPT-OSS-120B)时准确率达到67.6%,相比现有方法提高了至少2.7%。在闭源模型上,准确率更是达到了71.6%和72.2%,显示出其在不同模型上的广泛适用性和优越性。

🎯 应用场景

DexterSQL的研究成果在数据库查询生成、自然语言处理和人机交互等领域具有广泛的应用潜力。其创新的SQL生成方法能够帮助开发更智能的数据库查询工具,提高用户与数据库的交互效率,未来可能在智能助手和自动化数据分析等场景中发挥重要作用。

📄 摘要(原文)

Prompting-based (\textit{i}.\textit{e}., non-fine-tuning) Text-to-SQL methods, where underlying large language model parameters are not changed for the task, face three problems: (\textit{i})~relying on coarse-grained schema information that may not reveal the fine-grained relationships needed to distinguish ambiguous columns, (\textit{ii})~not capturing recurring SQL-generation failures, and (\textit{iii})~suffering from omission, hallucination, or misplacement of conditions in complex questions. This paper develops \textsc{DexterSQL}, a prompting/non-fine-tuning-based Text-to-SQL system that improves SQL generation with three novel components: (\textit{i})~\emph{deep schema explorator} that identifies ambiguous columns, analyzes their individual and joint data distributions to uncover their relationships and the distinct role of each, (\textit{ii})~\emph{database-agnostic rule creator} that mines mismatches between generated and gold SQL only on the training database and converts them into database-agnostic corrective rules that capture recurring LLM failure patterns; and (\textit{iii})~\emph{multi-path SQL generation} that introduces a dependency-tree-based intermediate representation that uses the question's sentence structure to guide its decomposition into an SQL skeleton for final SQL generation. \textsc{DexterSQL} achieves a higher accuracy compared to the state-of-the-art using both open-source/weight and closed-source/weight models. Particularly, \textsc{DexterSQL}'s shows a high improvement of at least 2.7\% using an open-weight model (GPT-OSS-120B) on BIRD-Dev, with total accuracy 67.6\%. \textsc{DexterSQL} also shows better improvement of at least 0.9\% using closed-weight models, with total accuracy 71.6\% and 72.2\% on BIRD-Dev with GPT-4o and GPT-5.2.