CHESS: Contextual Harnessing for Efficient SQL Synthesis

要約

自然言語の質問を SQL クエリ (テキストから SQL) に変換するために大規模言語モデル (LLM) を利用することは、特に複雑で広範なスキーマを持つ現実世界のデータベースに適用する場合、有望ではありますが、困難なアプローチです。
特に、データ カタログとデータベース値を SQL 生成に効果的に組み込むことは依然として障害となり、次善のソリューションにつながります。
私たちは、関連するデータとコンテキストを効果的に取得し、効率的なスキーマを選択し、正しく効率的な SQL クエリを合成する新しいパイプラインを提案することで、この問題に対処します。
検索精度を高めるために、当社のパイプラインでは、モデル生成キーワード、局所性を考慮したハッシュ インデックス、ベクトル データベースを活用した階層型検索手法を導入しています。
さらに、問題の複雑さとモデルのコンテキスト サイズに基づいて調整する適応型スキーマ プルーニング手法を開発しました。
私たちのアプローチは、GPT-4 などのフロンティア独自モデルと Llama-3-70B などのオープンソース モデルの両方に一般化されています。
一連のアブレーション研究を通じて、当社のパイプラインの各コンポーネントの有効性と、それがエンドツーエンドのパフォーマンスに及ぼす影響を実証します。
私たちの手法は、クロスドメインの挑戦的な BIRD データセット上で新しい最先端のパフォーマンスを実現します。

要約(オリジナル)

Utilizing large language models (LLMs) for transforming natural language questions into SQL queries (text-to-SQL) is a promising yet challenging approach, particularly when applied to real-world databases with complex and extensive schemas. In particular, effectively incorporating data catalogs and database values for SQL generation remains an obstacle, leading to suboptimal solutions. We address this problem by proposing a new pipeline that effectively retrieves relevant data and context, selects an efficient schema, and synthesizes correct and efficient SQL queries. To increase retrieval precision, our pipeline introduces a hierarchical retrieval method leveraging model-generated keywords, locality-sensitive hashing indexing, and vector databases. Additionally, we have developed an adaptive schema pruning technique that adjusts based on the complexity of the problem and the model’s context size. Our approach generalizes to both frontier proprietary models like GPT-4 and open-source models such as Llama-3-70B. Through a series of ablation studies, we demonstrate the effectiveness of each component of our pipeline and its impact on the end-to-end performance. Our method achieves new state-of-the-art performance on the cross-domain challenging BIRD dataset.

arxiv情報

著者 Shayan Talaei,Mohammadreza Pourreza,Yu-Chen Chang,Azalia Mirhoseini,Amin Saberi
発行日 2024-06-27 17:13:32+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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