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

RSL-SQL:文本转SQL生成中的鲁棒模式链接

RSL-SQL: Robust Schema Linking in Text-to-SQL Generation

Huazhong University of Science and Technology(华中科技大学);Alibaba Inc.(阿里巴巴集团)

Zhenbiao Cao, Yuanlei Zheng, Zhihao Fan, Xiaojin Zhang, Wei Chen, Xiang Bai

AI总结:

针对文本转SQL任务中模式链接存在的必要元素遗漏和破坏数据库结构完整性问题,提出结合双向链接、上下文增强等策略的RSL-SQL框架,在BIRD和Spider基准上实现开源方案最优执行准确率,且使用低成本模型时优于GPT-4基系统。

摘要:

文本转SQL生成旨在将自然语言问题转换为SQL语句。在基于大语言模型的文本转SQL任务中,模式链接是一种广泛采用的策略,通过仅选择相关的模式元素来简化大语言模型的输入,从而减少噪声和计算开销。然而,模式链接面临需要谨慎处理的风险,包括可能遗漏必要元素和破坏数据库结构完整性。为应对这些挑战,我们提出一种名为RSL-SQL的新型框架,它结合了双向模式链接、上下文信息增强、二进制选择策略和多轮自校正。我们使用前向和后向剪枝方法提高模式链接的召回率,在将输入列数量减少83%的同时实现94%的严格召回率。此外,它通过在完整模式和增强了上下文信息的简化模式之间投票来规避风险。在BIRD和Spider基准数据集上的实验表明,我们的方法在开源方案中实现了最先进的执行准确率,使用GPT-4o时在BIRD上达到67.2%,在Spider上达到87.9%。此外,当采用DeepSeek(成本低得多)且使用相同完整提示时,我们的方法优于一系列基于GPT-4的文本转SQL系统。大量分析和消融研究证实了框架中每个组件的有效性。代码可在https://github.com/Laqcce-cao/RSL-SQL获取。

英文摘要:

Text-to-SQL generation aims to translate natural language questions into SQL statements. In Text-to-SQL based on large language models, schema linking is a widely adopted strategy to streamline the input for LLMs by selecting only relevant schema elements, therefore reducing noise and computational overhead. However, schema linking faces risks that require caution, including the potential omission of necessary elements and disruption of database structural integrity. To address these challenges, we propose a novel framework called RSL-SQL that combines bidirectional schema linking, contextual information augmentation, binary selection strategy, and multi-turn self-correction. We improve the recall of pattern linking using forward and backward pruning methods, achieving a strict recall of 94% while reducing the number of input columns by 83%. Furthermore, it hedges the risk by voting between a full mode and a simplified mode enhanced with contextual information. Experiments on the BIRD and Spider benchmarks demonstrate that our approach achieves SOTA execution accuracy among open-source solutions, with 67.2% on BIRD and 87.9% on Spider using GPT-4o. Furthermore, our approach outperforms a series of GPT-4 based Text-to-SQL systems when adopting DeepSeek (much cheaper) with same intact prompts. Extensive analysis and ablation studies confirm the effectiveness of each component in our framework. The codes are available at https://github.com/Laqcce-cao/RSL-SQL.

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

↑