SF-SQL: A Stage-Free Text-to-SQL Framework Enhanced by Reinforcement Learning

Yang SONG , Shurui KOU , Zimu ZHOU , Qian TAO , Yongxin TONG

Front. Comput. Sci. ››

PDF (3407KB)
Front. Comput. Sci. ›› DOI: 10.1007/s11704-026-60238-0
RESEARCH ARTICLE
SF-SQL: A Stage-Free Text-to-SQL Framework Enhanced by Reinforcement Learning
Author information +
History +
PDF (3407KB)

Abstract

Text-to-SQL, which translates natural language into SQL queries, has attracted significant attention in the database community. Recent advances leverage large language models (LLMs) to generate syntactically and semantically correct SQL. However, these approaches typically rely on prompt engineering and rigid multi-stage pipelines, making them sensitive to prompt variations and limiting their generalization across SQL dialects. To address these limitations, we propose SF-SQL, a Stage-Free Text-to-SQL framework enhanced by reinforcement learning. Instead of following a fixed pipeline, SF-SQL formulates SQL generation as a dynamic decision-making process, enabling the LLM to reason about the next action based on the context and execution feedback. To facilitate effective training, we develop a trajectory synthesis strategy that efficiently generates diverse and high-quality reasoning-action sequences. Moreover, SF-SQL proposes a reward scheme that integrates both final and intermediate query-aware signals without incurring additional inference overhead. Our experiments show that SF-SQL achieves 88.73% execution accuracy on Spider and 69.23% on BIRD, demonstrating strong generalization across five types of database dialects.

Keywords

Text-to-SQL / Large Language Model / Reinforcement Learning / Trajectory Synthesis

Cite this article

Download citation ▾
Yang SONG, Shurui KOU, Zimu ZHOU, Qian TAO, Yongxin TONG. SF-SQL: A Stage-Free Text-to-SQL Framework Enhanced by Reinforcement Learning. Front. Comput. Sci. DOI:10.1007/s11704-026-60238-0

登录浏览全文

4963

注册一个新账户 忘记密码

References

RIGHTS & PERMISSIONS

Higher Education Press 2026

PDF (3407KB)

1

Accesses

0

Citation

Detail

Sections
Recommended

/