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

DAC:用于Text-to-SQL的分解式自动纠正

DAC: Decomposed Automation Correction for Text-to-SQL

Research Center for Social Computing and Information Retrieval(社会计算与信息检索研究中心);Harbin Institute of Technology(哈尔滨工业大学)

Dingzirui Wang, Longxu Dou, Xuanliang Zhang, Qingfu Zhu, Wanxiang Che

AI总结:

针对LLM直接纠正SQL效果差的问题,提出分解式自动纠正方法DAC,通过实体链接和骨架解析生成反馈来纠正SQL,在三个基准上平均提升3.7%。

摘要:

Text-to-SQL是一项重要任务,通过自动生成SQL查询帮助人们从数据库中获取信息。考虑到出色的性能,基于大型语言模型(LLMs)的方法成为Text-to-SQL的主流。在这些方法中,自动纠正是一种有效的方法,通过纠正生成结果中的错误来进一步提升性能。现有的纠正方法要求LLMs直接对生成的SQL进行纠正,而先前的研究表明LLMs不知道如何检测错误,导致性能较差。因此,在本文中,我们提出采用分解式纠正来提升Text-to-SQL性能。我们首先证明,分解式纠正优于直接纠正,因为利用分解子任务的结果来检测和修复错误比直接使用SQL更容易。基于这一分析,我们提出了分解式自动纠正(Decomposed Automation Correction,DAC),它通过将Text-to-SQL分解为实体链接和骨架解析来纠正SQL。DAC首先生成与问题对应的实体和骨架,然后将初始SQL与生成的实体和骨架之间的差异进行比较,作为纠正的反馈。实验结果表明,与基线方法相比,我们的方法在Spider、Bird和KaggleDBQA上平均提升了$3.7\%$的性能,证明了DAC的有效性。

英文摘要:

Text-to-SQL is an important task that helps people obtain information from databases by automatically generating SQL queries. Considering the brilliant performance, approaches based on Large Language Models (LLMs) become the mainstream for text-to-SQL. Among these approaches, automated correction is an effective approach that further enhances performance by correcting the mistakes in the generated results. The existing correction methods require LLMs to directly correct with generated SQL, while previous research shows that LLMs do not know how to detect mistakes, leading to poor performance. Therefore, in this paper, we propose to employ the decomposed correction to enhance text-to-SQL performance. We first demonstrate that decomposed correction outperforms direct correction since detecting and fixing mistakes with the results of the decomposed sub-tasks is easier than with SQL. Based on this analysis, we introduce Decomposed Automation Correction (DAC), which corrects SQL by decomposing text-to-SQL into entity linking and skeleton parsing. DAC first generates the entity and skeleton corresponding to the question and then compares the differences between the initial SQL and the generated entities and skeleton as feedback for correction. Experimental results show that our method improves performance by $3.7\%$ on average of Spider, Bird, and KaggleDBQA compared with the baseline method, demonstrating the effectiveness of DAC.

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

↑