Term
multi-head self-attention
Meaning
A sublayer of a transformer block that runs several self-attention heads in parallel. Each head computes its own attention output from the input sequence, the head outputs are concatenated, and a trainable projection matrix maps the result back to the embedding size.
Source UNETR: Transformers for 3D Medical Image Segmentation
How papers use it 5 papers
UNETR: Transformers for 3D Medical Image Segmentation
Use Forms the first sublayer of each transformer block in the UNETR encoder, placed after layer normalization and followed by a residual connection. The encoder stacks L transformer layers, each with this multi-head self-attention sublayer and an MLP sublayer, so the MSA output of each block is added back to its input before the MLP stage.
BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer
Use Serves as the first sub-layer of each Transformer layer in BERT4Rec. Each head has its own learnable query, key and value projections, and the outputs of all heads are concatenated and projected with an output matrix. The paper adopts multiple heads so that different representation subspaces can attend to information at different positions.
Meaning An attention sub-layer that projects its input into several subspaces, applies scaled dot-product attention in each subspace, then concatenates the head outputs and projects them once more. Queries, keys and values are all computed from the same input matrix.
CvT: Introducing Convolutions to Vision Transformers
Use The attention module inside each Transformer block of the model. In CvT, the Q, K and V inputs to this module come from the convolutional projection rather than the position-wise linear projection, and reducing the number of key and value tokens lowers its computational cost.
Meaning An attention module that runs several scaled dot-product attention operations in parallel over different learned projections of the input tokens, then combines their outputs. Each head attends over all tokens, so the module models global relations between tokens.
Pre-Trained Image Processing Transformer
Use Serves as the attention block inside the encoder layers and the two attention stages of each decoder layer of the IPT body. In the encoder, patch features are normalized and passed through MSA with residual addition before a feed-forward network. In the decoder, the first MSA takes the task embedding added to the queries and keys, and the second MSA attends to the encoder output as keys and values.
Meaning An attention module that lets every element of a sequence weigh information from all elements of the same sequence. Queries, keys and values are projected into several subspaces (heads), attention is computed in each head, and the head outputs are combined back into one representation.
TransMed: Transformers Advance Multi-modal Medical Image Classification
Use Serves as the core component of the transformer in TransMed. In the paper's formula, each head uses its own trainable projections of the queries, keys and values, and the concatenated heads are multiplied by an output projection matrix. The text describes the symbol h as the number of transformer layers, while the head formula uses it for heads, so the exact meaning of h is unclear.
Meaning An extension of self-attention that splits the input into several parts, computes scaled dot-product attention for each part in parallel, and concatenates the outputs through a learned output projection.