第11章注意機構とTransformer
11.6.4. Summary11.6.4 まとめ
In self-attention, the queries, keys, and values all come from the same place. Both CNNs and self-attention enjoy parallel computation and self-attention has the shortest maximum path length. However, the quadratic computational complexity with respect to the sequence length makes self-attention prohibitively slow for very long sequences. To use the sequence order information, we can inject absolute or relative positional information by adding positional encoding to the input representations.
英語のヒント
自己注意では、クエリ、キー、バリューはすべて同じところから来る。CNNと自己注意はどちらも並列計算の恩恵を受け、自己注意は最大の経路長が最も短い。しかし、系列の長さについて計算量が2乗であるため、自己注意はとても長い系列では法外に遅くなる。系列の順序の情報を使うには、入力の表現に位置符号化を加えることで、絶対的あるいは相対的な位置の情報を注入できる。