Pi-SQL: Enhancing Text-to-SQL with Fine-Grained Guidance from Pivot Programming Languages
Yongdong chi, Hanqing Wang, Zonghan Yang, Jian Yang, Xiao Yan, Yun Chen, Guanhua Chen

TL;DR
Pi-SQL introduces a novel approach that uses high-resource Python programs as an intermediary to improve the accuracy and efficiency of natural language to SQL translation, outperforming existing methods.
Contribution
The paper presents Pi-SQL, a method that leverages Python as a pivot language to generate more accurate and efficient SQL queries from natural language.
Findings
Achieves up to 3.20% higher execution accuracy than baseline.
Improves valid efficiency score by up to 4.55.
Demonstrates effectiveness through extensive experiments.
Abstract
Text-to-SQL transforms the user queries from natural language to executable SQL programs, enabling non-experts to interact with complex databases. Existing prompt-based methods craft meticulous text guidelines and examples to facilitate SQL generation, but their accuracy is hindered by the large semantic gap between the texts and the low-resource SQL programs. In this work, we propose Pi-SQL, which incorporates the high-resource Python program as a pivot to bridge between the natural language query and SQL program. In particular, Pi-SQL first generates Python programs that provide fine-grained step-by-step guidelines in their code blocks or comments, and then produces an SQL program following the guidance of each Python program. The final SQL program matches the reference Python program's query results and, through selection from candidates generated by different strategies, achieves…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsDistributed and Parallel Computing Systems · Logic, programming, and type systems
