Term
Scaled Dot-Product Attention
Meaning
An attention function that computes the dot products between queries and keys, divides each product by the square root of the key dimension, applies a softmax across the keys, and uses the resulting weights to combine the values.
Source Attention Is All You Need
How papers use it 5 papers
Attention Is All You Need
Use Used as the core attention operation of the model, computed over packed query, key and value matrices. The scaling by the square root of the key dimension is introduced to counter very large dot products that push the softmax into regions with tiny gradients. In the decoder self-attention, illegal connections are masked by setting the corresponding softmax inputs to negative infinity so that each position attends only to earlier positions.
Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting
Use Serves as the normalization function in the attention formulation of the paper, with the attention output given by the attention matrix multiplied by the values. The paper takes it as the common choice before adapting multi-head attention into the interpretable variant.
Meaning An attention normalization that computes the softmax of the query-key dot products, each divided by the square root of the key dimension. The resulting weights are used to form a weighted sum of values.
BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer
Use Used inside each head of the multi-head self-attention in BERT4Rec, with the scaling factor set to the square root of the per-head dimension \(d/h\). The paper describes this scaling as a temperature that yields a softer attention distribution.
Meaning An attention function that computes a softmax over query-key dot products divided by a scaling factor, and uses the resulting weights to combine the values. The scaling keeps the softmax from becoming too sharp, which would otherwise produce extremely small gradients.
Reformer: The Efficient Transformer
Use Serves as the reference attention that the paper starts from and compares against. Because the \(QK^T\) term has shape length by length, its memory and time grow quadratically with sequence length, which motivates the paper's changes. The full-attention baselines in the experiments use a memory-efficient implementation that computes the attention one query at a time and recomputes it on the backward pass. Table 1 lists this variant's memory and time complexity alongside the LSH variant.
Meaning The attention variant that computes dot products between queries and keys, divides them by the square root of the key dimension, applies a softmax, and uses the resulting weights to combine the values. In matrix form it is \(\mathrm{softmax}(QK^T/\sqrt{d_k})V\).
Transformers in Time Series: A Survey
Use Written as the core operation of the vanilla Transformer, with queries in \(\mathbb{R}^{N\times D_k}\), keys in \(\mathbb{R}^{M\times D_k}\) and values in \(\mathbb{R}^{M\times D_v}\). The paper builds its complexity discussion on this operation, which needs an \(N\times M\) attention matrix and therefore scales quadratically with sequence length.
Meaning An attention operation in the query-key-value formulation. It computes dot products between queries and keys, divides them by the square root of the key dimension, applies a softmax over the keys, and uses the resulting weights to take a weighted sum of the values.