NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Evaluating the Data Model Robustness of Text-to-SQL Systems Based on Real User Queries

Jonathan Fürst, Catherine Kosten, Farhard Nooralahzadeh, Yi Zhang, Kurt Stockinger · DOI

Abstract

Text-to-SQL systems (also known as NL-to-SQL systems) have become an increasingly popular solution for bridging the gap between user capabilities and SQL-based data access. These systems translate user requests in natural language to valid SQL statements for a specific database. Recent Text-to-SQL systems have benefited from the rapid improvement of transformer-based language models. However, while Text-to-SQL systems that incorporate such models continuously reach new high scores on -- often synthetic -- benchmark datasets, a systematic exploration of their robustness towards different data models in a real-world, realistic scenario is notably missing. This paper provides the first in-depth evaluation of the data model robustness of Text-to-SQL systems in practice based on a multi-year international project focused on Text-to-SQL interfaces. Our evaluation is based on a real-world deployment of FootballDB, a system that was deployed over a 9 month period in the context of the FIFA World Cup 2022, during which about 6K natural language questions were asked and executed. All of our data is based on real user questions that were asked live to the system. We manually labeled and translated a subset of these questions for three different data models. For each data model, we explore the performance of representative Text-to-SQL systems and language models. We further quantify the impact of training data size, pre-, and post-processing steps as well as language model inference time. Our comprehensive evaluation sheds light on the design choices of real-world Text-to-SQL systems and their impact on moving from research prototypes to real deployments. Last, we provide a new benchmark dataset to the community, which is the first to enable the evaluation of different data models for the same dataset and is substantially more challenging than most previous datasets in terms of query complexity.

Introduction

The transition of Text-to-SQL systems from research prototypes to production environments reveals a significant "robustness gap." While Large Language Models (LLMs) excel at benchmarks like Spider or BIRD, these datasets often feature clean, human-annotated queries on static, simplified schemas. In practice, real users ask ambiguous, linguistically diverse questions that do not necessarily mirror the underlying database structure. This study investigates how the specific design of a database schema—the data model—affects the performance and usability of Text-to-SQL systems.

The FootballDB Dataset

To ground the research in reality, the authors deployed FootballDB, a system containing a century of World Cup data, during the 2022 FIFA World Cup. Over nine months, users asked approximately 6,000 natural language questions. From this pool, 1,200 pairs were manually labeled to create a new, more challenging benchmark.

The FootballDB schema used for the real-world deployment, illustrating the complexity of relationships in a production-grade database.

FootballDB is notably more complex than standard benchmarks. Queries average 33.7 tokens (compared to 18.5 in Spider) and require nearly double the number of joins. This complexity tests the limits of current parsing technologies.

Methodology: Data Model Iteration

The researchers mapped the same football data into three distinct schema versions to test robustness:

  1. v1 (Standard Relational): A traditional normalized model with complex 1:n relationships.
  2. v2 (Optimized): Introduced "bridge tables" to resolve multiple foreign key references between the same tables, aiming to simplify the path for parsers.
  3. v3 (Simplified/Denormalized): Designed to align with natural language intuition, using self-descriptive columns and reducing join requirements.

Impact of Data Model Design

The study found that the data model is a primary determinant of success, especially for smaller models. For instance, the denormalized "v3" model allowed a 3B-parameter T5 model to achieve accuracy levels comparable to the 175B-parameter GPT-3.5.

Comparison of SQL queries generated for the same natural language question across three different data models (v1, v2, v3).

As shown in the figure above, the same user question ("What was the score between Germany and Brazil in 2014?") results in significantly different SQL complexity. The v1 and v2 models require complex UNION operations and multiple joins, whereas v3 simplifies the logic, making it more accessible for the AI to generate correctly.

Key Results and Insights

  • Accuracy Ceiling: Even state-of-the-art systems like GPT-3.5 only reached ~41% execution accuracy on the real-world test set. This highlights the difficulty of real-world queries compared to the 90%+ scores seen on synthetic benchmarks.
  • Schema as the Prompt: For medium-sized models like T5-Picard, including Primary and Foreign Key metadata in the input was critical, boosting accuracy by up to 19%.
  • The Latency Wall: Real-world usability is constrained by inference time. While GPT-3.5 responded in 2.5 seconds, open-source models like LLaMA2-70B took 37 seconds, and T5-Picard took several minutes, rendering them impractical for live user interfaces.
  • Training Data Diminishing Returns: For smaller models like ValueNet, tripling the training data only yielded a 4% increase in accuracy. This suggests that model architecture and schema design are more significant bottlenecks than raw data volume in complex domains.

Conclusion

The findings suggest that "Data Model Engineering" is as vital as prompt engineering for production Text-to-SQL systems. While large LLMs show some robustness to schema variations, optimizing the data model can significantly bridge the performance gap for smaller, more efficient models. However, creating these systems remains labor-intensive; manual labeling of the 1,200 pairs in this study required approximately one person-month. Future work should explore automated tools for refactoring databases into "AI-friendly" schemas to facilitate broader adoption of natural language data interfaces.

Summary updated

BibTeX
@misc{furst2024evaluating,
  author = {Jonathan Fürst and Catherine Kosten and Farhard Nooralahzadeh and Yi Zhang and Kurt Stockinger},
  title = {{Evaluating the Data Model Robustness of Text-to-SQL Systems Based on Real User Queries}},
  year = {2024},
  eprint = {2402.08349},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.08349},
}
Figure