Knowledge Distillation with Structured Chain-of-Thought for Text-to-SQL
Khushboo Thaker, Yony Bresler

TL;DR
This paper introduces Struct-SQL, a knowledge distillation framework that uses structured reasoning via query execution plans to improve small language models for Text-to-SQL tasks, achieving higher accuracy and fewer errors.
Contribution
It proposes a novel structured CoT approach for distilling large LLMs into smaller models using formal reasoning blueprints, enhancing reliability and performance.
Findings
Structured CoT improves SLM accuracy by 8.1% over unstructured methods.
Structured reasoning reduces syntactic errors in SQL generation.
Using formal blueprints enhances the reliability of small models in enterprise settings.
Abstract
Deploying accurate Text-to-SQL systems at the enterprise level faces a difficult trilemma involving cost, security and performance. Current solutions force enterprises to choose between expensive, proprietary Large Language Models (LLMs) and low-performing Small Language Models (SLMs). Efforts to improve SLMs often rely on distilling reasoning from large LLMs using unstructured Chain-of-Thought (CoT) traces, a process that remains inherently ambiguous. Instead, we hypothesize that a formal, structured reasoning representation provides a clearer, more reliable teaching signal, as the Text-to-SQL task requires explicit and precise logical steps. To evaluate this hypothesis, we propose Struct-SQL, a novel Knowledge Distillation (KD) framework that trains an SLM to emulate a powerful large LLM. Consequently, we adopt a query execution plan as a formal blueprint to derive this structured…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsScientific Computing and Data Management · Advanced Database Systems and Queries · Web Application Security Vulnerabilities
