VCoT-SQL: Enhancing Text-to-SQL Generation through Dual Chain-of-Thought Validation Training
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.
Create a lesson
Metadata
- Comments
- Accepted to EMNLP 2026 (Main Conference)
Related papers
Abstract What Varies, Reuse Longer Patterns: Efficient Offline Chain-of-Thought Compression
Shared title terminologycs.AIShibo Wang, Yuzhe He, Yifeng Zhao et al.
Chain-of-Thought Oversight Requires Separate Evidence for Faithfulness and Monitorability
Shared title terminologycs.AISichao Li, Sai Ma, Xiyang Hu et al.
RECAST: REconstruction of Chain-of-Thought via Auditable Structured Traces
Shared title terminologycs.AIQi Wang, Kang Xu, Chengcheng Wan et al.
Trained on Harm, Still Refusing: A Training-Time Defense for Code Generation
Shared title terminologycs.AIMiaoqing Tian, Ruohan Li, Qian Lu et al.
Conversational Interaction for LLM-Based Clinical Text-to-SQL: A User Study with Healthcare Professionals
Shared title terminologycs.AIJun-Min Lee, Suyoung Yoo, Gyubok Lee et al.
Reimagining Text-to-SQL: A Survey of Large Language Model Architectures and Strategies
Shared title terminologycs.AIShikhar Dave, Bhaskarjit Sarmah, Stefano Pasquali