HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation

Dawei Gao Haibin Wang Yaliang Li Xiuyu Sun Yichen Qian Bolin Ding Jingren Zhou

Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation

Abstract

Large language models (LLMs) have emerged as a new paradigm for Text-to-SQL task. However, the absence of a systematical benchmark inhibits the development of designing effective, efficient and economic LLM-based Text-to-SQL solutions. To address this challenge, in this paper, we first conduct a systematical and extensive comparison over existing prompt engineering methods, including question representation, example selection and example organization, and with these experimental results, we elaborate their pros and cons. Based on these findings, we propose a new integrated solution, named DAIL-SQL, which refreshes the Spider leaderboard with 86.6% execution accuracy and sets a new bar. To explore the potential of open-source LLM, we investigate them in various scenarios, and further enhance their performance with supervised fine-tuning. Our explorations highlight open-source LLMs' potential in Text-to-SQL, as well as the advantages and disadvantages of the supervised fine-tuning. Additionally, towards an efficient and economic LLM-based Text-to-SQL solution, we emphasize the token efficiency in prompt engineering and compare the prior studies under this metric. We hope that our work provides a deeper understanding of Text-to-SQL with LLMs, and inspires further investigations and broad applications.

Code Repositories

beachwang/dail-sql
Official
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
text-to-sql-on-bird-big-bench-for-large-scaleDAIL-SQL + GPT-4
Execution Accuracy % (Dev): 54.76
Execution Accuracy % (Test): 57.41
text-to-sql-on-spiderDAIL-SQL + GPT-4 + Self-Consistency
Exact Match Accuracy (Dev): 74.4
Execution Accuracy (Dev): 84.4
Execution Accuracy (Test): 86.6

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp