A practical text-to-SQL system should generalize well on a wide variety of natural language questions, unseen database schemas, and novel SQL query structures. To comprehensively evaluate text-to-SQL systems, we introduce a \textbf{UNI}fied benchmark for \textbf{T}ext-to-SQL \textbf{E}valuation (UNITE). It is composed of publicly available text-to-SQL datasets, containing natural language questions from more than 12 domains, SQL queries from more than 3.9K patterns, and 29K databases. Compared to the widely used Spider benchmark \cite{yu-etal-2018-spider}, we introduce $\sim$120K additional examples and a threefold increase in SQL patterns, such as comparative and boolean questions. We conduct a systematic study of six state-of-the-art (SOTA) text-to-SQL parsers on our new benchmark and show that: 1) Codex performs surprisingly well on out-of-domain datasets; 2) specially designed decoding methods (e.g. constrained beam search) can improve performance for both in-domain and out-of-domain settings; 3) explicitly modeling the relationship between questions and schemas further improves the Seq2Seq models. More importantly, our benchmark presents key challenges towards compositional generalization and robustness issues -- which these SOTA models cannot address well.
翻译:实用的文本到SQL系统应能在多样化的自然语言问题、未见过的数据库模式以及新颖的SQL查询结构上实现良好泛化。为全面评估文本到SQL系统,我们提出面向文本到SQL评估的统一基准(UNITE)。该基准由公开可用的文本到SQL数据集构成,涵盖来自12个以上领域的自然语言问题、超过3900种模式的SQL查询及29000个数据库。与广泛使用的Spider基准(yu-et al. 2018)相比,我们新增约12万个样本,并将SQL模式(如比较型与布尔型问题)扩展至三倍。我们基于新基准对六种最先进的文本到SQL解析器开展系统性研究,结果表明:1)Codex在域外数据集上表现惊人;2)特定解码方法(如约束束搜索)可同步提升域内与域外场景的性能;3)显式建模问题与模式之间关系可进一步改进Seq2Seq模型。更重要的是,我们的基准揭示了当前最先进模型难以有效应对的构成性泛化与鲁棒性等关键挑战。