输入到转换器的训练数据是什么(attention is all you need)?

What is the training data input to the transformers (attention is all you need)?

抱歉,我是 NLP 新手。请多多包涵。假设我有两个句子:

法语:Le chat mange。

英语:The cat eats.

在下文中,我将训练数据表示为元组(x, y),其中x是输入数据,y是注释。

我在训练transformer网络的时候,是不是把A.这两个句子同步输入作为训练数据,即(Le chat mange, The cat eats)?或者我 B. 使用 ((Le chat mange, ), The), ((Le chat mange, The), cat), ((Le chat mange, The cat), eats) 作为训练数据?

如果是 A,听起来我必须等待网络在训练期间一个一个地生成单词,这将无法并行化。所以我猜应该是B?

我明白了。源句的这个"shifting"是应用论文中提到的"mask"完成的。

面具长这样

M=[0, 0, ..., 0
   1, 0, ..., 0
   1, 1, ..., 0] 

在自我关注中,由于矩阵 QK^T(忽略比例因子)表示 "queries" 和 "keys" 之间的互相关,因此应用掩码时:M o (QK^T)o 表示元素乘法),"current query" Q[i,:] 和 "future" 键 K[i+k,:] 之间的相关性被忽略,对于 k=1,...,N-i