第11章注意機構とTransformer
11.4.4. Summary11.4.4 まとめ
When predicting a token, if not all the input tokens are relevant, the RNN encoder–decoder with the Bahdanau attention mechanism selectively aggregates different parts of the input sequence. This is achieved by treating the state (context variable) as an output of additive attention pooling. In the RNN encoder–decoder, the Bahdanau attention mechanism treats the decoder hidden state at the previous time step as the query, and the encoder hidden states at all the time steps as both the keys and values.
英語のヒント
トークンを予測するとき、入力のトークンのすべてが関係するわけではない場合、Bahdanauの注意機構をもつRNNのエンコーダ・デコーダは、入力系列の異なる部分を選択的に集約する。これは、状態(文脈変数)を加法注意プーリングの出力として扱うことで実現される。RNNのエンコーダ・デコーダでは、Bahdanauの注意機構は、前の時間ステップのデコーダの隠れ状態をクエリとして、すべての時間ステップのエンコーダの隠れ状態をキーとバリューの両方として扱う。