cs.AIOct 31, 2026

VCoT-SQL: Enhancing Text-to-SQL Generation through Dual Chain-of-Thought Validation Training

Authors: Rui Zhang, Yujia Su, Ruixuan Li, Yuhua Li, Yixin Su

Organizations: School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, China

Abstract

Open-source LLMs provide a flexible alternative to closed-source models for Text-to-SQL but still struggle with complex queries. Finetuning with chain-of-thought (CoT) data improves reasoning, yet standard datasets lack CoT annotations, requiring synthetic generation. Existing synthesis methods only verify the final answer, allowing flawed reasoning steps to corrupt the training data. We propose VCoT-SQL, a framework that improves Text-to-SQL generation through intermediate-step validated CoT supervision and a dedicated SQL validator, which enables small open-source models to outperform frontier closed-source models. VCoT-SQL trains two complementary models on curated reasoning traces: an SQL generator using clause-level CoT templates where reasoning steps are verified via execution and schema alignment checks, and an SQL validator using diagnostic CoT templates to detect syntactic, semantic, and type level errors. We further design a hierarchical schema filtering pipeline that integrates and refines complementary retrieval strategies to distill relevant database elements. VCoT-SQL achieves 66.82% execution accuracy on challenging dataset BIRD dev and 86.8% on Spider test, improving the base 7B model by 7% on BIRD. Notably, our CoT synthesis relies on 7B models yet outperforms methods that use 72B-scale or even proprietary closed source teachers for data generation, demonstrating that rigorous step-level validation can be more effective than scaling up teacher model size. Our dataset and code are available at https://github.com/INTREBID/VCoT-SQL.

Figures & tables

Appendix figures & tables16 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Integrating Reasoning and Generalization in Text-to-SQL via Self-Enhanced Fine-Tuning

    Jun 14, 2026Feng Lyu, Jinfeng Cen, Sijing Duan +4Execution-Guided Text-to-SQLSelf-Training for Language Models

  2. LIMIT: Less Is More for Instruction Tuning in Text-to-SQL

    Sep 21, 2026Haoyuan Ma, Hengwei Liu, Linjuan Wu +2Text-to-SQLInstruction-Tuning Data Selection

  3. ACE-SQL: Adaptive Co-Optimization via Empirical Credit Assignment for Text-to-SQL

    Jun 4, 2026Xiaobing Chen, Ai Jian, Eryu Guo +1Execution-Guided Code GenerationSchema Linking