The Text-to-SQL task translates natural language questions into SQL queries, enabling intuitive database interaction for non-experts. While recent methods leveraging Large Language Models (LLMs) achieve strong performance, their reliance on proprietary models raise concerns about deployment feasibility and data privacy. In this work, we introduce LitE-SQL, a Lightweight and Efficient framework with two components: (i) a Schema Retriever that performs efficient schema linking using a vector database of pre-computed schema embeddings, optimized with a hard-negative supervised contrastive objective to distinguish semantically similar but functionally irrelevant columns, and (ii) a SQL Generator fine-tuned in two stages-supervised fine-tuning followed by execution-guided reinforcement-enabling execution-guided self-correction without multi-candidate sampling, which is commonly required by prior LLM-based approaches. On BIRD, LitE-SQL achieves 72.10% execution accuracy, and on Spider 1.0 it reaches 88.45%, demonstrating comparable or superior performance to LLM-based methods despite using 2x to 30x fewer parameters. Our findings demonstrate that high-quality Text-to-SQL generation is feasible with lightweight models, offering a practical solution for privacy-sensitive and resource-constrained settings.


翻译:文本到SQL任务旨在将自然语言问题转换为SQL查询,为非专家用户提供直观的数据库交互方式。尽管当前基于大语言模型的方法展现出优异性能,但其对专有模型的依赖引发了部署可行性与数据隐私方面的担忧。本研究提出LitE-SQL——一个包含双组件的轻量高效框架:(i)模式检索器:通过预计算模式嵌入的向量数据库实现高效模式链接,并采用硬负样本监督对比目标进行优化,以区分语义相似但功能无关的数据库列;(ii)SQL生成器:采用两阶段微调策略——监督微调后接执行引导的强化学习,无需传统基于大语言模型方法中常见的多候选采样即可实现执行引导的自校正。在BIRD基准测试中,LitE-SQL达到72.10%的执行准确率,在Spider 1.0数据集上达到88.45%,其参数量较基于大语言模型的方法减少2至30倍,却展现出相当或更优的性能。本研究证明:通过轻量级模型即可实现高质量的文本到SQL生成,为隐私敏感与资源受限场景提供了实用解决方案。

0
下载
关闭预览

相关内容

SQL 全名是结构化查询语言,是用于数据库中的标准数据查询语言,IBM 公司最早使用在其开发的数据库系统中。
「基于深度学习的 SQL 生成」2022研究综述
专知会员服务
28+阅读 · 2022年8月12日
专知会员服务
33+阅读 · 2021年9月27日
【知乎】超越Lexical:用于文本搜索引擎的语义检索框架
专知会员服务
22+阅读 · 2020年8月28日
TensorFlow Lite指南实战《TensorFlow Lite A primer》,附48页PPT
专知会员服务
70+阅读 · 2020年1月17日
用深度学习做文本摘要
专知
24+阅读 · 2019年3月30日
干货|当深度学习遇见自动文本摘要,seq2seq+attention
机器学习算法与Python学习
10+阅读 · 2018年5月28日
Tensorflow 文本分类-Python深度学习
Python程序员
12+阅读 · 2017年11月22日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
5+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员