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 Gap in Text-to-SQL Research
Traditional benchmarks like Spider and WikiSQL have been instrumental in advancing Text-to-SQL research, but they often operate in "schema-heavy" yet "value-light" environments. In these academic datasets, databases are typically small, and the data is pristine. However, real-world industrial databases are massive and "dirty," containing values that require cleaning or complex string manipulation (e.g., stripping currency symbols like "US$").
As illustrated in the figure above, BIRD (BIg bench for laRge-scale Database grounded Text-to-SQLs) addresses three primary real-world challenges:
- Large and Realistic Database Values: Models must handle noisy data, such as casting strings containing currency symbols to numeric types for calculations.
- External Knowledge Reasoning: Answering questions often requires mapping natural language terms to specific database codes (e.g., understanding that "weekly issuance" corresponds to the value "POPLATEK TYDNE").
- SQL Execution Efficiency: In a multi-gigabyte database, a "correct" but unoptimized query is useless. BIRD emphasizes the need for efficient SQL that can handle millions of rows.
The BIRD Benchmark
BIRD represents a massive leap in scale compared to its predecessors. It encompasses 12,751 text-to-SQL pairs across 95 databases, totaling 33.4 GB. This scale is designed to force models to move beyond simple semantic parsing toward true database grounding.
The benchmark covers 37 professional domains, including blockchain, healthcare, and retail. As shown in the comparison table, BIRD features an average of 549,000 rows per database, dwarfing the 2,000 rows found in Spider. Furthermore, it is the first major benchmark to explicitly evaluate external knowledge requirements and SQL execution efficiency.
Methodology and Evaluation
To ensure high-quality ground truth, the authors utilized a rigorous four-step pipeline:
- Database Curation: Sourcing large-scale, diverse databases from platforms like Kaggle.
- Double-Blind Annotation: Two independent SQL experts generated queries for every question. If their results differed, a third expert mediated to reach a consensus.
- External Knowledge Grounding: Annotators provided "Knowledge Evidence"—hints explaining domain-specific logic or value mappings—to assist models in reasoning.
- Efficiency Evaluation: The researchers introduced the Valid Efficiency Score (VES). This metric rewards models that generate computationally efficient SQL queries, which is critical for industrial applications where query runtime directly impacts costs and usability.
Key Results and the Human-AI Gap
The results from BIRD provide a sobering reality check for current Large Language Models (LLMs). While GPT-4 is the top performer, its execution accuracy (EX) remains around 55% even when provided with external knowledge evidence. Without such evidence, performance drops significantly.
More strikingly, there remains a massive gap between AI and human performance. Human experts achieve an execution accuracy of 92.96%, nearly double that of the best-performing models. Additionally, performance scales poorly with task difficulty; on "challenging" queries, even GPT-4's accuracy falls to approximately 20%. This suggests that while LLMs are proficient at simple semantic mapping, they still struggle with the deep data grounding and complex reasoning required for large-scale, real-world database interfaces.
Conclusion
BIRD shifts the Text-to-SQL paradigm from academic toy examples to industrial-grade challenges. By highlighting the importance of database values, external knowledge, and execution efficiency, it provides a more accurate measure of how close we are to truly autonomous database interfaces. The significant performance gap between LLMs and humans indicates that future research must focus on better value comprehension and more robust reasoning over large, noisy datasets.
Summary updated