SQuaD-SQL: Efficient Text-to-SQL with Small Language Models via LLM-Guided Knowledge Distillation

📄 arXiv: 2607.08161v1 📥 PDF

作者: Wangyu Wu, Xiaojian Lin, Rong Fu, Zaiyang Yu, Xuhang Chen, Wenjun Yu, Zhenhong Chen

分类: cs.CL, cs.CV

发布日期: 2026-07-09

备注: Accepted at IEEE SMC 2026


💡 一句话要点

提出SQuaD-SQL以提升小型语言模型在Text-to-SQL任务中的效率

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: Text-to-SQL 小型语言模型 知识蒸馏 合成数据生成 自然语言处理 模型微调 数据库交互

📋 核心要点

  1. 现有大型语言模型在Text-to-SQL任务中表现优异,但其高计算需求使得在资源受限环境中难以部署。
  2. 本文提出SQuaD-SQL,通过知识蒸馏和合成数据生成,使小型语言模型在Text-to-SQL任务上接近大型语言模型的性能。
  3. 在WikiSQL数据集上的实验结果显示,SQuaD-SQL实现了86.9%的执行准确率,显著提高了推理速度和内存效率。

📝 摘要(中文)

Text-to-SQL是自然语言处理中的一项基础任务,使用户能够使用自然语言与结构化数据库进行交互。尽管大型语言模型(LLMs)在此任务上表现出色,但其高计算需求限制了在资源受限环境中的应用。本文提出SQuaD-SQL(Small-Qualified and Distilled for SQL),一种新方法,通过知识蒸馏和合成数据生成,使小型语言模型(SLMs)在Text-to-SQL任务上接近LLMs的性能,同时显著提高效率。该方法包括三个关键组件:基于LLM的合成数据生成、参数高效的微调以及领域自适应微调。实验结果表明,SQuaD-SQL在WikiSQL数据集上的执行准确率达到86.9%,接近LLMs的性能,同时提供更快的推理速度和更低的内存使用。

🔬 方法详解

问题定义:本文旨在解决小型语言模型在Text-to-SQL任务中性能不足的问题,现有大型语言模型的高计算需求限制了其在资源受限环境中的应用。

核心思路:SQuaD-SQL通过知识蒸馏和合成数据生成,使小型语言模型能够在保持较低计算成本的同时,接近大型语言模型的性能。

技术框架:该方法包括三个主要模块:1) 基于LLM的合成数据生成,通过精心设计的提示策略从LLM中提取结构化知识;2) 参数高效的微调,允许在单个消费级GPU上进行完整模型训练;3) 领域自适应微调,利用领域特定的合成数据进一步提升性能。

关键创新:最重要的创新点在于结合了合成数据生成与知识蒸馏,使得小型语言模型在Text-to-SQL任务中能够有效学习到大型语言模型的知识,从而提升其性能。

关键设计:在参数设置上,采用了适合小型模型的微调策略,并设计了特定的损失函数以优化模型在特定任务上的表现。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在WikiSQL数据集上的实验结果显示,SQuaD-SQL实现了86.9%的执行准确率,接近大型语言模型的性能,同时在推理速度和内存使用上表现出显著优势。这表明小型语言模型在Text-to-SQL任务中可以作为有效的替代方案。

🎯 应用场景

该研究的潜在应用领域包括智能问答系统、数据库查询优化以及自然语言接口的开发。通过提升小型语言模型的性能,SQuaD-SQL能够在资源受限的环境中实现高效的数据库交互,具有重要的实际价值和广泛的应用前景。

📄 摘要(原文)

Text-to-SQL is a fundamental task in natural language processing that enables users to interact with structured databases using natural language. While large language models (LLMs) have demonstrated remarkable performance on this task, their substantial computational requirements hinder deployment in resource-constrained settings. In this paper, we introduce SQuaD-SQL (Small-Qualified and Distilled for SQL), a novel approach that empowers small language models (SLMs) to approach the performance of LLMs on the Text-to-SQL task while significantly improving efficiency through knowledge distillation and synthetic data generation. Our method comprises three key components: (1) LLM-based synthetic data generation, where structured knowledge is extracted from LLMs via carefully designed prompting strategies; (2) parameter-efficient fine-tuning, enabling full model training on a single consumer-grade GPU; and (3) domain-adaptive fine-tuning, where domain-specific synthetic data further enhances performance in targeted domains. Experiments on the WikiSQL dataset demonstrate that SQuaD-SQL achieves an execution accuracy of 86.9% on the test set, approaching the performance of LLMs while offering faster inference and lower memory usage. These results suggest that, with proper training strategies, SLMs can serve as practical and efficient alternatives for Text-to-SQL applications in resource-limited environments.