# Automatic Metadata Extraction for Text-to-SQL

arXiv: https://arxiv.org/abs/2505.19988 · HTML: https://mlsanity.com/paper/2505.19988/

## Key facts

- Cited by 27 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 26 May 2025.

## Built on by (most cited first, 27 of 27)

- [A Survey of Data Agents: Emerging Paradigm or Overstated Hype?](https://mlsanity.com/paper/2510.23587/) (2025)
- [Agentar-Scale-SQL: Advancing Text-to-SQL through Orchestrated Test-Time Scaling](https://mlsanity.com/paper/2509.24403/) (2025)
- [SLM-SQL: An Exploration of Small Language Models for Text-to-SQL](https://mlsanity.com/paper/2507.22478/) (2025)
- [Text-to-SQL as Dual-State Reasoning: Integrating Adaptive Context and Progressive Generation](https://mlsanity.com/paper/2511.21402/) (2025)
- [APEX-SQL: Talking to the data via Agentic Exploration for Text-to-SQL](https://mlsanity.com/paper/2602.16720/) (2026)
- [SING-SQL: A Synthetic Data Generation Framework for In-Domain Text-to-SQL Translation](https://mlsanity.com/paper/2509.25672/) (2025)
- [RubikSQL: Lifelong Learning Agentic Knowledge Base as an Industrial NL2SQL System](https://mlsanity.com/paper/2508.17590/) (2025)
- [SpotIt: Evaluating Text-to-SQL Evaluation with Formal Verification](https://mlsanity.com/paper/2510.26840/) (2025)
- [BenchPress: A Human-in-the-Loop Annotation System for Rapid Text-to-SQL Benchmark Curation](https://mlsanity.com/paper/2510.13853/) (2025)
- [RoboPhD: Self-Improving Text-to-SQL Through Autonomous Agent Evolution](https://mlsanity.com/paper/2601.01126/) (2026)
- [TRUST-SQL: Tool-Integrated Multi-Turn Reinforcement Learning for Text-to-SQL over Unknown Schemas](https://mlsanity.com/paper/2603.16448/) (2026)
- [ELT-Bench-Verified: Benchmark Quality Issues Underestimate AI Agent Capabilities](https://mlsanity.com/paper/2603.29399/) (2026)
- [Semantic Layers for Reliable LLM-Powered Data Analytics: A Paired Benchmark of Accuracy and Hallucination Across Three Frontier Models](https://mlsanity.com/paper/2604.25149/) (2026)
- [Node-Level Uncertainty Estimation in LLM-Generated SQL](https://mlsanity.com/paper/2511.13984/) (2025)
- [AGRO-SQL: Agentic Group-Relative Optimization with High-Fidelity Data Synthesis](https://mlsanity.com/paper/2512.23366/) (2025)
- [SteinerSQL: Graph-Guided Mathematical Reasoning for Text-to-SQL Generation](https://mlsanity.com/paper/2509.19623/) (2025)
- [HES-SQL: Hybrid Reasoning for Efficient Text-to-SQL with Structural Skeleton Guidance](https://mlsanity.com/paper/2510.08896/) (2025)
- [Continual Learning of Domain Knowledge from Human Feedback in Text-to-SQL](https://mlsanity.com/paper/2511.10674/) (2025)
- [Human-Level Text-to-SQL via Reinforcement Learning on Verified Data, Without Pipeline Engineering](https://mlsanity.com/paper/2603.20004/) (2026)
- [FGTR: Fine-Grained Multi-Table Retrieval via Hierarchical LLM Reasoning](https://mlsanity.com/paper/2603.12702/) (2026)
- [SODIUM: From Open Web Data to Queryable Databases](https://mlsanity.com/paper/2603.18447/) (2026)
- [Sophrosyne: Agentic Exploration of Relational Data Systems Needs Moderation](https://mlsanity.com/paper/2605.30862/) (2026)
- [Bootstrapping Semantic Layer from Execution for Text-to-SQL](https://mlsanity.com/paper/2606.05634/) (2026)
- [DexterSQL: Deep Schema Exploration and Rule-based Correction for Text-to-SQL Generation](https://mlsanity.com/paper/2608.11889/) (2026)
- [DualSQL: Text-to-SQL with Multi-Agent Reinforcement Learning](https://mlsanity.com/paper/2609.18135/) (2026)
- [AptMQL-Bench: From Text-to-SQL to Text-to-MQL via Access-Pattern Schema Design and Data-Preserving Migration](https://mlsanity.com/paper/2610.02770/) (2026)
- [ARCS: Towards Precise Text-to-SQL via Structured Disambiguation](https://mlsanity.com/paper/2610.09396/) (2026)

## Abstract (arXiv)

Large Language Models (LLMs) have recently become sophisticated enough to automate many tasks ranging from pattern finding to writing assistance to code generation. In this paper, we examine text-to-SQL generation. We have observed from decades of experience that the most difficult part of query development lies in understanding the database contents. These experiences inform the direction of our research. Text-to-SQL benchmarks such as SPIDER and Bird contain extensive metadata that is generally not available in practice. Human-generated metadata requires the use of expensive Subject Matter Experts (SMEs), who are often not fully aware of many aspects of their databases. In this paper, we explore techniques for automatic metadata extraction to enable text-to-SQL generation. We explore the use of two standard and one newer metadata extraction techniques: profiling, query log analysis, and SQL-to text generation using an LLM. We use BIRD benchmark [JHQY+23] to evaluate the effectiveness of these techniques. BIRD does not provide query logs on their test database, so we prepared a submission that uses profiling alone, and does not use any specially tuned model (we used GPT-4o). From Sept 1 to Sept 23, 2024, and Nov 11 through Nov 23, 2024 we achieved the highest score both with and without using the "oracle" information provided with the question set. We regained the number 1 spot on Mar 11, 2025, and are still at #1 at the time of the writing (May, 2025).
