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

SQL-Encoder:通过上下文感知编码器改进NL2SQL上下文学习

SQL-Encoder: Improving NL2SQL In-Context Learning Through a Context-Aware Encoder

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

Mohammadreza Pourreza, Davood Rafiei, Yuxi Feng, Raymond Li, Zhenan Fan, Weiwei Zhang

AI总结:

本文提出SQL-Encoder模型,通过17万问题对数据集训练相似性预测,精准捕捉查询结构相似性,显著提升NL2SQL模型在1-shot上下文学习中的下游性能。

摘要:

检测查询间的结构相似性对于在上下文学习模型中选择示例至关重要。然而,仅基于查询的自然语言表达而不考虑SQL查询来评估结构相似性,提出了重大挑战。本文探讨了该相似性度量的重要性,并提出了一种准确估计它的模型。为此,我们利用一个包含17万个问题对的数据集,精心训练了一个相似性预测模型。综合评估表明,所提模型能熟练捕捉问题间的结构相似性,Kendall-Tau距离和precision@k指标的改进证明了这一点。值得注意的是,我们的模型超越了来自OpenAI和Cohere的强大竞争性嵌入模型。此外,与这些竞争模型相比,我们提出的编码器在1-shot上下文学习场景中提升了NL2SQL模型的下游性能,GPT-3.5-turbo提升1-2%,CodeLlama-7B提升4-8%,CodeLlama-13B提升2-3%。

英文摘要:

Detecting structural similarity between queries is essential for selecting examples in in-context learning models. However, assessing structural similarity based solely on the natural language expressions of queries, without considering SQL queries, presents a significant challenge. This paper explores the significance of this similarity metric and proposes a model for accurately estimating it. To achieve this, we leverage a dataset comprising 170k question pairs, meticulously curated to train a similarity prediction model. Our comprehensive evaluation demonstrates that the proposed model adeptly captures the structural similarity between questions, as evidenced by improvements in Kendall-Tau distance and precision@k metrics. Notably, our model outperforms strong competitive embedding models from OpenAI and Cohere. Furthermore, compared to these competitive models, our proposed encoder enhances the downstream performance of NL2SQL models in 1-shot in-context learning scenarios by 1-2\% for GPT-3.5-turbo, 4-8\% for CodeLlama-7B, and 2-3\% for CodeLlama-13B.

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

↑