MAC-SQL: A Multi-Agent Collaborative Framework for Text-to-SQL

要約

最近の LLM ベースの Text-to-SQL メソッドは通常、「巨大な」データベースや複数ステップの推論を必要とする複雑なユーザーの質問で大幅なパフォーマンスの低下に悩まされます。
さらに、既存の手法のほとんどは、外部ツールやモデルのコラボレーションを利用する LLM の重要な重要性を無視しています。
これらの課題に対処するために、新しい LLM ベースのマルチエージェント協調フレームワークである MAC-SQL を導入します。
私たちのフレームワークは、少数ショットの思考連鎖推論を備えた Text-to-SQL 生成のためのコア分解エージェントと、外部ツールまたはモデルを利用してより小さなサブデータベースを取得し、誤った SQL クエリを改良する 2 つの補助エージェントで構成されています。
デコンポーザー エージェントは補助エージェントと連携します。これらのエージェントは必要に応じてアクティブ化され、効果的な Text-to-SQL 解析のための新しい機能やツールに対応するように拡張できます。
私たちのフレームワークでは、最初に GPT-4 をすべてのエージェント タスクの強力なバックボーン LLM として利用して、フレームワークの上限を決定します。
次に、Code Llama 7B を活用してオープンソースの命令追従モデル SQL-Llama を微調整し、GPT-4 と同様にすべてのタスクを実行します。
実験によると、バニラ GPT-4 のベースライン精度 46.35 と比較して、SQL-Llama は同等の実行精度 43.94 を達成します。
この記事の執筆時点では、MAC-SQL+GPT-4 は BIRD ベンチマークで評価すると 59.59 の実行精度を達成し、そのホールドアウト テスト セット (https://github) で新しい最先端 (SOTA) を確立しています。
.com/wbbeyourself/MAC-SQL)。

要約(オリジナル)

Recent LLM-based Text-to-SQL methods usually suffer from significant performance degradation on “huge’ databases and complex user questions that require multi-step reasoning. Moreover, most existing methods neglect the crucial significance of LLMs utilizing external tools and model collaboration. To address these challenges, we introduce MAC-SQL, a novel LLM-based multi-agent collaborative framework. Our framework comprises a core decomposer agent for Text-to-SQL generation with few-shot chain-of-thought reasoning, accompanied by two auxiliary agents that utilize external tools or models to acquire smaller sub-databases and refine erroneous SQL queries. The decomposer agent collaborates with auxiliary agents, which are activated as needed and can be expanded to accommodate new features or tools for effective Text-to-SQL parsing. In our framework, We initially leverage GPT-4 as the strong backbone LLM for all agent tasks to determine the upper bound of our framework. We then fine-tune an open-sourced instruction-followed model, SQL-Llama, by leveraging Code Llama 7B, to accomplish all tasks as GPT-4 does. Experiments show that SQL-Llama achieves a comparable execution accuracy of 43.94, compared to the baseline accuracy of 46.35 for vanilla GPT-4. At the time of writing, MAC-SQL+GPT-4 achieves an execution accuracy of 59.59 when evaluated on the BIRD benchmark, establishing a new state-of-the-art (SOTA) on its holdout test set (https://github.com/wbbeyourself/MAC-SQL).

arxiv情報

著者 Bing Wang,Changyu Ren,Jian Yang,Xinnian Liang,Jiaqi Bai,Linzheng Chai,Zhao Yan,Qian-Wen Zhang,Di Yin,Xing Sun,Zhoujun Li
発行日 2024-02-15 12:55:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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