发表机构
South China University of Technology(华南理工大学)
机构由 AI 辅助整理,请以论文原文为准。AI 中文总结
该研究针对现有文本到SQL方法缺乏关键决策反馈和中间过程控制的问题,提出SPOC-SQL,通过分阶段偏好优化与结构化分解策略实现可控SQL生成,实验验证了其有效性。
AI 中文摘要
文本到SQL旨在将自然语言问题转换为可在关系数据库上执行的SQL查询,需要对数据库模式和查询约束进行多阶段结构化推理。然而,现有方法将该任务视为单步生成,模型在优化整个SQL序列时无法在关键决策点获得针对性反馈,也缺乏对中间生成过程进行交互和控制的支持。为解决此问题,我们提出SPOC-SQL,它遵循标准SQL执行逻辑将文本到SQL分解为四个顺序子任务,并为模型设计分阶段优化策略以学习关键决策。具体而言,我们提出在SQL各阶段的关键决策点实现细粒度偏好优化,目标是增强查询构建过程中的结构化决策能力;此外,还设计了结构化分解策略,通过显式中间表示促进分阶段干预和修正,从而实现更可控、更可靠的SQL生成。实验表明,融入分阶段人类知识可持续提升性能,验证了阶段感知可控生成的有效性。
英文摘要
Text-to-SQL aims to translate natural language questions into executable SQL queries over relational databases, requiring multi-stage structured reasoning over database schemas and query constraints. However, existing methods treat this task as single-step generation, where models optimize entire SQL sequences without targeted feedback at key decision points and lack support for interacting with and controlling the intermediate generation process. To address this issue, we propose SPOC-SQL, which decomposes Text-to-SQL into four sequential subtasks following standard SQL execution logic and designs stage-specific optimization strategies for the model to learn key decisions. Specifically, we propose the implementation of fine-grained preference optimisation at key decision points across SQL stages, with the objective of enhancing structured decision-making during query construction. Furthermore, a structured decomposition strategy is designed, facilitating stage-wise intervention and correction through explicit intermediate representations. This results in more controllable and reliable SQL generation. Experiments demonstrate that incorporating stage-wise human knowledge consistently improves performance, validating the effectiveness of stage perception controllable generation.