A transformer processes a sequence with self-attention: for queries , keys and values (all linear maps of the input),

The scores are pairwise dot products (vectors) computed with matrix-multiplication. Several heads run in parallel, followed by a position-wise feed-forward layer (neural-networks), residual connections and layer norm. Positional information is injected because attention itself is order-agnostic.

Origin: attention-is-all-you-need.