Thinkquel: A Model Dedicated to Text-to-dbt Using Synthetic Data and a Span-Aware Objective
On the map: LLM reasoning → Knowledge- and tool-augmented reasoning
also in 1 more
Abstract (arXiv)
Transforming natural-language requests into reliable, production-ready data transformations remains challenging: correctness depends on precise schema linking and warehouse-specific SQL dialects, while the strongest supervision available during training--execution success and result matching--are provided only at the sequence level. At the same time, assembling large, execution-validated corpora is costly, and token-level objectives misalign with these global signals, yielding unstable optimization and limited portability. We introduce Thinkquel, a fine-tuned model for producing robust, portable, and execution-validated database queries. Methodologies in Thinkquel integrates a novel synthetic data pipeline, TS-SQL, that leverages dbt as a portable intermediate representation with a span-aware reinforcement learning objective, and Token-Sequence GRPO (TS-GRPO), specifically designed to bridge the gap between token-level training signals and sequence-level execution rewards when finetuning LLMs. On the 500-example TS-SQL test set, Thinkquel (32B) reaches 93.2% execution success and 61.8% exact-result match with a two-stage SFT curriculum, improving over the base model by 67.2% (exec.) and 44.4% (match). In Spider (14B) experiments, TS-GRPO increases training stability and speeds convergence of the execution-match reward relative to GRPO and GSPO.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Knowledge- and tool-augmented reasoning, one of 17 directions in LLM reasoning. Builds on 3 of its 30 references that are in the map. First posted on arXiv 30 Sep 2025.
Builds on
3 of 30 references.
References · 3
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 687
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025SING-SQL: A Synthetic Data Generation Framework for In-Domain Text-to-SQL Translation
- 2026Boundary-Aware NL2SQL: Integrating Reliability through Hybrid Reward and Data Synthesis
- 2026SQuaD-SQL: Efficient Text-to-SQL with Small Language Models via LLM-Guided Knowledge Distillation
- 2025DB-Explore: Automated Database Exploration and Instruction Synthesis for Text-to-SQL
- 2025Arctic-Text2SQL-R1: Simple Rewards, Strong Reasoning in Text-to-SQL
- 2026Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering
- 2026EvolSQL: Structure-Aware Evolution for Scalable Text-to-SQL Data Synthesis
- 2026APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQL