Lune

VLDB2023顶会

CatSQL: Towards Real World Natural Language to SQL Applications

Han Fu, Chang Liu, Bin Wu, Feifei Li, Jian Tan, Jianling Sun

摘要

Natural language to SQL (NL2SQL) techniques provide a convenient interface to access databases, especially for non-expert users, to conduct various data analytics. Existing methods often employ either a rule-base approach or a deep learning based solution. The former is hard to generalize across different domains. Though the latter generalizes well, it often results in queries with syntactic or semantic errors, thus may be even not executable. In this work, we bridge the gap between the two and design a new framework to significantly improve both accuracy and runtime. In particular, we develop a novel CatSQL sketch, which constructs a template with slots that initially serve as placeholders, and tightly integrates with a deep learning model to fill in these slots with meaningful contents based on the database schema. Compared with the widely used sequence-to-sequence-based approaches, our sketch-based method does not need to generate keywords which are boilerplates in the template, and can achieve better accuracy and run much faster. Compared with the existing sketch-based approaches, our CatSQL sketch is more general and versatile, and can leverage the values already filled in on certain slots to derive the rest ones for improved performance. In addition, we propose the Semantics Correction technique, which is the first that leverages database domain knowledge in a deep learning based NL2SQL solution. Semantics Correction is a post-processing routine, which checks the initially generated SQL queries by applying rules to identify and correct semantic errors. This technique significantly improves the NL2SQL accuracy. We conduct extensive evaluations on both single-domain and cross-domain benchmarks and demonstrate that our approach significantly outperforms the previous ones in terms of both accuracy and throughput. In particular, on the state-of-the-art NL2SQL benchmark Spider, our CatSQL prototype outperforms the best of the previous solutions by 4 points on accuracy, while still achieving a throughput up to 63 times higher.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 24 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale 引用了 GraPPa: Grammar-Augmented Pre-Training for Table Semantic Parsing
  • OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale 引用了 CodeS: Towards Building Open-source Language Models for Text-to-SQL
  • PURPLE: Making a Large Language Model a Better SQL Writer 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • PURPLE: Making a Large Language Model a Better SQL Writer 引用了 BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
  • PURPLE: Making a Large Language Model a Better SQL Writer 引用了 Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
  • GraPPa: Grammar-Augmented Pre-Training for Table Semantic Parsing 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • GraPPa: Grammar-Augmented Pre-Training for Table Semantic Parsing 引用了 BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
  • Natural SQL: Making SQL Easier to Infer from Natural Language Specifications 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning 引用了 OmniSQL: Synthesizing High-quality Text-to-SQL Data at Scale
  • SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning 引用了 PURPLE: Making a Large Language Model a Better SQL Writer
  • SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning 引用了 Natural SQL: Making SQL Easier to Infer from Natural Language Specifications
  • SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learning 引用了 CodeS: Towards Building Open-source Language Models for Text-to-SQL
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parsers
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
  • CodeS: Towards Building Open-source Language Models for Text-to-SQL 引用了 GraPPa: Grammar-Augmented Pre-Training for Table Semantic Parsing
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper24

  1. CodeS: Towards Building Open-source Language Models for Text-to-SQLHaoyang Li, Jing Zhang, Hanbing Liu, Ju Fan 等SIGMOD 2024 · 124 次引用
  2. SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement LearningPeixian Ma, Xialie Zhuang, Chengjin Xu, Xuhui Jiang 等NeurIPS 2025 · 94 次引用
  3. OmniSQL: Synthesizing High-quality Text-to-SQL Data at ScaleHaoyang Li, Shang Wu, Xiaokang Zhang, Xinmei Huang 等VLDB 2025 · 90 次引用
  4. LLM-PBE: Assessing Data Privacy in Large Language ModelsQinbin Li, Junyuan Hong, Chulin Xie, Jeffrey Tan 等VLDB 2024 · 66 次引用
  5. PURPLE: Making a Large Language Model a Better SQL WriterTonghui Ren, Yuankai Fan, Zhenying He, Ren Huang 等ICDE 2024 · 49 次引用

它引用的 Paper10

  1. BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad 等ACL 2020 · 1,224 次引用
  2. ELECTRA: Pre-training Text Encoders as Discriminators Rather Than GeneratorsKevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. ManningICLR 2020 · 541 次引用
  3. Natural SQL: Making SQL Easier to Infer from Natural Language SpecificationsYujian Gan, Xinyun Chen, Jinxia Xie, Matthew Purver 等EMNLP Findings 2021 · 88 次引用
  4. GraPPa: Grammar-Augmented Pre-Training for Table Semantic ParsingTao Yu, Chien-Sheng Wu, Xi Victoria Lin, Bailin Wang 等ICLR 2021 · 59 次引用
  5. RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL ParsersBailin Wang, Richard Shin, Xiaodong Liu, Oleksandr Polozov 等ACL 2020 · 39 次引用

相关 Paper

  1. Natural language to SQL: Where are we today?Hyeonji Kim, Byeong-Hoon So, Wook-Shin Han, Hongrae LeeVLDB 2020 · 148 次引用
  2. DBTagger: Multi-Task Learning for Keyword Mapping in NLIDBs Using Bi-Directional Recurrent Neural NetworksArif Usta, Akifhan Karakayali, Özgür UlusoyVLDB 2021 · 12 次引用
  3. UCS-SQL: Uniting Content and Structure for Enhanced Semantic Bridging In Text-to-SQLZhenhe Wu, Zhongqiu Li, Jie Zhang, Zhongjiang He 等ACL Findings 2025 · 4 次引用
  4. DBPal: A Fully Pluggable NL2SQL Training PipelineNathaniel Weir, Prasetya Ajie Utama, Alex Galakatos, Andrew Crotty 等SIGMOD 2020 · 36 次引用
  5. SQLens: An End-to-End Framework for Error Detection and Correction in Text-to-SQLYue Gong, Chuan Lei, Xiao Qin, Kapil Vaidya 等NeurIPS 2025 · 21 次引用
黄昏的海面,两侧是细线勾勒的悬崖