AutoThinkSQL: Dynamic Reasoning for Text-to-SQL via SFT and DPO
AutoThinkSQL is a novel framework that incorporates an auto-thinking mechanism into Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) specifically for Text-to-SQL tasks. This method adeptly avoids complex reasoning for straightforward queries while employing an in-depth Chain-of-Thought (CoT) for more intricate ones. When tested on Qwen3-Coder-30B-A3B, AutoThinkSQL demonstrated significant improvements on Spider and BIRD benchmarks, achieving a reduction in average output tokens by 24.6% and 18.3%, along with a decrease in average latency by 17.1% and 11.5% compared to CoT-only generation. This research tackles the inefficiencies associated with unnecessary reasoning for simple real-world queries.
Key facts
- AutoThinkSQL integrates auto-thinking into SFT and DPO for Text-to-SQL.
- It dynamically bypasses reasoning for simple queries and uses CoT for complex ones.
- Tested on Qwen3-Coder-30B-A3B model.
- Achieves gains on Spider and BIRD benchmarks.
- Reduces output tokens by 24.6% (Spider) and 18.3% (BIRD).
- Reduces latency by 17.1% (Spider) and 11.5% (BIRD).
- Compared to CoT-only generation.
- Addresses inefficiency of forced reasoning for simple queries.
Entities
—