arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.05237cs.DBcs.AI
收藏

PSM-SQL:面向文本到SQL的多粒度语义渐进式模式学习

PSM-SQL: Progressive Schema Learning with Multi-granularity Semantics for Text-to-SQL

Guangdong University of Technology(广东工业大学);Platform and Content Group, Tencent(腾讯平台与内容事业群)

Zhuopan Yang, Yuanzhen Xie, Ruichao Zhong, Yunzhi Tan, Enjie Liu, Zhenguo Yang, Mochi Gao, Bo Hu, Zang Li

AI总结:

本文提出PSM-SQL框架,通过列、表、数据库多粒度渐进式模式链接和链式循环策略减少冗余模式,提升文本到SQL任务的准确率。

摘要:

由于数据库模式数量庞大且存在冗余,干扰了语义学习,并且自然语言(NL)与SQL之间存在领域偏移,因此将自然语言问题转换为可执行的结构化查询语言(SQL)查询用于文本到SQL任务具有挑战性。现有的模式链接工作聚焦于表级别并且只执行一次,忽略了模式的多粒度语义和可链式循环特性。在本文中,我们提出了一种面向文本到SQL的多粒度语义渐进式模式链接(PSM-SQL)框架,以减少冗余的数据库模式。通过多粒度模式链接(MSL)模块,PSM-SQL在列、表和数据库三个级别学习模式语义。具体而言,在列级别使用三元组损失学习嵌入,而在数据库级别采用微调大语言模型(LLMs)进行模式推理。MSL在表级别使用分类器和相似度分数来建模模式交互以进行模式链接。特别地,PSM-SQL采用链式循环策略,通过不断减少冗余模式的数量来降低模式链接的任务难度。在文本到SQL数据集上进行的实验表明,所提出的PSM-SQL比现有方法高1-3个百分点。

英文摘要:

It is challenging to convert natural language (NL) questions into executable structured query language (SQL) queries for text-to-SQL tasks due to the vast number of database schemas with redundancy, which interferes with semantic learning, and the domain shift between NL and SQL. Existing works for schema linking focus on the table level and perform it once, ignoring the multi-granularity semantics and chainable cyclicity of schemas. In this paper, we propose a progressive schema linking with multi-granularity semantics (PSM-SQL) framework to reduce the redundant database schemas for text-to-SQL. Using the multi-granularity schema linking (MSL) module, PSM-SQL learns the schema semantics at the column, table, and database levels. More specifically, a triplet loss is used at the column level to learn embeddings, while fine-tuning LLMs is employed at the database level for schema reasoning. MSL employs classifier and similarity scores to model schema interactions for schema linking at the table level. In particular, PSM-SQL adopts a chain loop strategy to reduce the task difficulty of schema linking by continuously reducing the number of redundant schemas. Experiments conducted on text-to-SQL datasets show that the proposed PSM-SQL is 1-3 percentage points higher than the existing methods.

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

↑