arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.21402cs.CL
收藏

文本到SQL作为双状态推理:整合自适应上下文和渐进生成

Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation

School of Computer Science, Guangdong University of Technology(广东工业大学计算机科学学院);College of Science, Shantou University(汕头大学科学学院);Peng Cheng Laboratory(鹏城实验室)

Zhifeng Hao, Qibin Song, Ruichu Cai, Boyan Xu

AI总结:

DSR-SQL通过双状态推理框架整合自适应上下文和渐进生成,提升文本到SQL的执行准确率。

摘要:

最近的分而治之推理方法,特别是基于思维链(CoT)的方法,已经显著提升了大型语言模型(LLMs)的文本到SQL能力。然而,当应用于复杂的企业数据库时,这些方法由于上下文容量有限、模式链接不可靠以及数据库语义基础薄弱而难以保持推理的一致性。为了解决这些问题,我们引入了DSR-SQL,一种双状态推理框架,将文本到SQL建模为适应性上下文状态和渐进生成状态之间的交互。第一个构建了一个紧凑且语义忠实的环境,通过细化大型模式并选择相关结构;第二个将SQL合成形式化为反馈引导的状态转换,使模型能够自我纠正并与用户意图对齐。在没有任何预训练或上下文示例的情况下,DSR-SQL实现了具有竞争力的性能,在Spider 2.0-Snow数据集上达到35.28%的执行准确率,在BIRD开发数据集上达到68.32%。我们的实现将在https://github.com/DMIRLAB-Group/DSR-SQL上开源。

英文摘要:

Recent divide-and-conquer reasoning approaches, particularly those based on Chain-of-Thought (CoT), have substantially improved the Text-to-SQL capabilities of Large Language Models (LLMs). However, when applied to complex enterprise databases, such methods struggle to maintain coherent reasoning due to limited context capacity, unreliable schema linking, and weak grounding in database semantics. To overcome these issues, we introduce DSR-SQL, a \textbf{D}ual-\textbf{S}tate \textbf{R}easoning framework that models Text-to-SQL as an interaction between an adaptive context state and a progressive generation state. The first constructs a compact, semantically faithful environment by refining large schemas and selecting relevant structures, while the second formalizes SQL synthesis as feedback-guided state transitions, enabling the model to self-correct and align with user intent. Without any post-training or in-context examples, DSR-SQL achieves competitive performance, reaching 35.28\% execution accuracy on Spider 2.0-Snow and 68.32\% on BIRD development set. Our implementation will be open-sourced at: https://github.com/DMIRLAB-Group/DSR-SQL.

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

↑