[KongchangAI]
ConceptPositional Encoding / 位置嵌入

Positional Encoding

A mechanism in Transformer models that enables the model to perceive the sequential position of tokens. Principal approaches include fixed sinusoidal encoding, learnable absolute position embeddings, and relative position encodings such as RoPE. These approaches differ substantially in their ability to generalize to sequence lengths beyond those seen during training.

Core Facts

Timeline (last 90 days)

Oct 28

Hand-computing the 6×512 positional encoding table helps one understand how the combination of sine and cosine lets the model distinguish different positions without learning a separate vector for each position.

Unverified50%
Oct 27

For Transformers, mechanisms such as positional encoding and attention masking may fail beyond the training length.

Unverified50%
Oct 26

DDPM adopts the sinusoidal positional encoding from the Transformer, converting the time step t into a high-dimensional vector, then mapping it through two fully connected layers to a dimension matching the number of feature map channels, and finally modulating the features of each layer by element-wise addition or FiLM.

Unverified50%
Oct 26

In the diffusion model, the time step t is converted into a vector via sine-cosine encoding similar to Transformer positional encoding, and then fused with the image features.

Unverified50%
Oct 24

Tiny models like DinoGPT typically use learnable positional embeddings, with the parameter count equal to the maximum sequence length multiplied by the hidden dimension.

Unverified50%
Oct 23

Positional encoding should be added to the embedding, not concatenated.

Unverified50%
Oct 20

The context window is the maximum number of tokens a time-series foundation model (and all Transformer-based models) can process in a single forward computation, jointly determined by the positional encoding in the model architecture and the complexity of the attention mechanism; the window size is a hyperparameter fixed at training time and cannot be extended at inference.

Unverified50%
Oct 17

The performance decline caused by 'lost in the middle' follows a U-shaped curve rather than linear decay; its mechanism may be related to Transformer attention allocation and positional encoding.

Unverified50%
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

Positional encoding was first widely used in the Transformer architecture, and its role is to inject the order information of elements in a sequence into the model, because the pure attention mechanism itself is insensitive to order.

Verified75%

6 more timeline events

All Facts (18)

Verified

Positional encoding was first widely used in the Transformer architecture, and its role is to inject the order information of elements in a sequence into the model, because the pure attention mechanism itself is insensitive to order.

75%
Verified

Because the Transformer self-attention mechanism exhibits positional bias, earlier input content has a stronger anchoring effect on subsequent generation, which is the underlying reason for the context anchoring effect of system prompts

65%
Unverified

Hand-computing the 6×512 positional encoding table helps one understand how the combination of sine and cosine lets the model distinguish different positions without learning a separate vector for each position.

50%
Unverified

For Transformers, mechanisms such as positional encoding and attention masking may fail beyond the training length.

50%
Unverified

DDPM adopts the sinusoidal positional encoding from the Transformer, converting the time step t into a high-dimensional vector, then mapping it through two fully connected layers to a dimension matching the number of feature map channels, and finally modulating the features of each layer by element-wise addition or FiLM.

50%
Unverified

In the diffusion model, the time step t is converted into a vector via sine-cosine encoding similar to Transformer positional encoding, and then fused with the image features.

50%
Unverified

Tiny models like DinoGPT typically use learnable positional embeddings, with the parameter count equal to the maximum sequence length multiplied by the hidden dimension.

50%
Unverified

Positional encoding should be added to the embedding, not concatenated.

50%
Unverified

The context window is the maximum number of tokens a time-series foundation model (and all Transformer-based models) can process in a single forward computation, jointly determined by the positional encoding in the model architecture and the complexity of the attention mechanism; the window size is a hyperparameter fixed at training time and cannot be extended at inference.

50%
Unverified

The performance decline caused by 'lost in the middle' follows a U-shaped curve rather than linear decay; its mechanism may be related to Transformer attention allocation and positional encoding.

50%
Unverified

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.

50%
Unverified

STCNet adopts a dual-domain collaborative strategy, introducing physics-driven positional encoding in the projection domain and temporal encoding in the latent space, jointly optimizing the projection domain and the image domain.

50%
Unverified

Traditional sinusoidal/cosine positional encodings are designed for uniform integer step sizes and have difficulty expressing geometric relationships at irregular intervals.

50%
Unverified

Positional encoding is used to inject word order information into the model, because the attention mechanism itself does not distinguish positional order.

50%
Unverified

Positional Encoding solves the problem of the attention mechanism being inherently orderless and unaware of word sequence by attaching positional information to each word.

50%
Unverified

Transformer uses positional encoding based on sine and cosine functions, with wavelengths arranged in a geometric progression, where the shortest and longest differ by a factor of ten thousand.

50%
Unverified

The vector input to the model equals the word embedding plus the positional embedding; for example, 7 characters generate 7 word embeddings and 7 positional embeddings that are added together to produce the actual input

50%
Unverified

位置编码经历了从固定正弦编码(原始论文)到可学习绝对位置编码(BERT)再到旋转位置编码RoPE(LLaMA、Qwen)的演进

50%

Source Articles