SQLPrompt: In-Context Text-to-SQL with Minimal Labeled Data

Ruoxi Sun, Sercan Ö. Arik, Rajarishi Sinha, Hootan Nakhost, Hanjun Dai +2 more
11/6/2023
cs.CL

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Text-to-SQL aims to automate the process of generating SQL queries on a database from natural language text. In this work, we propose "SQLPrompt", tailored to improve the few-shot prompting capabilities of Text-to-SQL for Large Language Models (LLMs). Our methods include innovative prompt design, execution-based consistency decoding strategy which selects the SQL with the most consistent execution outcome among other SQL proposals, and a method that aims to improve performance by diversifying the SQL proposals during consistency selection with different prompt designs ("MixPrompt") and foundation models ("MixLLMs"). We show that \emph{SQLPrompt} outperforms previous approaches for in-context learning with few labeled data by a large margin, closing the gap with finetuning state-of-the-art with thousands of labeled data.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{sun2023sqlprompt,
  title  = {SQLPrompt: In-Context Text-to-SQL with Minimal Labeled Data},
  author = {Ruoxi Sun and Sercan Ö. Arik and Rajarishi Sinha and Hootan Nakhost and Hanjun Dai and Pengcheng Yin and Tomas Pfister},
  year   = {2023},
  eprint = {2311.02883},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.02883v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.02883.svg)](https://codeofpaper.com/paper/2311.02883)

Discussion