arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2402.11517cs.CL
收藏

Knowledge-to-SQL:利用数据专家LLM增强SQL生成

Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLM

Jinan University(暨南大学);The Hong Kong Polytechnic University(香港理工大学)

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

AI总结:

针对text-to-SQL中知识不足导致SQL生成不准确的问题,本文提出Knowledge-to-SQL框架,通过数据专家LLM(DELLM)和基于数据库反馈的偏好学习策略为现有模型补充有用知识,实验证明其能提升最先进方法的性能。

摘要:

为用户问题生成准确的SQL查询(text-to-SQL)一直是一个长期挑战,因为这需要深入理解用户问题和相应的数据库模式,才能准确检索所需内容。现有方法依赖大语言模型(LLMs)的综合能力来生成SQL。然而,一些必要知识并未明确包含在数据库模式和用户问题中,或已被LLMs学习。因此,知识不足问题的生成SQL可能不准确,从而对text-to-SQL模型的性能和鲁棒性产生负面影响。为应对这一挑战,我们提出了Knowledge-to-SQL框架,该框架采用定制化的数据专家LLM(DELLM)为所有text-to-SQL模型提供有用知识。具体而言,我们介绍了DELLM在表格阅读和基础微调过程方面的详细实现。我们进一步提出了一种基于数据库反馈的偏好学习(PLDBF)策略,用于优化DELLM,使其为LLMs生成更有用的知识。大量实验验证了DELLM能够增强text-to-SQL任务的最先进方法。DELLM的相应代码已发布以供进一步研究。

英文摘要:

Generating accurate SQL queries for user questions (text-to-SQL) has been a long-standing challenge since it requires a deep understanding of both the user's question and the corresponding database schema in order to retrieve the desired content accurately. Existing methods rely on the comprehensive capability of large language models (LLMs) to generate the SQL. However, some necessary knowledge is not explicitly included in the database schema and user question or has been learned by LLMs. Thus, the generated SQL of the knowledge-insufficient questions may be inaccurate, negatively influencing the text-to-SQL models' performance and robustness. To address this challenge, we propose the Knowledge-to-SQL framework, which employs tailored Data Expert LLM (DELLM) to provide helpful knowledge for all text-to-SQL models. Specifically, we introduce the detailed implementation of DELLM regarding table reading and the basic fine-tuning process. We further propose a Preference Learning via Database Feedback (PLDBF) strategy, refining the DELLM to generate more helpful knowledge for LLMs. Extensive experiments verify that DELLM can enhance the state-of-the-art approaches for text-to-SQL tasks. The corresponding code of DELLM is released for further research.

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

↑