第11章注意機構とTransformer
11.5.1. Model11.5.1 モデル
Before providing the implementation of multi-head attention, let’s formalize this model mathematically. Given a query , a key , and a value , each attention head () is computed as
英語のヒント
マルチヘッド注意の実装を示す前に、このモデルを数学的に定式化しよう。クエリ、キー、バリューが与えられると、各注意ヘッド()は次のように計算される。
(11.5.1)
where , , and are learnable parameters and is attention pooling, such as additive attention and scaled dot product attention in Section 11.3. The multi-head attention output is another linear transformation via learnable parameters of the concatenation of heads:
英語のヒント
ここで、、、は学習できるパラメータであり、は、11.3節の加法注意やスケール化内積注意のような注意プーリングである。マルチヘッド注意の出力は、個のヘッドの連結を、学習できるパラメータで線形変換したものである。
(11.5.2)
Based on this design, each head may attend to different parts of the input. More sophisticated functions than the simple weighted average can be expressed.
英語のヒント
この設計にもとづけば、各ヘッドは入力の異なる部分に注意を向けられる。単純な重みつき平均より洗練された関数を表せる。