第10章現代のリカレントニューラルネットワーク
10.7.1. Teacher Forcing10.7.1 教師強制
While running the encoder on the input sequence is relatively straightforward, handling the input and output of the decoder requires more care. The most common approach is sometimes called teacher forcing. Here, the original target sequence (token labels) is fed into the decoder as input. More concretely, the special beginning-of-sequence token and the original target sequence, excluding the final token, are concatenated as input to the decoder, while the decoder output (labels for training) is the original target sequence, shifted by one token: “<bos>”, “Ils”, “regardent”, “.” “Ils”, “regardent”, “.”, “<eos>” (Fig. 10.7.1).
英語のヒント
入力の系列にエンコーダを走らせるのは比較的素直だが、デコーダの入力と出力を扱うにはもっと注意が要る。最もよくあるやり方は、教師強制と呼ばれることがある。ここでは、元の目標系列(トークンのラベル)がデコーダに入力として入れられる。もっと具体的には、系列の始まりを表す特別なトークンと、最後のトークンを除いた元の目標系列を連結してデコーダへの入力とし、一方、デコーダの出力(訓練のためのラベル)は、元の目標系列を1トークンずらしたものになる。「<bos>」「Ils」「regardent」「.」「Ils」「regardent」「.」「<eos>」(図10.7.1)。
Our implementation in Section 10.5.3 prepared training data for teacher forcing, where shifting tokens for self-supervised learning is similar to the training of language models in Section 9.3. An alternative approach is to feed the predicted token from the previous time step as the current input to the decoder.
英語のヒント
In the following, we explain the design depicted in Fig. 10.7.1 in greater detail. We will train this model for machine translation on the English–French dataset as introduced in Section 10.5.