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

学习元数据无关的表示用于文本到SQL的上下文示例选择

Learning Metadata-Agnostic Representations for Text-to-SQL In-Context Example Selection

Amazon Web Services(亚马逊网络服务)

Chuhong Mai, Ro-ee Tal, Thahir Mohamed

AI总结:

本文提出MARLO方法,通过在共享嵌入空间中对齐自然语言问题与SQL查询结构来学习元数据无关表示,从而为文本到SQL任务选择结构语义相关的上下文示例,在Spider基准上显著提升执行准确率并降低推理延迟。

摘要:

上下文学习(ICL)是一种强大的范式,其中大型语言模型(LLMs)受益于添加到提示中的任务演示。然而,选择最优演示并非易事,尤其是对于输入和输出分布不同的复杂或多模态任务。我们假设,形成任务特定的输入表示是关键。在本文中,我们提出了一种方法,在共享嵌入空间中对齐自然语言问题和SQL查询的表示。我们的技术被称为MARLO——面向文本到SQL的元数据无关表示学习——利用查询结构来建模查询意图,而不会过度依赖底层数据库元数据(即问题或查询中引用的数据库的表、列或领域特定实体)。这使得MARLO能够选择在结构和语义上与任务相关的示例,而不是与某个领域或问题措辞存在虚假关联的示例。当基于问题相似性检索示例时,MARLO在Spider基准上表现出优于通用嵌入模型的性能(执行准确率平均提高+2.9个百分点)。它还比次优的掩蔽元数据信息的方法平均高出+0.8个百分点的执行准确率,同时推理延迟显著更低。

英文摘要:

In-context learning (ICL) is a powerful paradigm where large language models (LLMs) benefit from task demonstrations added to the prompt. Yet, selecting optimal demonstrations is not trivial, especially for complex or multi-modal tasks where input and output distributions differ. We hypothesize that forming task-specific representations of the input is key. In this paper, we propose a method to align representations of natural language questions and those of SQL queries in a shared embedding space. Our technique, dubbed MARLO - Metadata-Agnostic Representation Learning for Text-tO-SQL - uses query structure to model querying intent without over-indexing on underlying database metadata (i.e. tables, columns, or domain-specific entities of a database referenced in the question or query). This allows MARLO to select examples that are structurally and semantically relevant for the task rather than examples that are spuriously related to a certain domain or question phrasing. When used to retrieve examples based on question similarity, MARLO shows superior performance compared to generic embedding models (on average +2.9\%pt. in execution accuracy) on the Spider benchmark. It also outperforms the next best method that masks metadata information by +0.8\%pt. in execution accuracy on average, while imposing a significantly lower inference latency.

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

↑