Self-Attention Networks Can Process Bounded Hierarchical Languages

要約

NLP での印象的なパフォーマンスにもかかわらず、自己注意ネットワークは、$k$ 型の適切にネストされた括弧で構成される言語である $\mathsf{Dyck}_k$ などの階層構造を持つ形式言語の処理に制限があることが最近証明されました。
これは、形式言語には弱すぎるモデルで自然言語を適切に近似できること、または自然言語における階層と再帰の役割が制限される可能性があることを示唆しています。
自己注意ネットワークが $\mathsf{Dyck}_{k, D}$ を処理できることを証明することにより、この含意を修飾します。
おそらく、自然言語の境界のある階層構造をより適切に捉えることができます。
具体的には、$\mathsf{Dyck}_{k, D}$ を認識する $D+1$ レイヤーと $O(\log k)$ メモリ サイズ (レイヤーごとのトークンごと) を使用して、ハードアテンション ネットワークを構築します。
$\mathsf{Dyck}_{k, D}$ を生成する 2 つのレイヤーと $O(\log k)$ メモリ サイズのソフト アテンション ネットワーク。
実験では、$\mathsf{Dyck}_{k, D}$ でトレーニングされた自己注意ネットワークが、ほぼ完全な精度でより長い入力に一般化し、再帰型ネットワークに対する自己注意ネットワークの理論的なメモリの利点を検証することが示されています。

要約(オリジナル)

Despite their impressive performance in NLP, self-attention networks were recently proved to be limited for processing formal languages with hierarchical structure, such as $\mathsf{Dyck}_k$, the language consisting of well-nested parentheses of $k$ types. This suggested that natural language can be approximated well with models that are too weak for formal languages, or that the role of hierarchy and recursion in natural language might be limited. We qualify this implication by proving that self-attention networks can process $\mathsf{Dyck}_{k, D}$, the subset of $\mathsf{Dyck}_{k}$ with depth bounded by $D$, which arguably better captures the bounded hierarchical structure of natural language. Specifically, we construct a hard-attention network with $D+1$ layers and $O(\log k)$ memory size (per token per layer) that recognizes $\mathsf{Dyck}_{k, D}$, and a soft-attention network with two layers and $O(\log k)$ memory size that generates $\mathsf{Dyck}_{k, D}$. Experiments show that self-attention networks trained on $\mathsf{Dyck}_{k, D}$ generalize to longer inputs with near-perfect accuracy, and also verify the theoretical memory advantage of self-attention networks over recurrent networks.

arxiv情報

著者 Shunyu Yao,Binghui Peng,Christos Papadimitriou,Karthik Narasimhan
発行日 2023-03-13 01:47:55+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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