PET-SQL: A Prompt-enhanced Two-stage Text-to-SQL Framework with Cross-consistency

要約

Text-to-SQL (Text2SQL) の最近の進歩は、コンテキスト内学習における大規模言語モデル (LLM) の刺激に重点を置き、重要な結果を達成しています。
それにもかかわらず、冗長なデータベース情報と複雑なユーザーの意図を扱う際には課題に直面します。
このペーパーでは、SQL システムに対する現在の LLM ベースの自然言語のパフォーマンスを強化するための 2 段階のフレームワークを紹介します。
まず、参照拡張表現と呼ばれる新しいプロンプト表現を導入します。これには、LLM に SQL クエリの生成を指示するためのスキーマ情報とテーブルからランダムにサンプリングされたセル値が含まれます。
次に、最初の段階で、質問と SQL のペアが少数のショットのデモンストレーションとして取得され、LLM に予備 SQL (PreSQL) の生成を促します。
その後、PreSQL 内の前述のエンティティが解析されてスキーマ リンクが実行され、有用な情報を大幅に圧縮できます。
第 2 段階では、リンクされたスキーマを使用して、プロンプトのスキーマ情報を簡素化し、LLM に最終 SQL を生成するように指示します。
最後に、洗練後のモジュールとして、特定の LLM 内での自己整合性ではなく、異なる LLM 間の相互整合性を使用することを提案します。
私たちのメソッドは、Spider ベンチマークで 87.6% の実行精度で新しい SOTA 結果を達成しました。

要約(オリジナル)

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%.

arxiv情報

著者 Zhishuai Li,Xiang Wang,Jingjing Zhao,Sun Yang,Guoqing Du,Xiaoru Hu,Bin Zhang,Yuxiao Ye,Ziyue Li,Rui Zhao,Hangyu Mao
発行日 2024-03-18 12:45:41+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL パーマリンク