论文标题
UNISAR:文本到SQL的统一结构感知的自回归语言模型
UniSAr: A Unified Structure-Aware Autoregressive Language Model for Text-to-SQL
论文作者
论文摘要
现有的文本到SQL语义解析器通常是为特定设置设计的,例如跨越多个表,域或转弯的查询,这使得它们在应用于不同设置时无效。我们介绍Unisar(统一结构感知的自动回归语言模型),该模型可以直接使用现成的语言模型体系结构,并在不同的设置下始终如一地展示高性能。具体而言,UNISAR扩展了现有的自回归语言模型,以合并三个非侵入性扩展,以使它们引起结构感知:(1)将结构标记添加到编码数据库架构,对话上下文及其关系中; (2)限制解码以解码给定数据库架构结构良好的SQL; (3)基于数据库架构中的SQL完成SQL完成,以完成潜在的丢失联接关系。在涵盖多域,多桌和多转弯的七个著名的文本到SQL数据集中,Unisar与最高级设计的特定设计的文本对SQL模型相比表现出了高度可比性或更好的性能。重要的是,我们的UNISAR是无创的,因此文本到SQL的其他核心模型也可以采用我们的扩展以进一步提高性能。
Existing text-to-SQL semantic parsers are typically designed for particular settings such as handling queries that span multiple tables, domains or turns which makes them ineffective when applied to different settings. We present UniSAr (Unified Structure-Aware Autoregressive Language Model), which benefits from directly using an off-the-shelf language model architecture and demonstrates consistently high performance under different settings. Specifically, UniSAr extends existing autoregressive language models to incorporate three non-invasive extensions to make them structure-aware: (1) adding structure mark to encode database schema, conversation context, and their relationships; (2) constrained decoding to decode well structured SQL for a given database schema; and (3) SQL completion to complete potential missing JOIN relationships in SQL based on database schema. On seven well-known text-to-SQL datasets covering multi-domain, multi-table and multi-turn, UniSAr demonstrates highly comparable or better performance to the most advanced specifically-designed text-to-SQL models. Importantly, our UniSAr is non-invasive, such that other core model advances in text-to-SQL can also adopt our extensions to further enhance performance.