arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.12911cs.CLcs.DB
收藏

基于背包优化的模式链接用于基于大语言模型的文本到SQL生成

Knapsack Optimization-based Schema Linking for LLM-based Text-to-SQL Generation

The Hong Kong Polytechnic University(香港理工大学);City University of Macau(澳门城市大学);Jinan University(济南大学)

Zheng Yuan, Hao Chen, Zijin Hong, Qinggang Zhang, Feiran Huang, Qing Li, Xiao Huang

AI总结:

本文提出KaSLA方法,通过引入受限缺失指标改进模式链接,优化SQL生成性能,实验表明其在Spider和BIRD基准上显著提升文本到SQL模型表现。

摘要:

从用户查询生成SQL是一个长期挑战,初始模式链接的准确性显著影响后续SQL生成性能。然而,当前模式链接模型仍难以处理缺失相关模式元素或过多冗余元素。关键原因在于常用指标召回率和精确率无法捕捉相关元素缺失,因此无法反映实际模式链接性能。为此,我们提出增强的模式链接指标,引入受限缺失指示器。进而提出基于背包优化的模式链接方法KaSLA,设计用于防止相关模式元素缺失同时最小化冗余元素的包含。KaSLA采用分层链接策略,首先确定最优表链接,随后在选定表内链接列以减少链接候选空间。在每次链接过程中,利用背包优化方法链接潜在相关元素,同时考虑有限的潜在冗余容忍度。通过此优化,KaSLA-1.6B在大规模LLM中取得优于DeepSeek-V3等SOTA模式链接方法的模式链接结果。在Spider和BIRD基准上的广泛实验验证KaSLA可显著提升SOTA文本到SQL模型的SQL生成性能,通过替换其模式链接过程。代码可在https://github.com/DEEP-PolyU/KaSLA获取。

英文摘要:

Generating SQLs from user queries is a long-standing challenge, where the accuracy of initial schema linking significantly impacts subsequent SQL generation performance. However, current schema linking models still struggle with missing relevant schema elements or an excess of redundant ones. A crucial reason for this is that commonly used metrics, recall and precision, fail to capture relevant element missing and thus cannot reflect actual schema linking performance. Motivated by this, we propose enhanced schema linking metrics by introducing a \textbf{restricted missing indicator}. Accordingly, we introduce \textbf{\underline{K}n\underline{a}psack optimization-based \underline{S}chema \underline{L}inking \underline{A}pproach (KaSLA)}, a plug-in schema linking method designed to prevent the missing of relevant schema elements while minimizing the inclusion of redundant ones. KaSLA employs a hierarchical linking strategy that first identifies the optimal table linking and subsequently links columns within the selected table to reduce linking candidate space. In each linking process, it utilizes a knapsack optimization approach to link potentially relevant elements while accounting for a limited tolerance of potentially redundant ones. With this optimization, KaSLA-1.6B achieves superior schema linking results compared to large-scale LLMs, including DeepSeek-V3 with the state-of-the-art (SOTA) schema linking method. Extensive experiments on Spider and BIRD benchmarks verify that KaSLA can significantly improve the SQL generation performance of SOTA Text2SQL models by substituting their schema linking processes. The code is available at https://github.com/DEEP-PolyU/KaSLA.

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

↑