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

要約

Large Language Model (LLM) を採用した Text-to-SQL メソッドの最近の進歩により、顕著なパフォーマンスが実証されました。
それにもかかわらず、これらのアプローチでは、大規模なデータベース、複雑なユーザー クエリ、および誤った SQL 結果を処理するときに引き続き困難が発生します。
これらの課題に取り組むために、Text-to-SQL タスク用に設計された新しい LLM ベースのマルチエージェント協調フレームワークである \textsc{MAC-SQL} を紹介します。
私たちのフレームワークは 3 つのエージェントで構成されています。\textit{Selector} は、膨大なデータベースを圧縮し、ユーザーの質問に関連するテーブル スキーマを保持します。
\textit{Decomposer} は、複雑なユーザーの質問をより単純なサブ問題に分解し、それらを段階的に解決します。
\textit{Refiner} は、欠陥のある SQL クエリを検証して調整する役割を果たします。
BIRD と Spider の 2 つの Text-to-SQL データセットで包括的な実験を実行し、BIRD テスト セットで 59.59\% という最先端の実行精度を達成しました。
さらに、BIRD と Spider に基づくトレーニング データから派生したエージェント命令データセットに加えて、Code Llama 7B に基づく命令微調整モデル SQL-Llama をオープンソース化しました。
SQL-Llama モデルは、BIRD と Spider の両方の開発セットで有望な結果を実証しました。
ただし、GPT-4 と比較すると、顕著な強化の可能性が残っています。
私たちのコードとデータは https://github.com/wbbeyourself/MAC-SQL で公開されています。

要約(オリジナル)

Recent advancements in Text-to-SQL methods employing Large Language Models (LLMs) have demonstrated remarkable performance. Nonetheless, these approaches continue to encounter difficulties when handling extensive databases, intricate user queries, and erroneous SQL results. To tackle these challenges, we present \textsc{MAC-SQL}, a novel LLM-based multi-agent collaborative framework designed for the Text-to-SQL task. Our framework comprises three agents: the \textit{Selector}, accountable for condensing voluminous databases and preserving relevant table schemas for user questions; the \textit{Decomposer}, which disassembles complex user questions into more straightforward sub-problems and resolves them progressively; and the \textit{Refiner}, tasked with validating and refining defective SQL queries. We perform comprehensive experiments on two Text-to-SQL datasets, BIRD and Spider, achieving a state-of-the-art execution accuracy of 59.59\% on the BIRD test set. Moreover, we have open-sourced an instruction fine-tuning model, SQL-Llama, based on Code Llama 7B, in addition to an agent instruction dataset derived from training data based on BIRD and Spider. The SQL-Llama model has demonstrated encouraging results on the development sets of both BIRD and Spider. However, when compared to GPT-4, there remains a notable potential for enhancement. Our code and data are publicly available at https://github.com/wbbeyourself/MAC-SQL.

arxiv情報

著者 Bing Wang,Changyu Ren,Jian Yang,Xinnian Liang,Jiaqi Bai,Qian-Wen Zhang,Zhao Yan,Zhoujun Li
発行日 2023-12-26 03:25:20+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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