ResearchPod Summary
Translating natural language questions into executable SQL queries over relational databases typically requires multi-stage structured reasoning. However, existing Text-to-SQL methods usually treat this task as single-step sequence generation, optimizing entire SQL statements without targeted feedback at critical decision points. This holistic approach makes it difficult for models to master core decision-making steps, dilutes learning signals, and lacks support for user interaction and control over intermediate generation processes. To address these limitations, the authors propose SPOC-SQL, a framework that decomposes Text-to-SQL into sequential subtasks aligned with standard execution logic and applies stage-specific optimization strategies.
The proposed framework introduces several key components. First, a task parsing function decomposes single-turn queries into multi-turn interaction sequences following the canonical SQL execution pipeline: SELECT-FROM (SF), WHERE (WH), GROUP-HAVING (GH), and ORDER-LIMIT (OL). Second, the authors design Preference-based Multi-turn QA Decision Optimization (PMDO), which applies Low-Rank Adaptation (LoRA) alongside Direct Preference Optimization (DPO) at fine-grained decision points across different SQL stages. Positive samples represent correct intermediate decisions, while negative samples introduce controlled perturbations such as incorrect columns, filtering conditions, or aggregation operations. Third, a Requirement Decomposition and Interaction Module (RDIM) exposes intermediate results during inference, enabling stage-wise verification, correction, and user-driven intervention before synthesizing the final SQL query.
Evaluated on the Spider-Dev and Spider-Realistic benchmarks, SPOC-SQL demonstrates strong performance and consistent improvements as human knowledge is progressively integrated across stages. Without human intervention, SPOC-SQL already achieves competitive results, such as 74.1% execution accuracy on the Extra Hard subset of Spider-Dev, surpassing previous methods like MCS-SQL. When human knowledge is incrementally introduced from the schema-focused stage through subsequent stages, execution accuracy on Spider-Dev rises to 95.6% and reaches 93.1% on Spider-Realistic. These results confirm that stage perception and structured decomposition effectively simplify complex queries and enhance decision-making accuracy.
This paper shifts Text-to-SQL generation from an opaque, single-step black-box process to a transparent, controllable, and multi-stage workflow. By enabling fine-grained preference optimization and interactive user intervention at logical subtask boundaries, the approach offers a practical way to build more reliable database query assistants that can be corrected and guided iteratively.
AI-generated third-party summary by ResearchPod. Not official content or an endorsement by the paper authors or affiliated organizations.