Benchmarking and Improving Text-to-SQL Generation under Ambiguity

要約

テキストから SQL への変換に関する研究は、主に、各テキスト クエリが 1 つの正しい SQL に対応するデータセットに対してベンチマークが行われています。
ただし、実際のデータベースに対する自然言語クエリでは、スキーマ名が重複していたり​​、複数の混乱を招く関係パスが存在したりするため、意図した SQL について重大な曖昧さが伴うことがよくあります。
このギャップを埋めるために、私たちは 3000 を超える例を備えた AmbiQT と呼ばれる新しいベンチマークを開発しました。このベンチマークでは、語彙や構造のあいまいさにより、各テキストが 2 つのもっともらしい SQL として解釈されます。
曖昧さに直面した場合、理想的なtop-$k$デコーダーは、ユーザーによる曖昧さを解消できるように、すべての有効な解釈を生成する必要があります。
私たちは、最先端の LLM を採用したものを含むいくつかの Text-to-SQL システムとデコード アルゴリズムを評価しましたが、それらはこの理想からはほど遠いことがわかりました。
主な理由は、一般的なビーム検索アルゴリズムとそのバリアントが SQL クエリを文字列として扱い、上位 $k$ で役に立たないトークンレベルの多様性を生み出すことです。
私たちは、プランベースのテンプレート生成と制約付き埋め込みを組み合わせて SQL 論理空間をナビゲートする新しいデコード アルゴリズムである LogicalBeam を提案します。
反事実的に生成された計画はテンプレートを多様化しますが、スキーマ名のみで分岐するビーム検索による埋め込みは値の多様性を提供します。
LogicalBeam は、上位 $k$ ランクの出力ですべての候補 SQL を生成する際に、最先端のモデルよりも最大 $2.5$ 倍効果的です。
また、SPIDER と Kaggle DBQA のトップ $5$ の完全一致精度と実行一致精度も強化されています。

要約(オリジナル)

Research in Text-to-SQL conversion has been largely benchmarked against datasets where each text query corresponds to one correct SQL. However, natural language queries over real-life databases frequently involve significant ambiguity about the intended SQL due to overlapping schema names and multiple confusing relationship paths. To bridge this gap, we develop a novel benchmark called AmbiQT with over 3000 examples where each text is interpretable as two plausible SQLs due to lexical and/or structural ambiguity. When faced with ambiguity, an ideal top-$k$ decoder should generate all valid interpretations for possible disambiguation by the user. We evaluate several Text-to-SQL systems and decoding algorithms, including those employing state-of-the-art LLMs, and find them to be far from this ideal. The primary reason is that the prevalent beam search algorithm and its variants, treat SQL queries as a string and produce unhelpful token-level diversity in the top-$k$. We propose LogicalBeam, a new decoding algorithm that navigates the SQL logic space using a blend of plan-based template generation and constrained infilling. Counterfactually generated plans diversify templates while in-filling with a beam-search that branches solely on schema names provides value diversity. LogicalBeam is up to $2.5$ times more effective than state-of-the-art models at generating all candidate SQLs in the top-$k$ ranked outputs. It also enhances the top-$5$ Exact and Execution Match Accuracies on SPIDER and Kaggle DBQA.

arxiv情報

著者 Adithya Bhaskar,Tushar Tomar,Ashutosh Sathe,Sunita Sarawagi
発行日 2023-10-20 17:00:53+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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