How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settings

Shuaichen Chang, Eric Fosler-Lussier
5/19/2023
cs.CL

No official code found. Best implementation: shuaichenchang/prompt-text-to-sql (29 stars, Apache-2.0, last commit 2023-08-18). 1 more below.

Abstract

Large language models (LLMs) with in-context learning have demonstrated remarkable capability in the text-to-SQL task. Previous research has prompted LLMs with various demonstration-retrieval strategies and intermediate reasoning steps to enhance the performance of LLMs. However, those works often employ varied strategies when constructing the prompt text for text-to-SQL inputs, such as databases and demonstration examples. This leads to a lack of comparability in both the prompt constructions and their primary contributions. Furthermore, selecting an effective prompt construction has emerged as a persistent problem for future research. To address this limitation, we comprehensively investigate the impact of prompt constructions across various settings and provide insights into prompt constructions for future text-to-SQL studies.

View on arXivView PDF

Code Implementations(2)

Apache-2.0
293Python, JavaScriptApr 28, 20233 years agoApache-2.0

An implementation of the Natural Language LM prompting techniques from Chang, Shuaichen, and Eric Fosler-Lussier. "How to prompt llms for text-to-sql: A study in zero-shot, single-domain, and cross-domain settings.".

10PythonSep 26, 20251 years ago

Similar Papers

Cite this paper

@article{chang2023prompt,
  title  = {How to Prompt LLMs for Text-to-SQL: A Study in Zero-shot, Single-domain, and Cross-domain Settings},
  author = {Shuaichen Chang and Eric Fosler-Lussier},
  year   = {2023},
  eprint = {2305.11853},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.11853v3}
}

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/2305.11853.svg)](https://codeofpaper.com/paper/2305.11853)

Discussion