The self-attention module of a Transformer network treats a sequence bidrectionally as a fully connected graph of tokens -when a token is produced all other tokens are taken into consideration.
this requires the entire sequence to be known a priori and when a Transformer is used for sequence generation, the self-attention process only includes previously produced tokens (Vaswani et al.