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.


翻译:近年来,基于分治策略的推理方法,特别是基于思维链(Chain-of-Thought, CoT)的方法,显著提升了大型语言模型(LLMs)在文本到SQL任务上的能力。然而,当应用于复杂的企业级数据库时,此类方法因上下文容量有限、模式链接不可靠以及对数据库语义的弱关联性,难以维持连贯的推理过程。为克服这些问题,我们提出了DSR-SQL,一个\textbf{双状态推理}框架,将文本到SQL任务建模为自适应上下文状态与渐进式生成状态之间的交互过程。前者通过精炼大规模数据库模式并选择相关结构,构建一个紧凑且语义忠实的环境;后者则将SQL合成形式化为反馈引导的状态转移,使模型能够自我纠正并与用户意图对齐。在无需任何后训练或上下文示例的情况下,DSR-SQL取得了具有竞争力的性能:在Spider 2.0-Snow数据集上达到35.28%的执行准确率,在BIRD开发集上达到68.32%。我们的实现代码将在以下地址开源:https://github.com/DMIRLAB-Group/DSR-SQL。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
【CVPR2022】MSDN: 零样本学习的互语义蒸馏网络
专知会员服务
21+阅读 · 2022年3月8日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员