SQL-PaLM:テキストからSQLへの大規模言語モデル適応の改善
SQL-PaLM: Improved Large Language ModelAdaptation for Text-to-SQL
May 26, 2023
著者: Ruoxi Sun, Sercan O Arik, Hootan Nakhost, Hanjun Dai, Rajarishi Sinha, Pengcheng Yin, Tomas Pfister
cs.AI
要旨
大規模言語モデル(LLM)の印象的な創発的能力の一つに、データベース用の構造化照会言語(SQL)を含むコード生成があります。自然言語テキストからSQLクエリへの変換タスクであるText-to-SQLにおいて、LLMの適応は、使用される適応データの量に応じて、インコンテキスト学習とファインチューニングの両方の設定で極めて重要です。本論文では、PaLM-2を活用したLLMベースのText-to-SQLモデルであるSQL-PaLMを提案し、両方の設定で最先端を押し上げます。Few-shot SQL-PaLMは、Text-to-SQL用に設計された実行ベースの自己一貫性プロンプティングアプローチに基づいており、Spiderデータセットにおいてテストスイート精度で77.3%を達成します。これは、私たちの知る限り、ファインチューニングによる従来の最先端を4%という大きな差で上回る初めての成果です。さらに、ファインチューニングされたSQL-PaLMがそれをさらに1%上回ることを示します。SQL-PaLMを実世界のシナリオに適用するために、Spiderの他の挑戦的なバリエーションでの堅牢性をさらに評価し、SQL-PaLMの優れた一般化能力を実証します。加えて、広範なケーススタディを通じて、LLMベースのText-to-SQLの印象的な知的能力とさまざまな成功要因を実証します。
English
One impressive emergent capability of large language models (LLMs) is
generation of code, including Structured Query Language (SQL) for databases.
For the task of converting natural language text to SQL queries, Text-to-SQL,
adaptation of LLMs is of paramount importance, both in in-context learning and
fine-tuning settings, depending on the amount of adaptation data used. In this
paper, we propose an LLM-based Text-to-SQL model SQL-PaLM, leveraging on
PaLM-2, that pushes the state-of-the-art in both settings. Few-shot SQL-PaLM is
based on an execution-based self-consistency prompting approach designed for
Text-to-SQL, and achieves 77.3% in test-suite accuracy on Spider, which to our
best knowledge is the first to outperform previous state-of-the-art with
fine-tuning by a significant margin, 4%. Furthermore, we demonstrate that the
fine-tuned SQL-PALM outperforms it further by another 1%. Towards applying
SQL-PaLM to real-world scenarios we further evaluate its robustness on other
challenging variants of Spider and demonstrate the superior generalization
capability of SQL-PaLM. In addition, via extensive case studies, we demonstrate
the impressive intelligent capabilities and various success enablers of
LLM-based Text-to-SQL.