Structure Guided Large Language Model for SQL Generation

要約

正確な構造化照会言語 (SQL) を生成することは長年にわたる問題であり、特にユーザーのセマンティック クエリを構造化データベースと照合して構造化 SQL を生成する場合に顕著です。
既存のモデルは通常、クエリとデータベース スキーマを LLM に入力し、LLM に依存して意味構造のマッチングを実行し、構造化 SQL を生成します。
ただし、このようなソリューションでは、構造化 SQL の生成を強化するために利用できるユーザー クエリやデータベース内の構造情報が見落とされます。
この見落としにより、SQL が不正確または実行不能になる可能性があります。
この構造を最大限に活用するために、固有の構造情報を活用して LLM の SQL 生成を改善する、構造から SQL へのフレームワークを提案します。
具体的には、Structure Guided SQL~(SGU-SQL) 生成モデルを紹介します。
SGU-SQL はまず、構造を強化した方法でユーザー クエリとデータベースをリンクします。
次に、文法ツリーを使用して複雑なリンク構造を分解し、LLM が SQL を段階的に生成できるようにします。
2 つのベンチマーク データセットに対する広範な実験により、SGU-SQL が 16 の SQL 生成ベースラインを上回るパフォーマンスを発揮できることが示されています。

要約(オリジナル)

Generating accurate Structured Querying Language (SQL) is a long-standing problem, especially in matching users’ semantic queries with structured databases and then generating structured SQL. Existing models typically input queries and database schemas into the LLM and rely on the LLM to perform semantic-structure matching and generate structured SQL. However, such solutions overlook the structural information within user queries and databases, which can be utilized to enhance the generation of structured SQL. This oversight can lead to inaccurate or unexecutable SQL generation. To fully exploit the structure, we propose a structure-to-SQL framework, which leverages the inherent structure information to improve the SQL generation of LLMs. Specifically, we introduce our Structure Guided SQL~(SGU-SQL) generation model. SGU-SQL first links user queries and databases in a structure-enhanced manner. It then decomposes complicated linked structures with grammar trees to guide the LLM to generate the SQL step by step. Extensive experiments on two benchmark datasets illustrate that SGU-SQL can outperform sixteen SQL generation baselines.

arxiv情報

著者 Qinggang Zhang,Junnan Dong,Hao Chen,Wentao Li,Feiran Huang,Xiao Huang
発行日 2024-03-27 14:30:44+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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