Interleaving Pre-Trained Language Models and Large Language Models for Zero-Shot NL2SQL Generation

06/15/2023
by   Zihui Gu, et al.
0

Zero-shot NL2SQL is crucial in achieving natural language to SQL that is adaptive to new environments (e.g., new databases, new linguistic phenomena or SQL structures) with zero annotated NL2SQL samples from such environments. Existing approaches either fine-tune pre-trained language models (PLMs) based on annotated data or use prompts to guide fixed large language models (LLMs) such as ChatGPT. PLMs can perform well in schema alignment but struggle to achieve complex reasoning, while LLMs is superior in complex reasoning tasks but cannot achieve precise schema alignment. In this paper, we propose a ZeroNL2SQL framework that combines the complementary advantages of PLMs and LLMs for supporting zero-shot NL2SQL. ZeroNL2SQL first uses PLMs to generate an SQL sketch via schema alignment, then uses LLMs to fill the missing information via complex reasoning. Moreover, in order to better align the generated SQL queries with values in the given database instances, we design a predicate calibration method to guide the LLM in completing the SQL sketches based on the database instances and select the optimal SQL query via an execution-based strategy. Comprehensive experiments show that ZeroNL2SQL can achieve the best zero-shot NL2SQL performance on real-world benchmarks. Specifically, ZeroNL2SQL outperforms the state-of-the-art PLM-based methods by 3.2 LLM-based methods by 10

READ FULL TEXT

page 7

page 11

research
07/14/2023

C3: Zero-shot Text-to-SQL with ChatGPT

This paper proposes a ChatGPT-based zero-shot Text-to-SQL method, dubbed...
research
09/05/2023

Automatic Data Transformation Using Large Language Model: An Experimental Study on Building Energy Data

Existing approaches to automatic data transformation are insufficient to...
research
06/06/2023

ChatDB: Augmenting LLMs with Databases as Their Symbolic Memory

Large language models (LLMs) with memory are computationally universal. ...
research
10/12/2022

Zero-Shot On-the-Fly Event Schema Induction

What are the events involved in a pandemic outbreak? What steps should b...
research
10/19/2022

N-Best Hypotheses Reranking for Text-To-SQL Systems

Text-to-SQL task maps natural language utterances to structured queries ...
research
04/02/2023

Querying Large Language Models with SQL

In many use-cases, information is stored in text but not available in st...
research
08/29/2019

Global Reasoning over Database Structures for Text-to-SQL Parsing

State-of-the-art semantic parsers rely on auto-regressive decoding, emit...

Please sign up or login with your details

Forgot password? Click here to reset