[KongchangAI]
ConceptSelf-Attention / 自注意力 / QKV注意力

Self-Attention Mechanism

A core component of the Transformer architecture that computes relevance weights between positions in a sequence using three matrices: Query, Key, and Value. This enables the model to capture long-range dependencies within the input sequence.

Core Facts

Timeline (last 90 days)

Dec 1

Local patch tokens directly read global [CLS] information via the self-attention mechanism (direct readout), and this phenomenon occurs before the emergence of high-norm tokens and attention sinks.

Unverified50%
Nov 6

The computation of the self-attention mechanism in the denoising process of diffusion models grows quadratically with image resolution.

Unverified50%
Nov 2

When the sequence length n increases from 128k to 1M, the number of elements in the attention matrix grows by about 64 times.

Unverified50%
Nov 2

In standard self-attention, each query computes similarity with all keys, with a computational cost of O(n²d), where n is the sequence length and d is the head dimension.

Unverified50%
Oct 31

The self-attention mechanism allows the model to directly attend to relevant information at any time step in the history, without needing to pass hidden states step by step as an RNN does.

Unverified50%
Oct 29

Mainstream Transformers use the self-attention mechanism, and the computation and memory usage of the standard implementation grow quadratically with sequence length.

Verified65%
Oct 14

The causes of the lost-in-the-middle phenomenon are usually attributed to the decay effect of positional encoding, the fact that beginning and end content in training data is more often associated with answers, and the dilution of the attention softmax over long sequences.

Unverified50%
Oct 14

The Transformer's encoder uses only self-attention, while the decoder alternates between self-attention and cross-attention.

Verified75%
Oct 12

In the standard self-attention mechanism, each token needs to compute relevance with all other tokens in the sequence, and the computational complexity is approximately the square of the sequence length (O(n²)).

Unverified50%
Oct 12

The final output of self-attention is obtained by weighted summation of the Value vectors using the attention weights.

Unverified70%

11 more timeline events

All Facts (20)

Verified

The Transformer's core innovation is the self-attention mechanism, which allows models to attend to all positions in the input simultaneously rather than processing step-by-step like RNNs or LSTMs

90%
Verified

The computational complexity of the self-attention mechanism grows approximately quadratically with sequence length, with the attention matrix computation being proportional to n² for a sequence of length n.

90%
Verified

Set Transformer models interactions between row vectors based on the self-attention mechanism and maintains permutation invariance by removing positional encodings.

90%
Verified

Through the self-attention mechanism, Transformer allows the model to dynamically attend to all other tokens in the sequence when processing each token, while enabling fully parallelized training.

90%
Verified

The self-attention mechanism allows the model to simultaneously reference the contextual information of all other tokens in a sequence when processing each token, rather than processing sequentially as RNNs do

90%
Verified

The key innovation of the Transformer is the self-attention mechanism, which allows the model to simultaneously attend to information from all other tokens in the input sequence when processing a single token.

90%
Verified

The Transformer architecture was proposed in 2017 by the Google Brain team in the paper "Attention Is All You Need"

90%
Verified

The core innovation of the Transformer is replacing RNN's sequential processing with a self-attention mechanism, enabling highly parallelized training, while abandoning the RNN's hidden-state cross-timestep propagation mechanism.

80%
Verified

Each Transformer layer contains two core sub-modules: multi-head self-attention and a feed-forward neural network.

80%
Verified

The self-attention mechanism of the Transformer allows the model to directly compute dependencies between any two positions in a sequence, breaking through the parallelization bottleneck caused by the sequential computation of RNNs/LSTMs.

80%
Verified

The Transformer's encoder uses only self-attention, while the decoder alternates between self-attention and cross-attention.

75%
Verified

When resolution doubles, the attention computation the model must handle often grows fourfold or more, causing elapsed time to increase non-linearly.

75%
Verified

The Transformer architecture completely replaces recurrent structures with multi-head self-attention mechanisms, eliminating the sequential computation bottleneck and resolving the long-range dependency problem.

75%
Verified

Large model output generation uses an autoregressive approach to produce tokens one by one, requiring recalculation of attention over all preceding context with each token generated.

70%
Verified

In the standard attention mechanism, the Query matrix and Key matrix perform matrix multiplication to obtain an n×n attention score matrix, with a computational complexity of O(n²·d).

70%
Verified

Mainstream Transformers use the self-attention mechanism, and the computation and memory usage of the standard implementation grow quadratically with sequence length.

65%
Verified

Transformers process text sequences in parallel through self-attention mechanisms and can capture long-range dependencies, unlike traditional RNNs.

65%
Verified

The self-attention mechanism linearly transforms the input sequence into three matrices—Query, Key, and Value—with attention weights obtained by multiplying Q by the transpose of K, normalizing via Softmax, and then multiplying by V to produce the output.

65%
Verified

The self-attention mechanism determines which other positions in the sequence each position should attend to by computing the dot-product similarity between the Query and all Keys.

65%
Unverified

The final output of self-attention is obtained by weighted summation of the Value vectors using the attention weights.

70%

Source Articles