# SQL-PaLM: Improved Large Language ModelAdaptation for Text-to-SQL

**Authors:** Ruoxi Sun, Sercan O Arik, Hootan Nakhost, Hanjun Dai, Rajarishi Sinha, Pengcheng Yin, Tomas Pfister  
**arXiv:** [2306.00739](https://arxiv.org/abs/2306.00739)  
**Date:** 2023-05-26  
**Summary page:** https://www.summarizepaper.com/en/paper/2306.00739v1/

## Key points

- Large Language Models (LLMs) have enabled impressive capabilities, including the generation of Structured Query Language (SQL) code for databases.
- Adaptation of LLMs is crucial in both in-context learning and fine-tuning settings for converting natural language text to SQL queries (Text-to-SQL).
- A new LLM based Text-to-SQL model called SQL-PaLM is proposed, leveraging on PaLM2 to push the state of the art in both settings.
- The few shot SQL PaLM model achieves 77.3% test suite accuracy on Spider dataset which outperforms previous state of the art with fine tuning by a significant margin of 4%.
- Fine tuned SQL PALM outperforms it further by another 1%.
- SQL PaLM demonstrates superior generalization capability when evaluated on other challenging variants of Spider dataset.
- Extensive case studies demonstrate impressive intelligent capabilities and various success enablers of LLM based Text to SQL.

## Summary

The emergence of Large Language Models (LLMs) has enabled impressive capabilities, including the generation of Structured Query Language (SQL) code for databases. For the task of converting natural language text to SQL queries (Text-to-SQL), adaptation of LLMs is crucial in both in-context learning and fine-tuning settings depending on the amount of adaptation data used. In this paper titled "SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL," a new LLM based Text-to-SQL model called SQL-PaLM is proposed, leveraging on PaLM2 to push the state of the art in both settings. The few shot SQL PaLM model is based on an execution based self consistency prompting approach designed for Text to SQL and achieves 77.3% test suite accuracy on Spider dataset which outperforms previous state of the art with fine tuning by a significant margin of 4%. Furthermore, it is demonstrated that fine tuned SQL PALM outperforms it further by another 1%. To apply SQL PaLM to real world scenarios its robustness is evaluated on other challenging variants of Spider dataset and demonstrates superior generalization capability. Additionally, extensive case studies demonstrate impressive intelligent capabilities and various success enablers of LLM based Text to SQL. The authors behind this research are Ruoxi Sun, Sercan O Arik, Hootan Nakhost, Hanjun Dai, Rajarishi Sinha, Pengcheng Yin and Tomas Pfister.
