arXiv:2503.17811cs.CLcs.AI2025-03被引 5

轻量级框架让小模型也能高效生成准确SQL

Feather-SQL: A Lightweight NL2SQL Framework with Dual-Model Collaboration Paradigm for Small Language Models

  • 双模型协作:通用大模型+专精SQL模型协同工作
  • 在BIRD数据集上提升小模型准确率至54.76%
  • 适合资源受限场景下需高隐私保护的数据库查询

自然语言转SQL(NL2SQL)在大语言模型(LLMs)推动下取得显著进展,但这些模型依赖闭源系统和高算力,带来数据隐私与部署难题。相比之下,小语言模型(SLMs)在NL2SQL任务中表现不佳,且难以适配现有框架。为此,我们提出Feather-SQL,一个专为SLMs设计的轻量级框架。通过模式剪枝与关联、多路径多候选生成,提升SQL可执行性与准确性。创新提出1+1模型协作范式,将强通用聊天模型与微调后的SQL专家模型结合,融合强推理能力与高精度生成。在BIRD数据集上的实验表明,Feather-SQL使未微调的小模型性能提升约10%。该范式将SLMs的准确率上限推至54.76%,验证了其有效性。

原文摘要 · Abstract (English)

Natural Language to SQL (NL2SQL) has seen significant advancements with large language models (LLMs). However, these models often depend on closed-source systems and high computational resources, posing challenges in data privacy and deployment. In contrast, small language models (SLMs) struggle with NL2SQL tasks, exhibiting poor performance and incompatibility with existing frameworks. To address these issues, we introduce Feather-SQL, a new lightweight framework tailored for SLMs. Feather-SQL improves SQL executability and accuracy through 1) schema pruning and linking, 2) multi-path and multi-candidate generation. Additionally, we introduce the 1+1 Model Collaboration Paradigm, which pairs a strong general-purpose chat model with a fine-tuned SQL specialist, combining strong analytical reasoning with high-precision SQL generation. Experimental results on BIRD demonstrate that Feather-SQL improves NL2SQL performance on SLMs, with around 10% boost for models without fine-tuning. The proposed paradigm raises the accuracy ceiling of SLMs to 54.76%, highlighting its effectiveness.

NL2SQL小模型双模型数据库

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。