SNAILS: Schema Naming Assessments for Improved LLM-Based SQL Inference
Kyle Luoma, Arun Kumar
摘要
Large Language Models (LLMs) have revolutionized Natural Language to SQL (NL-to-SQL), dominating most NL-to-SQL benchmarks. But LLMs still face limitations due to hallucinations, semantic ambiguity, and lexical mismatches between an NL query and the database schema. Naturally, a lot of work in the ML+DB intersection aims to mitigate such LLM limitations. In this work, we shine the light on a complementary data-centric question: How should DB schemas evolve in this era of LLMs to boost NL-to-SQL? The intuition is that more NL-friendly schema identifiers can help LLMs work better with DBs. We dive deeper into this seemingly obvious, but hitherto underexplored and important, connection between schema identifier ''naturalness'' and the behavior of LLM-based NL-to-SQL by creating a new integrated benchmark suite we call SNAILS. SNAILS has 4 novel artifacts: (1) A collection of real-world DB schemas not present in prior NL-to-SQL benchmarks; (2) A set of labeled NL-SQL query pairs on our collection not seen before by public LLMs; (3) A notion of naturalness level for schema identifiers and a novel labeled dataset of modified identifiers; and (4) AI artifacts to automatically modify identifier naturalness. Using SNAILS, we perform a comprehensive empirical evaluation of the impact of schema naturalness on LLM-based NL-to-SQL accuracy, and present a method for improving LLM-based NL-to-SQL with natural views. Our results reveal statistically significant correlations across multiple public LLMs from OpenAI, Meta, and Google on multiple databases using both zero-shot prompting as well as more complex NL-to-SQL workflows: DIN SQL, and CodeS. We present several fine-grained insights and discuss pathways for DB practitioners to better exploit LLMs for NL-to-SQL.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL 引用了 Exploring Unexplored Generalization Challenges for Cross-Database Semantic Parsing
- TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database Queries 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database Queries 引用了 CodeS: Towards Building Open-source Language Models for Text-to-SQL
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning 引用了 RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning 引用了 Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence Reasoning 引用了 CodeS: Towards Building Open-source Language Models for Text-to-SQL
- A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema Databases 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema Databases 引用了 CodeS: Towards Building Open-source Language Models for Text-to-SQL
- Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation 引用了 RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
- Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL
- CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction
- CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
- Accurate Table Question Answering with Accessible LLMs 引用了 Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation
引用它的顶会 Paper7
- DIVER: A Robust Text-to-SQL System with Dynamic Interactive Value Linking and Evidence ReasoningYafeng Nan, Haifeng Sun, Zirui Zhuang, Qi Qi 等SIGMOD 2026 · 3 次引用
- ScaleDoc: Scaling LLM-based Predicates over Large Document CollectionsHengrui Zhang, Yulong Hui, Yihao Liu, Huanchen ZhangSIGMOD 2026 · 2 次引用
- TACO: A Benchmark for Open-Domain Text-to-SQL with Ambiguous and Cross-Database QueriesChao Deng, Ju Fan, Yuyu Luo, Qinliang Xue 等VLDB 2026 · 1 次引用
- Accurate Table Question Answering with Accessible LLMsYangfan Jiang, Fei Wei, Ergute Bao, Yaliang Li 等ICDE 2026 · 1 次引用
- A Comparative Evaluation of Schema Subsetting for LLM-based NL-to-SQL over Large-Schema DatabasesKyle Luoma, Arun KumarVLDB 2026
它引用的 Paper12
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 次引用
- Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun 等VLDB 2024 · 609 次引用
- RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQLHaoyang Li, Jing Zhang, Cuiping Li, Hong ChenAAAI 2023 · 343 次引用
- CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan 等SIGMOD 2024 · 124 次引用
- Exploring Unexplored Generalization Challenges for Cross-Database Semantic ParsingAlane Suhr, Ming-Wei Chang, Peter Shaw, Kenton LeeACL 2020 · 76 次引用
相关 Paper
- NL2SQLBench: A Modular Benchmarking Framework for LLM-Enabled NL2SQL SolutionsShizheng Hou, Wenqi Pei, Nuo Chen, Quang-Trung Ta 等VLDB 2026 · 1 次引用
- EVOSCHEMA: TOWARDS TEXT-TO-SQL ROBUSTNESS AGAINST SCHEMA EVOLUTIONTianshu Zhang, Kun Qian, Siddhartha Sahai, Yuan Tian 等VLDB 2025 · 3 次引用
- SPENCE: A Syntactic Probe for Detecting Contamination in NL2SQL BenchmarksMohammadtaher Safarzadeh, Hitesh Laxmichand Patel, Afshin Oroojlooy, Graham Horwood 等ACL 2026
- Validating LLM-Generated SQL Queries through Metamorphic PromptingLi Lin, Qinglin Zhu, Jintai Hong, Chong Wang 等FSE 2026
- The Power of Constraints in Natural Language to SQL TranslationTonghui Ren, Chen Ke, Yuankai Fan, Yinan Jing 等VLDB 2025 · 4 次引用
