arXiv:2608.22772cs.CL2026-08

分阶段优化文本转SQL,让模型更可控、更可靠。

SPOC-SQL: Stage-wise Preference Optimization for Controllable Text-to-SQL

论文配图:SPOC-SQL: Stage-wise Preference Optimization for Controllable Text-to-SQL
图 1 · 摘自论文原文
  • 将文本转SQL拆解为四个阶段,每阶段针对性优化关键决策点。
  • 在关键节点引入细粒度偏好优化,提升结构化决策能力。
  • 支持中间过程干预,适合需要可解释性和可控性的场景。

文本转SQL旨在将自然语言问题转化为关系数据库上的可执行SQL查询,需对数据库模式和查询约束进行多阶段结构化推理。然而,现有方法将其视为单步生成,模型在关键决策点缺乏针对性反馈,且不支持对中间生成过程的交互与控制。为此,我们提出SPOC-SQL,遵循标准SQL执行逻辑,将文本转SQL分解为四个顺序子任务,并设计阶段特定优化策略,使模型学习关键决策。具体地,在各阶段关键决策点实施细粒度偏好优化,以增强查询构建中的结构化决策能力。此外,设计结构化分解策略,通过显式中间表示实现阶段式干预与修正,从而提升生成的可控性与可靠性。实验表明,融入阶段化人类知识能持续提升性能,验证了阶段感知可控生成的有效性。

原文摘要 · Abstract (English)

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.

文本转SQL可控生成偏好优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。