arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.15307cs.CL
收藏

在生成之前,先对齐!一种缓解文本到SQL生成中幻觉的新颖且有效的策略

Before Generation, Align it! A Novel and Effective Strategy for Mitigating Hallucinations in Text-to-SQL Generation

The University of Hong Kong(香港大学);Shanghai AI Laboratory(上海人工智能实验室);BAAI(北京智源人工智能研究院);The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳))

Ge Qu, Jinyang Li, Bowen Li, Bowen Qin, Nan Huo, Chenhao Ma, Reynold Cheng

AI总结:

提出任务对齐策略及TA-SQL框架,通过利用相似任务经验缓解文本到SQL生成中的幻觉,在多个基准上显著提升性能,如GPT-4在BIRD开发集上相对提升21.23%。

摘要:

由上下文学习(ICL)驱动的大型语言模型(LLMs)显著提升了文本到SQL的性能。以往的方法通常采用两阶段推理框架,即1)模式链接和2)逻辑合成,使得该框架不仅有效而且可解释。尽管取得了这些进展,LLMs固有的泛化不良特性常常导致幻觉,这限制了LLMs的全部潜力。在这项工作中,我们首先识别并分类了文本到SQL中每个阶段常见的幻觉类型。然后,我们引入了一种新颖的策略——任务对齐(TA),旨在缓解每个阶段的幻觉。TA鼓励LLMs利用相似任务的经验,而不是从头开始任务。这有助于LLMs减轻泛化负担,从而有效缓解幻觉。我们进一步提出了TA-SQL,一种基于该策略的文本到SQL框架。实验结果和全面分析证明了我们框架的有效性和鲁棒性。具体来说,它在BIRD开发集上将GPT-4基线的性能相对提升了21.23%,并在六个模型和四个主流、复杂的文本到SQL基准上产生了显著改进。

英文摘要:

Large Language Models (LLMs) driven by In-Context Learning (ICL) have significantly improved the performance of text-to-SQL. Previous methods generally employ a two-stage reasoning framework, namely 1) schema linking and 2) logical synthesis, making the framework not only effective but also interpretable. Despite these advancements, the inherent bad nature of the generalization of LLMs often results in hallucinations, which limits the full potential of LLMs. In this work, we first identify and categorize the common types of hallucinations at each stage in text-to-SQL. We then introduce a novel strategy, Task Alignment (TA), designed to mitigate hallucinations at each stage. TA encourages LLMs to take advantage of experiences from similar tasks rather than starting the tasks from scratch. This can help LLMs reduce the burden of generalization, thereby mitigating hallucinations effectively. We further propose TA-SQL, a text-to-SQL framework based on this strategy. The experimental results and comprehensive analysis demonstrate the effectiveness and robustness of our framework. Specifically, it enhances the performance of the GPT-4 baseline by 21.23% relatively on BIRD dev and it yields significant improvements across six models and four mainstream, complex text-to-SQL benchmarks.

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

↑