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

重新思考模式链接:一种面向文本到SQL的上下文感知双向检索方法

Rethinking Schema Linking: A Context-Aware Bidirectional Retrieval Approach for Text-to-SQL

University of Alberta, Canada(阿尔伯塔大学);Huawei Technologies Canada Co., Ltd., Canada(华为技术加拿大有限公司)

Md Mahadi Hasan Nahid, Davood Rafiei, Weiwei Zhang, Yong Zhang

AI总结:

本文提出了一种上下文感知的双向检索方法,用于提升文本到SQL系统的模式链接精度与效率。

摘要:

模式链接——将自然语言问题与数据库模式元素对齐的过程——是文本到SQL系统中的一个关键但尚未充分研究的组成部分。尽管最近的方法主要集中在改进SQL生成上,但它们往往忽略了相关模式元素的检索,这可能导致幻觉和执行失败。在本工作中,我们提出了一种上下文感知的双向模式检索框架,将模式链接视为一个独立的问题。我们的方法结合了两种互补的策略:先表检索再列选择,以及先列检索再表选择。它进一步增强了诸如问题分解、关键词提取和关键短语提取等技术。通过在具有挑战性的基准测试如BIRD和Spider上的全面评估,我们证明了我们的方法在提高模式召回率的同时减少了假阳性。此外,使用我们检索到的模式生成的SQL在一致性上优于全模式基线,并且接近oracle性能,而无需查询细化。值得注意的是,我们的方法在全模式和完美模式设置之间缩小了性能差距50%。我们的发现强调了模式链接作为提高文本到SQL准确性与效率的强大杠杆。

英文摘要:

Schema linking -- the process of aligning natural language questions with database schema elements -- is a critical yet underexplored component of Text-to-SQL systems. While recent methods have focused primarily on improving SQL generation, they often neglect the retrieval of relevant schema elements, which can lead to hallucinations and execution failures. In this work, we propose a context-aware bidirectional schema retrieval framework that treats schema linking as a standalone problem. Our approach combines two complementary strategies: table-first retrieval followed by column selection, and column-first retrieval followed by table selection. It is further augmented with techniques such as question decomposition, keyword extraction, and keyphrase extraction. Through comprehensive evaluations on challenging benchmarks such as BIRD and Spider, we demonstrate that our method significantly improves schema recall while reducing false positives. Moreover, SQL generation using our retrieved schema consistently outperforms full-schema baselines and closely approaches oracle performance, all without requiring query refinement. Notably, our method narrows the performance gap between full and perfect schema settings by 50\%. Our findings highlight schema linking as a powerful lever for enhancing Text-to-SQL accuracy and efficiency.

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

↑