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

Suming Qiu, Jing Li, Zhicheng Zhou, Junjie Huang, Linyuan Qiu +1 more
10/10/2025
cs.DBcs.AIcs.CL
rlrlhf-rlvr-dpo

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{qiu2025hessql,
  title  = {HES-SQL: Hybrid Reasoning for Efficient Text-to-SQL with Structural Skeleton Guidance},
  author = {Suming Qiu and Jing Li and Zhicheng Zhou and Junjie Huang and Linyuan Qiu and Zhijie Sun},
  year   = {2025},
  eprint = {2510.08896},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.08896v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.08896.svg)](https://codeofpaper.com/paper/2510.08896)

Discussion