Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction

About

There is currently a significant gap between the performance of fine-tuned models and prompting approaches using Large Language Models (LLMs) on the challenging task of text-to-SQL, as evaluated on datasets such as Spider. To improve the performance of LLMs in the reasoning process, we study how decomposing the task into smaller sub-tasks can be effective. In particular, we show that breaking down the generation problem into sub-problems and feeding the solutions of those sub-problems into LLMs can be an effective approach for significantly improving their performance. Our experiments with three LLMs show that this approach consistently improves their simple few-shot performance by roughly 10%, pushing the accuracy of LLMs towards SOTA or surpassing it. On the holdout test set of Spider, the SOTA, in terms of execution accuracy, was 79.9 and the new SOTA at the time of this writing using our approach is 85.3. Our approach with in-context learning beats many heavily fine-tuned models by at least 5%. Additionally, when evaluated on the BIRD benchmark, our approach achieved an execution accuracy of 55.9%, setting a new SOTA on its holdout test set.

Mohammadreza Pourreza, Davood Rafiei• 2023

Related benchmarks

TaskDatasetResultRank
Text-to-SQLBIRD (dev)
Execution Accuracy (EA)61.28
477
Text-to-SQLSpider (test)
Execution Accuracy85.3
256
Text-to-SQLSpider (dev)
EX83.14
196
Text-to-SQLSpider
Exec Acc (All)79.3
139
Text-to-SQLSpider-DK
Execution Accuracy (EX)64.3
136
Text-to-SQLSpider-Syn
Execution Accuracy (EX)65.3
120
Text-to-SQLSpider 1.0 (test)
EM Acc (Overall)85.3
110
Text-to-SQLSpider 1.0 (dev)
Exact Match Accuracy82.8
92
Text-to-SQLBird
Execution Accuracy (EX)54.8
83
Text-to-SQLBird
Total Execution Accuracy55.9
68
Showing 10 of 36 rows

Other info

Code

Follow for update