Abstract
We present the first domain-specific text-to-SQL benchmark in Russian, targeting fields with high operational load where rapid decision-making is critical. The benchmark spans across 9 domains, including healthcare, aviation, and others, and comprises 409 curated query pairs. It is designed to test model generalization under domain shift, introducing challenges such as specialized terminology and complex schema structures. Evaluation of state-of-the-art large language models (LLM) reveals a significant performance drop in comparison to open-domain academic benchmarks, highlighting the need for domain-aware approaches in text-to-SQL.
Introduction
Translating natural language into executable SQL (Text-to-SQL) is a critical step toward making data accessible to non-technical users. However, most existing benchmarks like Spider or the Russian PAUQ focus on general-purpose queries over relatively simple, clean databases. In real-world industrial applications, databases are often messy, utilizing specialized jargon and requiring complex reasoning across multiple tables. RedSQL addresses this gap by providing a rigorous, domain-specific evaluation set for the Russian language, which is often underserved in high-stakes NLP research.
The RedSQL Benchmark
The RedSQL benchmark consists of 409 curated query pairs across 9 high-impact domains, including banking, aviation, medicine, and logistics. A key differentiator of RedSQL is its structural complexity, designed to mirror real-world industrial environments.
As shown in the comparison above, RedSQL features a significantly higher average of 4.6 tables per query compared to 2.4 in EHRSQL and 1.2 in KaggleDBQA. This increased complexity tests the models' ability to navigate intricate schema relationships and perform multi-table joins.
Methodology
The benchmark was constructed through a four-step pipeline:
- Domain-Specific Schema Design: Manual design of schemas for nine domains based on real-world entities and relationships.
- Data Population: Creation of realistic SQLite databases using a mix of synthetic data generation and LLM-assisted context-aware entries for domain-specific content.
- SQL Query Generation: A hybrid approach of LLM generation and manual curation to create queries involving multi-table joins, nested subqueries, and temporal reasoning.
- Natural Language Formulation: Translation of SQL queries into fluent, domain-specific Russian questions, followed by manual review by graduate computer science students.
Key Insights and Results
Evaluation of state-of-the-art LLMs on RedSQL revealed a massive "performance cliff." Models that scored ~75% on general academic benchmarks like PAUQ saw their accuracy drop to ~28% on RedSQL.
Performance Analysis
- Top Performer: GPT-4o emerged as the most stable and consistently high-performing model across domains, though even its performance was significantly lower than on general tasks.
- Domain Difficulty: Medicine, Science, and Banking proved most challenging due to complex schemas and specialized terminology. Aviation and Jurisprudence saw relatively higher scores, likely due to more regular schema structures.
- Schema Understanding: Models often correctly identified columns but struggled with table linking. The "Soft Execution Match" (41%) was significantly higher than the "Hard Execution Match" (28%), suggesting models often get the "what" right but the "where" wrong.
- Prompting Language: For global models like Gemini and GPT-4o, prompting in English often yielded better results for Russian tasks than prompting in Russian, suggesting stronger reasoning capabilities anchored in English training data.
Conclusion
RedSQL highlights the significant gap between academic Text-to-SQL performance and real-world industrial needs. The benchmark serves as a "gold standard" for evaluating domain-specific performance in Russian. Future work should focus on domain adaptation—fine-tuning models specifically on industrial schemas—and improving multilingual prompting strategies to bridge the gap between user language and model reasoning.
Benchmark available at: https://github.com/BrodskaiaIrina/functional-text2sql-subsets
Summary updated