Enregistré dans:
Détails bibliographiques
Auteurs principaux: Li, Zhishuai, Wang, Xiang, Zhao, Jingjing, Yang, Sun, Du, Guoqing, Hu, Xiaoru, Zhang, Bin, Ye, Yuxiao, Li, Ziyue, Zhao, Rui, Mao, Hangyu
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:https://arxiv.org/abs/2403.09732
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910466758934528
author Li, Zhishuai
Wang, Xiang
Zhao, Jingjing
Yang, Sun
Du, Guoqing
Hu, Xiaoru
Zhang, Bin
Ye, Yuxiao
Li, Ziyue
Zhao, Rui
Mao, Hangyu
author_facet Li, Zhishuai
Wang, Xiang
Zhao, Jingjing
Yang, Sun
Du, Guoqing
Hu, Xiaoru
Zhang, Bin
Ye, Yuxiao
Li, Ziyue
Zhao, Rui
Mao, Hangyu
contents Recent advancements in Text-to-SQL (Text2SQL) emphasize stimulating the large language models (LLM) on in-context learning, achieving significant results. Nevertheless, they face challenges when dealing with verbose database information and complex user intentions. This paper presents a two-stage framework to enhance the performance of current LLM-based natural language to SQL systems. We first introduce a novel prompt representation, called reference-enhanced representation, which includes schema information and randomly sampled cell values from tables to instruct LLMs in generating SQL queries. Then, in the first stage, question-SQL pairs are retrieved as few-shot demonstrations, prompting the LLM to generate a preliminary SQL (PreSQL). After that, the mentioned entities in PreSQL are parsed to conduct schema linking, which can significantly compact the useful information. In the second stage, with the linked schema, we simplify the prompt's schema information and instruct the LLM to produce the final SQL. Finally, as the post-refinement module, we propose using cross-consistency across different LLMs rather than self-consistency within a particular LLM. Our methods achieve new SOTA results on the Spider benchmark, with an execution accuracy of 87.6%.
format Preprint
id arxiv_https___arxiv_org_abs_2403_09732
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
Li, Zhishuai
Wang, Xiang
Zhao, Jingjing
Yang, Sun
Du, Guoqing
Hu, Xiaoru
Zhang, Bin
Ye, Yuxiao
Li, Ziyue
Zhao, Rui
Mao, Hangyu
Computation and Language
Artificial Intelligence
Recent advancements in Text-to-SQL (Text2SQL) emphasize stimulating the large language models (LLM) on in-context learning, achieving significant results. Nevertheless, they face challenges when dealing with verbose database information and complex user intentions. This paper presents a two-stage framework to enhance the performance of current LLM-based natural language to SQL systems. We first introduce a novel prompt representation, called reference-enhanced representation, which includes schema information and randomly sampled cell values from tables to instruct LLMs in generating SQL queries. Then, in the first stage, question-SQL pairs are retrieved as few-shot demonstrations, prompting the LLM to generate a preliminary SQL (PreSQL). After that, the mentioned entities in PreSQL are parsed to conduct schema linking, which can significantly compact the useful information. In the second stage, with the linked schema, we simplify the prompt's schema information and instruct the LLM to produce the final SQL. Finally, as the post-refinement module, we propose using cross-consistency across different LLMs rather than self-consistency within a particular LLM. Our methods achieve new SOTA results on the Spider benchmark, with an execution accuracy of 87.6%.
title PET-SQL: A Prompt-Enhanced Two-Round Refinement of Text-to-SQL with Cross-consistency
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2403.09732