Learning When to Reason for Text-to-SQL via SFT and DPO
On the map: LLM reasoning → Knowledge- and tool-augmented reasoning
Abstract (arXiv)
Recent Text-to-SQL methods rely heavily on reasoning-centric paradigms such as Chain-of-Thought (CoT), achieving substantial gains on complex benchmarks at the cost of high inference-time overhead. However, a large fraction of real-world queries are simple lookups or aggregations that can be resolved without multi-step deduction, making forced reasoning wasteful. Thus, we propose AutoThinkSQL, a framework that integrates an auto-thinking mechanism into both Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) on Text-to-SQL. Our approach enables the model to dynamically bypass reasoning for simple queries while invoking deep CoT for complex queries. On Qwen3-Coder-30B-A3B, our method achieves consistent gains compared to the best counterpart baseline on both Spider and BIRD benchmarks while simultaneously reducing average output tokens by 24.6% and 18.3%, and average latency by 17.1% and 11.5% compared to CoT-only generation. Further analysis indicates that the model learns to align its reasoning decisions with query difficulty.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 24 of its 27 references that are in the map. First posted on arXiv 17 Jun 2026.
Builds on
24 of 27 references.
Closest ancestors · 3
Same direction, newest first
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQL22 May
- 2025Reasoning-SQL: Reinforcement Learning with SQL Tailored Partial Rewards for Reasoning-Enhanced Text-to-SQL29 Mar
- 2024CHASE-SQL: Multi-Path Reasoning and Preference Optimized Candidate Selection in Text-to-SQL2 Oct
Other references · 21
- 2017Proximal Policy Optimization Algorithmscited by 14,441
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
- 2024LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Modelscited by 1,442
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2023Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLscited by 667
- 2023DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correctioncited by 465
- 2023Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluationcited by 378
- 2024To CoT or not to CoT? Chain-of-thought helps mainly on math and symbolic reasoningcited by 257
- 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 223
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2024CHESS: Contextual Harnessing for Efficient SQL Synthesiscited by 164
- 2023MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQLcited by 158
9 more
- 2025AdaptThink: Reasoning Models Can Learn When to Thinkcited by 141
- 2025Thinkless: LLM Learns When to Thinkcited by 107
- 2025OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scalecited by 90
- 2025AdaCoT: Pareto-Optimal Adaptive Chain-of-Thought Triggering via Reinforcement Learningcited by 86
- 2023Exploring Chain-of-Thought Style Prompting for Text-to-SQLcited by 69
- 2025SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learningcited by 67
- 2025Learning When to Think: Shaping Adaptive Reasoning in R1-Style Models via Multi-Stage RLcited by 59
- 2024Synthesizing Text-to-SQL Data from Weak and Strong LLMscited by 53
- 2025Uncovering the Impact of Chain-of-Thought Reasoning for Direct Preference Optimization: Lessons from Text-to-SQLcited by 9
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025STaR-SQL: Self-Taught Reasoner for Text-to-SQL
- 2025Sparks of Tabular Reasoning via Text2SQL Reinforcement Learning
- 2026Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning
- 2025ExCoT: Optimizing Reasoning for Text-to-SQL with Execution Feedback
- 2025Rationalization Models for Text-to-SQL
- 2025HES-SQL: Hybrid Reasoning for Efficient Text-to-SQL with Structural Skeleton Guidance
- 2025JudgeSQL: Reasoning over SQL Candidates with Weighted Consensus Tournament
- 2026CA-SQL: Complexity-Aware Inference Time Reasoning for Text-to-SQL via Exploration and Compute Budget Allocation