🤖 AI Summary
Existing divide-and-conquer Text-to-SQL approaches struggle with coherence in complex enterprise databases due to limited context capacity, unreliable schema linking, and weak semantic modeling. To address this, we propose DSR-SQL—a framework that formalizes text-to-SQL as a dual-state collaborative reasoning process: “adaptive context refinement” and “progressive SQL generation.” It employs dynamic schema structure compression, chain-of-thought decomposition, semantics-aware selection, and feedback-driven state transitions, enabling end-to-end, zero-shot, and fine-tuning-free inference. Its core innovation is a dual-state iterative refinement mechanism, substantially enhancing large language models’ semantic alignment with intricate database schemas. On the Spider 2.0-Snow and BIRD development sets, DSR-SQL achieves execution accuracies of 35.28% and 68.32%, respectively—comparable to state-of-the-art methods.
📝 Abstract
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 extbf{D}ual- extbf{S}tate extbf{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.