Term
self-attention
Meaning
An attention operation in which queries, keys and values are obtained by linear projection of the input. The attention matrix is a softmax over the product of queries and keys, and the output is that matrix multiplied by the values, so every position can attend to every other position to capture global information.
How papers use it 42 papers
Attention Mechanisms in Computer Vision: A Survey
Use Presented as the self-attention mechanism of the survey, used as a spatial attention mechanism that captures global information, and the basis of the non-local and later visual transformer methods. The paper notes its quadratic complexity as a drawback, which limits its use on large feature maps.
Adaptive Fourier Neural Operators: Efficient Token Mixers for Transformers
Use Used as the standard reference mixer in the paper. It is the baseline in ViT-B/4 inpainting (27.06 dB PSNR, 357.2 GFLOPs), in few-shot segmentation on LSUN-Cats, ADE-Cars and CelebA-Faces (35.57, 49.26 and 56.91 mIoU), and in ImageNet-1K inpainting. For Cityscapes at 1024 by 1024 with SegFormer-B3 no result is reported, because the sequence is too long for the first few layers. The efficient self-attention variant that uses sequence reduction is a separate baseline in the Cityscapes comparison and is not the same as this entry.
Meaning A token mixing mechanism in which each token's output is a weighted sum over all tokens. The weights come from a softmax over scaled query-key inner products, applied to value projections, so the mixing follows the graph similarity among tokens. Its cost grows quadratically with the sequence length.
VMamba: Visual State Space Model
Use Used as the reference point for the proposed design. The paper credits self-attention with global receptive fields and dynamic weighting, which it wants to retain, and identifies its quadratic cost in the number of tokens as the obstacle for downstream tasks with large spatial resolutions.
Meaning An attention mechanism used in Transformers in which each token computes weighted interactions with all other tokens. Its cost grows quadratically with the number of tokens.
BEHRT: Transformer for Electronic Health Records
Use The attention scores between diagnoses in one history are plotted for two patients.
Meaning Attention in which each element of a sequence weights the other elements when building its representation.
MLP-Mixer: An all-MLP Architecture for Vision
Use Serves as the contrast class for Mixer. Vision Transformers use self-attention layers for both feature mixing and spatial mixing, and the paper's architecture drops them entirely in favour of MLPs that mix across channels and across patches.
Meaning A layer type in which each token computes a weighted combination of all tokens, with the weights derived from pairwise similarity scores between their representations. It lets every position exchange information with every other position in one step.
CTformer: Convolution-free Token2Token Dilated Vision Transformer for Low-dose CT Denoising
Use Transformer blocks in CTformer compute attention over Q, K and V, and the softmax term is the attention map read for interpretation.
Meaning A mechanism in which each position weighs every other position by the similarity of its query and their keys.
Unifying Flow, Stereo and Depth Estimation
Use Applied within each Transformer block after the cross-attention step, to refine each view's features using information from the same image. The authors state that it considers a larger context than the convolutional layers, and it is applied symmetrically to both input feature maps.
Meaning An attention operation in which the queries, keys and values are all computed from the same feature map, so each location gathers information from other locations within that map. It enlarges the context a feature can draw on.
Learning to (Learn at Test Time): RNNs with Expressive Hidden States
Use Used as the reference point for comparing sequence modeling layers. Its hidden state is the key-value cache that grows with each token, so the per-token cost grows with context, in contrast to RNN layers with fixed-size states. The authors show that a TTT layer with a nonparametric Nadaraya-Watson learner produces the same outputs as self-attention.
Meaning An attention mechanism in which each token's output is a weighted sum of value vectors, with weights from a softmax over query-key scores against the context. In sequence models, the stored keys and values form a cache that grows with context length.
Is Space-Time Attention All You Need for Video Understanding?
Use Forms the core operator of TimeSformer, which builds the video model exclusively from self-attention and applies it over patch tokens from all frames. The authors note that full self-attention compares every pair of tokens, which is costly for video because of the large number of patches, and so they propose factorized variants such as Divided Space-Time Attention.
Meaning An attention mechanism in which each token computes a weighted combination of the values of tokens in the same sequence, with weights from dot products between its query and the keys of those tokens, normalized by a softmax.
Linformer: Self-Attention with Linear Complexity
Use Identified as the main efficiency bottleneck of Transformers. Computing the context mapping matrix needs O(n^2) time and space with respect to sequence length n. The paper replaces it with a linear-complexity variant (Linformer) that uses projected keys and values, with cost O(nk) for each head.
Meaning An attention operation in which each token's representation is updated as a weighted combination of the representations of all tokens in the sequence, with weights computed from scaled query-key similarities.
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Use Used globally in the ViT encoder layers, through multiheaded self-attention, so that information can be integrated across the whole image even in the lowest layers. Applying it naively per pixel has quadratic cost in the number of pixels, which motivated operating on patches instead. Attention-distance analysis shows that some heads attend across most of the image already in low layers, while others stay local.
Meaning An attention operation in which every element of a sequence computes weights over all elements of that sequence and forms a weighted combination of them.
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Use Global self-attention is treated as quadratic in the number of tokens, so the paper computes self-attention locally within non-overlapping windows. With the window size M fixed (7 by default), the cost grows linearly with image size.
Meaning An attention operation in which queries, keys and values are all derived from the same set of tokens, and each output is a weighted sum of values with weights given by query-key similarity.
A Structured Self-attentive Sentence Embedding
Use The step applied to the bidirectional LSTM states to produce the weight rows of the annotation matrix.
Meaning An attention mechanism in which the weights are computed from the same sequence that is then summarized, so no separate query or outside input is needed.
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Use In BERT, the self-attention in each Transformer layer is bidirectional, so every token can use context from both sides. In OpenAI GPT the self-attention is constrained so that each token attends only to the tokens on its left. Because a concatenated text pair is encoded with this self-attention, it also covers cross-attention between the two sentences during fine-tuning.
Meaning An attention mechanism in which each token computes a weighted combination of the representations of tokens in the same sequence, with the weights derived from learned query, key and value projections. Whether a token may attend to tokens on one side only or to the whole sequence is a design choice.
Emerging Properties in Self-Supervised Vision Transformers
Use In the ViT backbone, the self-attention layers of the last block are the source of the attention maps the paper analyses. Maps from the [CLS] token query show object regions and parts, and are thresholded to produce masks for comparison with ground truth. The paper uses these maps to show that object boundaries and scene layout are directly accessible in the last block, as in Figures 1 and 3.
Meaning An attention mechanism in which each token in a sequence computes a weighted combination of the representations of all tokens in that same sequence, with weights set by query-key similarity. It lets a Transformer update token representations using context from the whole input.
Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting
Use The mechanism that Auto-Correlation is set against. The paper argues that self-attention and its sparse variants capture only relations between individual points, and that such sparse point-wise connections limit information use for long-term forecasting. In the comparison, the sparse variants considered include LogSparse and ProbSparse attention, which reduce complexity while still aggregating point by point.
Meaning An attention mechanism that computes weights from pairwise similarities between individual positions of a sequence and aggregates the values at those positions by dot product. It operates on scattered point-wise connections in the sequence.
Graph Attention Networks
Use Serves as the basis of the GAT layer, where each node computes its hidden representation by attending over its neighbors. The paper motivates this with prior results showing self-attention is useful for machine reading, sentence representations and machine translation.
Meaning An attention mechanism in which the elements of a single sequence or set attend to one another, so that each element's new representation is a weighted combination of the others. It is also called intra-attention.
MobileViT: Light-weight, General-purpose, and Mobile-friendly Vision Transformer
Use The global processing component of MobileViT: transformer layers apply multi-head self-attention across the patches at each position after the unfolding step, so that each pixel can draw on information from the whole image. The paper contrasts this with vision transformers that rely on multi-head self-attention without convolutional spatial bias.
Meaning Self-attention, an attention mechanism in which each element of a set of tokens or patches computes weighted interactions with the other elements, so that its output combines information from across the whole set. Multi-head self-attention runs several such attention operations in parallel.
Transformers in Vision: A Survey
Use Used as the core building block of the Transformer models the survey reviews. The paper notes that, unlike a convolution with fixed filters, the attention weights are computed dynamically from the input, and that self-attention can therefore handle irregular inputs. In the detection setting the flattened CNN feature map is encoded with self-attention to model relationships among the spatial features.
Meaning An operation that updates each element of a sequence by mixing in information from all the other elements. Queries, keys and values are linear projections of the input, and each output is a weighted sum of the values, where the weights come from softmax-normalized dot products between queries and keys, scaled by the square root of the query dimension.
Efficient Memory Management for Large Language Model Serving with PagedAttention
Use Central to the paper because the key and value vectors of earlier tokens are cached and reused during autoregressive generation, giving the KV cache. PagedAttention rewrites the attention computation block by block, so the key and value vectors of one sequence can sit in non-contiguous memory.
Meaning A layer that projects each position's input into query, key and value vectors, then computes each output as a weighted average of the value vectors, with weights from scaled dot products between the query at that position and the keys at the same and earlier positions. The weights are normalized with a softmax.
Denoising Diffusion Probabilistic Models
Use Applied at the 16×16 feature-map resolution of the U-Net that serves as the reverse-process network, letting the model relate distant spatial locations at that scale.
Meaning An attention mechanism in which each position in a feature map computes a weighted combination of all positions, with the weights derived from the input itself through query, key and value projections.
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
Use Provides the global context that the Transformer encoder in TransUNet relies on, since the encoder applies self-attention over the whole sequence of image patch tokens. The paper presents this global modelling as the reason Transformers are combined with U-Net-style high-resolution features.
Meaning A mechanism that updates each element of a sequence or feature map as a weighted combination of its interactions with all other elements, so every position can draw on global context.
Attention Is All You Need
Use Used in the encoder, where each position attends to all positions of the previous encoder layer, and in the decoder, where each position attends to earlier and current positions.
Meaning An attention mechanism that relates different positions of a single sequence to one another, producing a representation of that sequence from its own elements.
Segmenter: Transformer for Semantic Segmentation
Use Forms the core of the multi-headed self-attention blocks in the Segmenter encoder, so that each patch token can interact with every other patch token in every layer. The paper uses the scaled dot-product form, dividing the query-key products by the square root of the query dimension before the softmax.
Meaning An attention operation in which each token builds its output from a weighted combination of all tokens in the sequence. The weights come from comparing queries with keys, which are linear projections of the token representations, and the weighted sum uses values.
Self-Attention with Relative Position Representations
Use Used in each attention head of the Transformer's encoder and decoder layers. The outputs of all heads are concatenated and passed through a linear transformation. The projection matrices \(W^Q\), \(W^K\) and \(W^V\) are unique per layer and attention head. The relation-aware variant modifies this sublayer by adding edge terms, and the decoder applies masking within it.
Meaning An attention sublayer in which each output element is a softmax-weighted sum of linearly transformed input elements. The weights come from compatibility scores between pairs of elements, computed as scaled dot products of projected query and key vectors, with the scores divided by the square root of \(d_z\).
Swin UNETR: Swin Transformers for Semantic Segmentation of Brain Tumors in MRI Images
Use Forms the core of the Swin UNETR encoder through the regular window-based (W-MSA) and shifted-window (SW-MSA) multi-head self-attention modules. Attention is computed as \(\mathrm{Softmax}(QK^\top/\sqrt{d})V\), where \(d\) is the size of the query and key, and it is applied within windows of tokens at each encoder layer.
Meaning An attention mechanism in which queries, keys and values are all computed from the same set of tokens. Each token's output is a weighted sum of value vectors, with weights from scaled dot-product similarities between queries and keys, so the module models pairwise interactions among tokens.
Uformer: A General U-Shaped Transformer for Image Restoration
Use Within each LeWin block, self-attention is computed inside non-overlapping M×M windows instead of over the whole feature map, which keeps the cost growing linearly with the number of pixels for a fixed window size. The windowed form, called W-MSA, uses multiple heads with learned query, key and value projections and a relative position bias. Global self-attention is treated as too costly for high-resolution maps, while prior work applies it only to low-resolution maps.
Meaning An attention operation in which the queries, keys and values are all computed from the same set of feature tokens, so each position builds its output from weighted information gathered over the other positions in that set.
Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model
Use Used as the main point of contrast for Vim, which aims to provide global context without attention. The paper compares the cost of a global self-attention layer with that of the SSM in Vim, giving a quadratic term in the sequence length M for self-attention and a linear term for the SSM, with D as the hidden width and N as the SSM dimension.
Meaning An operation in which each token computes weighted interactions with all other tokens of a sequence so that its output carries global, input-dependent context. Its computation and memory grow quadratically with sequence length.
Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers
Use Forms the core of each SETR encoder layer. The paper writes it in its residual form, with the scaling by the square root of d applied to the query-key product and the mixed values added to the layer input. It is used as the building block of multi-head self-attention (MSA) in the transformer encoder.
Meaning An attention operation that builds queries, keys and values from its input through three learned linear projections, computes softmax-normalized weights from scaled dot products between queries and keys, and uses these weights to mix the values. A residual connection adds the input back to the result.
A Comprehensive Overview of Large Language Models
Use Presented as one of the attention strategies used in LLMs, alongside cross attention, where the queries come from one side of an encoder-decoder model and the key-value pairs from the other side.
Meaning An attention variant in which the queries, keys and values are all derived from one block's own hidden states, whether that block belongs to an encoder or a decoder. Each position weighs the other positions inside the same block.
TransMed: Transformers Advance Multi-modal Medical Image Classification
Use Used as the basic attention operation inside the transformer layers. The authors apply the scaled dot-product form, and the division by \(\sqrt{d_k}\) is applied before the softmax. The authors describe this scaling as keeping gradients more stable.
Meaning An attention operation in which the input is projected into query, key and value matrices. Each output is a weighted sum of the value vectors, and the weights come from scaled dot products between queries and keys, as in \(\mathrm{Attention}(Q,K,V)=\mathrm{softmax}(QK^{T}/\sqrt{d_k})V\), where \(d_k\) is the dimension of the key vectors.
SmolVLA: A Vision-Language-Action Model for Affordable and Efficient Robotics
Use In SmolVLA's action expert, the self-attention layers let action tokens attend to one another within a chunk under a causal mask, so each action token sees only past tokens in the chunk and cannot depend on future actions. These layers alternate with cross-attention layers.
Meaning An attention layer in which tokens attend to other tokens of the same sequence. A causal mask restricts each token to attend only to earlier positions.
Are Transformers Effective for Time Series Forecasting?
Use Is the core component of the Transformer-based LTSF models examined here. The authors argue that its permutation-invariance causes temporal information loss in time series, even when positional encodings or sub-series tokens are added. Variants such as ProbSparse self-attention in Informer, the Fourier-based block in FEDformer and auto-correlation in Autoformer are presented as ways to reduce its cost.
Meaning A sequence operation in which each element is updated from its pairwise relations with the other elements, which lets a model capture dependencies among positions in a sequence. In its basic form it does not depend on element order, so order information has to be supplied separately.
The other papers are in the term map.