Skip to main content
QUICK REVIEW

[论文解读] Can LLM Already Serve as A Database Interface? A BIg Bench for Large-Scale Database Grounded Text-to-SQLs

Jinyang Li, Binyuan Hui|arXiv (Cornell University)|May 4, 2023
Topic ModelingComputer Science被引用 79
一句话总结

Bird 是一个大型跨域 Text-to-SQL 基准,聚焦真实世界数据库,具有大数值、嘈杂数据、外部知识 grounding,以及执行效率,当前 SOTA LLMs 远远落后于人类表现。

ABSTRACT

Text-to-SQL parsing, which aims at converting natural language instructions into executable SQLs, has gained increasing attention in recent years. In particular, Codex and ChatGPT have shown impressive results in this task. However, most of the prevalent benchmarks, i.e., Spider, and WikiSQL, focus on database schema with few rows of database contents leaving the gap between academic study and real-world applications. To mitigate this gap, we present Bird, a big benchmark for large-scale database grounded in text-to-SQL tasks, containing 12,751 pairs of text-to-SQL data and 95 databases with a total size of 33.4 GB, spanning 37 professional domains. Our emphasis on database values highlights the new challenges of dirty database contents, external knowledge between NL questions and database contents, and SQL efficiency, particularly in the context of massive databases. To solve these problems, text-to-SQL models must feature database value comprehension in addition to semantic parsing. The experimental results demonstrate the significance of database values in generating accurate text-to-SQLs for big databases. Furthermore, even the most effective text-to-SQL models, i.e. ChatGPT, only achieves 40.08% in execution accuracy, which is still far from the human result of 92.96%, proving that challenges still stand. Besides, we also provide an efficiency analysis to offer insights into generating text-to-efficient-SQLs that are beneficial to industries. We believe that BIRD will contribute to advancing real-world applications of text-to-SQL research. The leaderboard and source code are available: https://bird-bench.github.io/.

研究动机与目标

  • 弥合学术 Text-to-SQL 基准与现实世界应用之间的差距,尤其是面对大型、嘈杂的数据库。
  • 引入一个强调数据库数值、外部知识和执行效率的大规模基准 (Bird)。
  • 提供评估指标和基线,以揭示当前模型的局限并指导未来研究。

提出的方法

  • 从 37 个领域中,整理 12,751 组 text-to-SQL 对,覆盖 95 个数据库(33.4 GB)。
  • 开发 Database Description Files 和 external knowledge evidence 分类,以辅助标注。
  • 采用双盲 SQL 标注过程以获取真实 SQL,并确保有效性。
  • 定义 Valid Efficiency Score (VES),以共同评估 SQL 的执行有效性和效率。
  • 在有知识与无知识设置下,评估使用 T5 模型的微调(FT)以及使用 LLMs(ChatGPT、Claude-2、GPT-4 等)的 in-context learning (ICL)。
  • 将 Bird 与 Spider 及 WikiSQL 进行比较,以说明由于大数值和噪声带来的难度增加。

实验结果

研究问题

  • RQ1LLMs 能否在 Text-to-SQL 任务中对包含嘈杂数值的大型数据库进行泛化?
  • RQ2外部知识 grounding 与执行效率如何影响现实世界大数据库上的 Text-to-SQL 性能?
  • RQ3在 Bird 中,当前 SOTA 模型(LLMs)与人类表现之间的差距是多少,原因何在?
  • RQ4不同的标注与评估设置(如双盲 SQL 标注、知识证据)如何影响基准结果?

主要发现

  • Bird 在 37 个领域覆盖 95 个数据库(33.4 GB)的 12,751 个样例,凸显现实世界的数值挑战。
  • 即使最强的 LLMs(GPT-4)也仅实现 54.89% 的执行准确率,远低于人类表现 (92.96%)。
  • 外部知识证据显著提升模型在各难度层级的表现。
  • 知识 grounding、数据库数值理解与查询效率对现实世界的 Text-to-SQL 成功至关重要。
  • 两阶段优化(语义解析先行、再进行 SQL 优化)可带来可观的速度提升(平均时间节省约 77.75%),同时保留结果。
  • Chat-with-Database 与索引调优可以为 SQL 查询带来高达 ~87.3% 的时间节省。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。