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

通过领域数据库知识注入增强大语言模型的文本到SQL能力

Enhancing Text-to-SQL Capabilities of Large Language Models via Domain Database Knowledge Injection

School of Cyber Science Engineering, Huazhong University of Science and Technology(华中科技大学网络空间科学与工程学院);Wuhan AI Research Foundation Model Research Center(武汉人工智能研究基金会大模型研究中心);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Peng Cheng Laboratory(鹏城实验室)

Xingyu Ma, Xin Tian, Lingxiang Wu, Xuepeng Wang, Xueming Tang, Jinqiao Wang

AI总结:

本文提出通过注入领域数据库知识(如表模式和单元格值)来增强大语言模型的文本到SQL能力,实验表明预训练和微调显著提升执行匹配和精确匹配指标,并具有良好泛化性。

摘要:

文本到SQL是语义解析中的一个子任务,随着大语言模型(LLMs)的发展,该任务取得了快速进展。然而,由于幻觉问题和缺乏特定领域的数据库知识(如表模式和单元格值),LLMs面临挑战。因此,它们在生成表名、列名以及将值匹配到SQL语句中的正确列时可能会出错。本文介绍了一种知识注入方法,通过引入先验知识来增强LLMs理解模式内容的能力。该方法提高了它们在文本到SQL任务中的性能。实验结果表明,在特定领域数据库知识上预训练LLMs并在下游文本到SQL任务上进行微调,显著提高了各种模型上的执行匹配(EX)和精确匹配(EM)指标。这有效减少了生成列名和将值匹配到列时的错误。此外,注入知识的模型可应用于许多下游文本到SQL任务,证明了本文所提出方法的泛化性。

英文摘要:

Text-to-SQL is a subtask in semantic parsing that has seen rapid progress with the evolution of Large Language Models (LLMs). However, LLMs face challenges due to hallucination issues and a lack of domain-specific database knowledge(such as table schema and cell values). As a result, they can make errors in generating table names, columns, and matching values to the correct columns in SQL statements. This paper introduces a method of knowledge injection to enhance LLMs' ability to understand schema contents by incorporating prior knowledge. This approach improves their performance in Text-to-SQL tasks. Experimental results show that pre-training LLMs on domain-specific database knowledge and fine-tuning them on downstream Text-to-SQL tasks significantly improves the Execution Match (EX) and Exact Match (EM) metrics across various models. This effectively reduces errors in generating column names and matching values to the columns. Furthermore, the knowledge-injected models can be applied to many downstream Text-to-SQL tasks, demonstrating the generalizability of the approach presented in this paper.

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

↑