arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.09014cs.CL
收藏

LitE-SQL: 一种轻量高效的文本到SQL框架,具备基于向量的模式链接和执行引导的自我纠正

LitE-SQL: A Lightweight and Efficient Text-to-SQL Framework with Vector-based Schema Linking and Execution-Guided Self-Correction

Yonsei University(延世大学)

Shengmin Piao, Jieun Lee, Sanghyun Park

AI总结:

LitE-SQL通过轻量高效的框架和基于向量的模式链接技术,实现高准确率的文本到SQL生成,无需多候选采样即可执行引导自我纠正,适用于隐私敏感和资源受限场景。

摘要:

文本到SQL任务将自然语言问题转换为SQL查询,使非专家能够直观地与数据库交互。尽管最近利用大语言模型(LLMs)的方法表现优异,但其对专有模型的依赖引发了部署可行性和数据隐私的担忧。在本工作中,我们介绍了LitE-SQL,一种轻量高效的框架,包含两个组件:(i)一个模式检索器,利用预计算的模式嵌入向量数据库进行高效的模式链接,通过硬负监督对比目标优化,以区分语义相似但功能无关的列;(ii)一个SQL生成器,经过两阶段微调——监督微调后接执行引导的强化学习,使无需多候选采样即可实现执行引导的自我纠正,这通常是先前基于LLM的方法所必需的。在BIRD上,LitE-SQL实现了72.10%的执行准确率,在Spider 1.0上达到了88.45%的准确率,尽管参数数量仅为LLM方法的2到30倍,仍表现出可比或更优的性能。我们的发现表明,高质量的文本到SQL生成可以通过轻量模型实现,为隐私敏感和资源受限的环境提供了实用的解决方案。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑