arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.08896cs.DBcs.AIcs.CL
收藏

HES-SQL:基于结构骨架引导的高效Text-to-SQL混合推理

HES-SQL: Hybrid Reasoning for Efficient Text-to-SQL with Structural Skeleton Guidance

Suming Qiu, Jing Li, Zhicheng Zhou, Junjie Huang, Linyuan Qiu, Zhijie Sun

AI总结:

本文提出HES-SQL混合训练框架,通过融合思考模式的监督微调与GRPO,结合骨架完整性评分、查询延迟奖励和自蒸馏机制,在提升Text-to-SQL准确性的同时优化了查询执行效率。

摘要:

我们提出了HES-SQL,这是一个新颖的混合训练框架,通过将思考模式融合的监督微调(SFT)与Group Relative Policy Optimization(GRPO)相结合,推进了Text-to-SQL生成。我们的方法引入了三项关键创新:(1)骨架完整性评分机制,增强了生成查询与最优SQL结构之间的偏好对齐;(2)查询延迟感知奖励系统,激励生成计算高效的SQL查询;(3)用于思考模式补全的自蒸馏过程,防止模型推理能力退化。该框架使混合思考模型能够在推理与非推理模式之间切换,同时提高SQL查询的准确性和执行效率。在受控单用户条件下,于MySQL 8.0和SQLite 3.42上进行的实验评估表明,HES-SQL在BIRD和KaggleDBQA基准上分别达到79.14%和54.9%的执行准确率,表现出极具竞争力的性能。查询延迟被测量为生成查询在DBMS上的端到端执行时间,通过多次运行取平均值以减少方差。相对于监督基线,效率提升范围为11%至20%。我们的结果为Text-to-SQL系统确立了新范式,该系统通过执行信息驱动的强化学习(RL),有效平衡了语义准确性与计算效率。所提出的方法对开发稳健的数据库自然语言接口具有重要意义,并可扩展到需要同时优化正确性和效率的更广泛结构化生成任务。

英文摘要:

We present HES-SQL, a novel hybrid training framework that advances Text-to-SQL generation through the integration of thinking-mode-fused supervised fine-tuning (SFT) with Group Relative Policy Optimization (GRPO). Our approach introduces three key innovations: (1) a skeleton-completeness scoring mechanism that enhances preference alignment between generated queries and optimal SQL structures; (2) a query-latency-aware reward system that incentivizes the generation of computationally efficient SQL queries; (3) a self-distillation process for thinking-mode completion that prevents degradation of the model's reasoning capabilities. This framework enables hybrid thinking models to switch between reasoning and non-reasoning modes while improving SQL query accuracy and execution efficiency. Experimental evaluation, conducted on MySQL 8.0 and SQLite 3.42 under controlled single-user conditions, demonstrates that HES-SQL achieves competitive performance with execution accuracies of 79.14\% and 54.9\% on the BIRD and KaggleDBQA benchmarks, respectively. Query latency is measured as the end-to-end execution time of generated queries on the DBMS, averaged over multiple runs to mitigate variance. Efficiency gains range from 11\% to 20\% relative to supervised baselines. Our results establish a new paradigm for Text-to-SQL systems that effectively balances semantic accuracy with computational efficiency through execution-informed reinforcement learning (RL). The proposed methodology has significant implications for developing robust natural language interfaces to databases and can be extended to broader structured generation tasks requiring both correctness and efficiency optimization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑