[KongchangAI]
ConceptRelative Positional Encoding

Relative Positional Encoding

A positional encoding method that directly models the relative distance between tokens by incorporating relative distance as part of the attention score. The same relative distance shares parameters across different absolute positions, making it more robust to changes in sequence length, though implementation is more complex.

Timeline (last 90 days)

Nov 15

Works such as Transformer-XL and T5 make relative distance part of the attention score, enabling the model to directly use the interval information between tokens.

Unverified50%
Nov 15

The advantage of relative positional encoding is that the same relative distance shares one set of parameters across different absolute positions, making it friendlier to changes in sequence length; the cost is more complex implementation, with the relative position term requiring extra handling in attention computation and sometimes truncation or bucketing of distances beyond a certain range.

Unverified50%
Nov 15

When training and inference lengths match, learnable absolute encodings are simple and effective; when inference on longer sequences is needed, relative encodings and RoPE are preferred.

Unverified50%
Nov 15

No single positional-encoding scheme dominates across all dimensions: absolute encodings are simple to implement but extrapolate poorly, relative encodings are flexible but computationally complex, and RoPE expresses relative positions at the attention level but also requires additional extrapolation strategies.

Unverified50%
Nov 2

Regarding the encoding of absolute physical position, the community is divided: some argue for direct normalized input, while others believe relative position encoding or learnable position embeddings should be used, because absolute position may introduce unnecessary bias.

Unverified50%
Nov 2

Some comments mentioned that in robotics or physical simulation, relative position encoding is often more effective than absolute position encoding.

Unverified50%

All Facts (6)

Unverified

Works such as Transformer-XL and T5 make relative distance part of the attention score, enabling the model to directly use the interval information between tokens.

50%
Unverified

The advantage of relative positional encoding is that the same relative distance shares one set of parameters across different absolute positions, making it friendlier to changes in sequence length; the cost is more complex implementation, with the relative position term requiring extra handling in attention computation and sometimes truncation or bucketing of distances beyond a certain range.

50%
Unverified

When training and inference lengths match, learnable absolute encodings are simple and effective; when inference on longer sequences is needed, relative encodings and RoPE are preferred.

50%
Unverified

No single positional-encoding scheme dominates across all dimensions: absolute encodings are simple to implement but extrapolate poorly, relative encodings are flexible but computationally complex, and RoPE expresses relative positions at the attention level but also requires additional extrapolation strategies.

50%
Unverified

Regarding the encoding of absolute physical position, the community is divided: some argue for direct normalized input, while others believe relative position encoding or learnable position embeddings should be used, because absolute position may introduce unnecessary bias.

50%
Unverified

Some comments mentioned that in robotics or physical simulation, relative position encoding is often more effective than absolute position encoding.

50%

Source Articles