Back to News
InnovationAI Understanding briefing

ReToolSQL trains a 31B model to verify and repair SQL through tool use

A new arXiv preprint describes ReToolSQL, a two-stage training method that combines supervised reasoning traces with reinforcement learning over multi-turn tool-use trajectories. The authors report 74.32% single-pass execution accuracy on BIRD-SQL’s development benchmark using a 31B Gemma 4 instruction-tuned model.

By 5 min readRead the primary source
Source-provided image accompanying ReToolSQL trains a 31B model to verify and repair SQL through tool use
The short version

A new arXiv preprint describes ReToolSQL, a two-stage training method that combines supervised reasoning traces with reinforcement learning over multi-turn tool-use trajectories. The authors report 74.32% single-pass execution accuracy on BIRD-SQL’s development benchmark using a 31B Gemma 4 instruction-tuned model.

What happened

Researchers introduced ReToolSQL, a two-stage training framework for text-to-SQL systems. It first uses supervised fine-tuning on rejection-sampled reasoning traces, then applies agentic reinforcement fine-tuning over multi-turn tool-use trajectories. The paper reports that the resulting model can verify queries, retrieve evidence, and repair faulty SQL using execution feedback.

The arXiv record identifies ReToolSQL as a computer-science artificial-intelligence paper submitted on August 28, 2026. Its authors are Pratik Kakkar, Chandra Dhir, Ravi Shankar, Pareekshit Reddy Gaddam, and Anup Shirgaonkar. The paper focuses on text-to-SQL: generating SQL queries from natural-language questions. The authors argue that many existing approaches model this as a single-turn generation problem, which limits the ability to recover when a query fails or produces an incorrect result. This framing connects the paper’s training procedure directly to the error-recovery problem it sets out to address.

The proposed framework has two stages. First, supervised fine-tuning starts the model with rejection-sampled reasoning traces produced by a privileged teacher. The paper says this stage expands the set of questions the model can solve, measured through pass-at-k coverage on difficult cases. Second, agentic reinforcement fine-tuning operates on multi-turn tool-use trajectories. In this stage, the model is trained to decide when to verify a query, what evidence to retrieve, and how to repair SQL after receiving execution feedback. The stages therefore cover both an initial learned strategy and later interaction with tools during the query process.

The reported experiments use Gemma 4 instruction-tuned at 31 billion parameters. The paper says reinforcement fine-tuning alone reached 73.66% execution accuracy on the BIRD-SQL development benchmark, increasing to 74.12% with self-consistency. Starting reinforcement fine-tuning from the supervised checkpoint produced the strongest reported result: 74.32% execution accuracy in a single pass and 74.77% with self-consistency. The authors state that this ranked first on the BIRD single-model development-set leaderboard at the time of writing. The source does not provide the leaderboard’s full comparison set or the benchmark’s question count in its abstract. These figures distinguish the reported training variants while leaving the broader comparison context unspecified.

Source details: arxiv.org

Why it matters

The work addresses a practical weakness in text-to-SQL systems: treating query generation as a single-turn task can limit error recovery. The reported results suggest that combining supervised initialization with tool-using reinforcement learning may improve execution accuracy within a single dense model, without additional human annotation beyond the benchmark.

Text-to-SQL systems are intended to let a user express a database question in ordinary language while an AI system constructs an executable query. In that setting, a syntactically valid query is not enough: the query must execute correctly against the relevant schema and data. ReToolSQL’s central contribution, as described by its authors, is to make verification and repair part of the model’s learned behavior rather than treating generation as a one-shot event. That distinction matters because successful generation and successful execution are related but not identical outcomes.

The reported results are notable because the method uses one dense 31B model rather than a multi-model system. The paper also says its composite rewards are anchored on execution correctness and that it requires no human annotation beyond the benchmark itself. If the results hold outside the reported development setting, this could offer researchers and organizations a way to improve query reliability through training design and execution feedback rather than relying only on larger models or manually labeled examples. The result is therefore relevant to both model-training choices and the practical design of text-to-SQL systems.

The evidence remains limited. The source is an arXiv preprint, and the headline results are reported on a development benchmark rather than a production deployment or an independently described operational evaluation. The paper’s abstract does not establish how the method performs on other database schemas, unfamiliar domains, noisy requests, changing data, or security-sensitive environments. It also does not report the computational cost, response latency, tool-call frequency, or failure modes associated with the reinforcement-learning process. The leaderboard position is explicitly time-bounded and should be treated as the authors’ reported claim. Those limitations define what can and cannot be concluded from the reported result.

What to watch next

The findings still need replication beyond the BIRD-SQL development benchmark. Important unknowns include performance on unseen databases, real enterprise workloads, tool-use cost and latency, the contribution of each training stage, and how reliably the method handles permissions, sensitive data, and ambiguous requests.

The first verification priority is replication on held-out and external evaluations. Observers should look for results on unseen databases, different schema designs, and questions that do not resemble the benchmark’s training distribution. Such tests would help determine whether the reported gains reflect broad robustness or optimization for BIRD-SQL’s particular tasks and execution environment. A convincing evaluation would need to make that distinction visible across the relevant settings rather than relying on the single reported development result.

The paper presents supervised fine-tuning and reinforcement fine-tuning as complementary, so ablation results will matter. Future work should clarify how much of the improvement comes from the warm-start checkpoint, how much comes from multi-turn reinforcement learning, and whether self-consistency provides a dependable benefit relative to its extra computation. Reproducibility will also depend on disclosure of the teacher traces, reward construction, tool setup, and evaluation protocol, none of which is detailed in the supplied arXiv abstract. These details would help separate the contribution of the individual components and the overall workflow.

Practical deployment raises questions that the source leaves open. A system that retrieves evidence or executes trial queries may need controls around database permissions, sensitive records, query costs, and actions that change data. It is also not clear how the model behaves when execution feedback is incomplete, misleading, or unavailable, or when a natural-language request is ambiguous. Before describing ReToolSQL as enterprise-ready, evaluators would need evidence on these operational conditions, along with error analysis and human-review requirements. Those safeguards are part of assessing the method’s practical reliability, beyond its benchmark execution accuracy.

Related guides & quizzes

AI AgentsAI Models ExplainedAI TrainingPrompt EngineeringTest what you know — try a free AI quizLook up an AI term in our glossary
Found this useful?