ChatPaper.aiChatPaper

Feather-SQL:一款面向小型语言模型的轻量级NL2SQL框架,采用双模型协作范式

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

March 22, 2025
作者: Wenqi Pei, Hailing Xu, Hengyuan Zhao, Shizheng Hou, Han Chen, Zining Zhang, Pingyi Luo, Bingsheng He
cs.AI

摘要

自然語言轉SQL(NL2SQL)技術在大型語言模型(LLMs)的推動下取得了顯著進展。然而,這些模型往往依賴於閉源系統和高計算資源,在數據隱私和部署方面帶來挑戰。相比之下,小型語言模型(SLMs)在NL2SQL任務上表現欠佳,性能低下且與現有框架不兼容。為解決這些問題,我們提出了Feather-SQL,這是一個專為SLMs設計的新型輕量級框架。Feather-SQL通過1)模式剪枝與鏈接,2)多路徑與多候選生成,提升了SQL的可執行性與準確性。此外,我們引入了1+1模型協作範式,將一個強大的通用聊天模型與一個精調的SQL專家模型配對,結合了強大的分析推理能力與高精度的SQL生成能力。在BIRD數據集上的實驗結果表明,Feather-SQL顯著提升了SLMs在NL2SQL任務上的性能,對於未經精調的模型,性能提升約10%。所提出的範式將SLMs的準確率上限提升至54.76%,充分展示了其有效性。
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.

Summary

AI-Generated Summary

PDF132March 25, 2025