Self-Attention
An attention mechanism that computes dynamic weights from the similarity of three vector sets, Query, Key, and Value. It supports parallel computation and long-range dependency modeling, and is a core component of the Transformer.
Core Facts
The self-attention mechanism maps inputs into three sets of vectors—Query, Key, and Value—computes dot-product similarity followed by softmax normalization, and then performs a weighted sum of the Values to generate a representation that incorporates global context.
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.
The computational complexity of the standard Self-Attention mechanism has a quadratic relationship with sequence length (O(n²)).
Timeline (last 90 days)
The core of self-attention is to let every position in a sequence interact directly with all other positions and compute weights dynamically.
The self-attention mechanism captures dependencies of arbitrary distance in a single forward pass by dynamically computing association weights between an element and all other elements in the sequence, overcoming the long-range dependency difficulties caused by vanishing gradients in RNNs/LSTMs.
When processing text, the self-attention mechanism simultaneously sees all words in the entire sequence and dynamically calculates the correlation weight between each word and every other word, using parallel computation rather than processing word by word sequentially like early RNNs.
The "self" in the self-attention mechanism refers to tokens at different positions within the sequence attending to each other, not the model attending to its own parameters or state.
The semantic understanding capability of large language models originates from the Self-Attention mechanism in the Transformer architecture.
The Transformer architecture is a neural network structure proposed by Google in 2017 that addresses the difficulty traditional RNNs have in processing long sequences through a self-attention mechanism.
Even when temperature is set to 0, different conversation histories and system prompts may cause minute shifts in the attention weights of the Transformer self-attention mechanism, thereby producing different numerical outputs.
The computational complexity and memory consumption of the self-attention mechanism are both O(n²); when the input increases from 1K to 10K tokens, the amount of computation increases approximately 100-fold
All Facts (18)
The self-attention mechanism maps inputs into three sets of vectors—Query, Key, and Value—computes dot-product similarity followed by softmax normalization, and then performs a weighted sum of the Values to generate a representation that incorporates global context.
90%VerifiedThe 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%VerifiedThe computational complexity of the standard Self-Attention mechanism has a quadratic relationship with sequence length (O(n²)).
90%VerifiedTransformer架构的自注意力机制在处理长序列时面临二次方复杂度的计算开销,上下文长度翻倍则计算量增长四倍
80%VerifiedThe Transformer architecture is a neural network structure proposed by Google in 2017 that addresses the difficulty traditional RNNs have in processing long sequences through a self-attention mechanism.
75%UnverifiedWhen processing text, the self-attention mechanism simultaneously sees all words in the entire sequence and dynamically calculates the correlation weight between each word and every other word, using parallel computation rather than processing word by word sequentially like early RNNs.
60%UnverifiedThe self-attention mechanism of Transformer determines which other tokens each token attends to through Query-Key-Value matrix operations, and the attention weights form a probability distribution that sums to 1.
60%UnverifiedThe core of self-attention is to let every position in a sequence interact directly with all other positions and compute weights dynamically.
50%UnverifiedThe self-attention mechanism captures dependencies of arbitrary distance in a single forward pass by dynamically computing association weights between an element and all other elements in the sequence, overcoming the long-range dependency difficulties caused by vanishing gradients in RNNs/LSTMs.
50%UnverifiedThe "self" in the self-attention mechanism refers to tokens at different positions within the sequence attending to each other, not the model attending to its own parameters or state.
50%UnverifiedThe semantic understanding capability of large language models originates from the Self-Attention mechanism in the Transformer architecture.
50%UnverifiedEven when temperature is set to 0, different conversation histories and system prompts may cause minute shifts in the attention weights of the Transformer self-attention mechanism, thereby producing different numerical outputs.
50%UnverifiedThe computational complexity and memory consumption of the self-attention mechanism are both O(n²); when the input increases from 1K to 10K tokens, the amount of computation increases approximately 100-fold
50%UnverifiedThe Transformer is centered on the Self-Attention mechanism, consists of an encoder and a decoder, and is capable of processing information from all positions in a sequence in parallel.
50%UnverifiedThe core processes of LLMs include tokenization, embedding layer, self-attention mechanism, feed-forward network, and residual connections.
50%UnverifiedThe computational complexity of the standard self-attention mechanism is proportional to the square of the context length (O(n²)), meaning extending the context from 100K to 1M theoretically increases computation by 100 times.
50%UnverifiedThe self-attention mechanism of the Transformer breaks the bottleneck of RNNs and LSTMs that require sequential step-by-step processing, enabling highly parallelized training.
50%UnverifiedThe self-attention mechanism determines which other tokens each token in a sequence should attend to through Query-Key-Value matrix operations, and the attention weights form a probability distribution that sums to 1.
50%