Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Think2SQL: Reinforce LLM Reasoning Capabilities for Text2SQL

About

While Large Language Models (LLMs) have advanced the state-of-the-art in Text-to-SQL, robust reasoning in complex, multi-table environments remains a bottleneck for parameter-efficient models. This paper presents a systematic empirical study on injecting reasoning capabilities into Text-to-SQL through the lens of Reinforcement Learning with Verifiable Rewards (RLVR). We uncover a critical interplay between reward density, advantage scaling, and model capacity. Our analysis yields four primary insights. First, we propose a novel execution-guided dense reward function that significantly outperforms binary signals and existing state-of-the-art rewards by providing granular feedback at the instance level. Second, we analyze the mechanics of advantage calculation, demonstrating that while large models thrive on sparse signals with aggressive advantage scaling, smaller models require dense rewards and conservative scaling to improve Text-to-SQL performance. Third, we evaluate the impact of cold start, showing that distillation does not always improve RLVR performance and that supervised, fine-tuned models are prone to distributional mimicry. Fourth, we map the Pareto frontier of training efficiency, providing insights for optimizing Text-to-SQL reasoning under computational constraints. Our findings culminate in the Think2SQL family: our 4B-parameter model demonstrates reasoning capabilities competitive with state-of-the-art models such as o3. We release our models, datasets, and code to create a blueprint for RLVR optimization in Text-to-SQL at https://anonymous.4open.science/r/Think2SQL-3B7F.

Simone Papicchio, Simone Rossi, Luca Cagliero, Paolo Papotti• 2025

Related benchmarks

TaskDatasetResultRank
Text-to-SQLBIRD (dev)
Execution Accuracy (EA)61.3
217
Text-to-SQLSpider (test)
Execution Accuracy85.6
140
Text-to-SQLSpider-Realistic
Execution Accuracy (EX)81.8
33
Text-to-SQLSpider-DK
Execution Accuracy (EX)77.8
26
Text-to-SQLSpider-Syn
Execution Accuracy (EX)78.6
26
Text-to-SQLEHRSQL
Execution Accuracy38.9
9
Showing 6 of 6 rows

Other info

Follow for update