Skip to main content

Questions tagged [positional-encoding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
72 views

Why is the sinusoidal model classified as absolute positional encoding in some literature?

I am currently reading in depth about positional encodings, and as we know there are two types of positional encodings: Absolute and relative. My question: Why is the sinusoidal model classified as ...
Ali Haider Ahmad's user avatar
0 votes
0 answers
51 views

Concatenating the positional encoding

As per "Attention is all you need" etc., positional encoding is added to the embedded word vector input. My knee-jerk reaction is that this would muddle the "signal" of the word ...
SuaveSouris's user avatar
0 votes
1 answer
372 views

Why use exponential and log in Positional Encoding of Transformer

This code snippet is from here under the section named "Position embeddings". ...
Jun's user avatar
  • 3
1 vote
1 answer
148 views

What is the intuition behind position-encoding?

It is clear that word positions are essential for the meaning of a sentence, and so are essential when feeding a sentence (= sequence of words) as a matrix of word embedding vectors into a transformer....
Hans-Peter Stricker's user avatar
1 vote
0 answers
47 views

How can the Transformer model tell from positional encoding data to the origional data?

I am having trouble understanding positional encoding. Say after the wor2vec or some encoding algo we get the tensor $[0.7, 0.4, 0.2]$ for the second position. Now the final input into the model would ...
BlueSnake's user avatar
2 votes
1 answer
4k views

Which positional encoding BERT use?

It is a little bit confusing that someone is explaining that BERT is using sinusoidal functions for BERT position encoding and someone is saying BERT just uses absolute position. I checked that ...
yoon's user avatar
  • 121
3 votes
1 answer
3k views

Positional Encoding of Time-Series features

I’m trying to use a Transformer Encoder I coded with weather feature vectors which are basically 11 features about the weather in the dimension ...
Ouilliam's user avatar
0 votes
1 answer
170 views

Are positional embeddings computed during or before training?

I'm trying to practically frame the concept of positional embeddings as introduced in the original paper. As far as I've understood, what we do is basically creating some other vectors in addition to ...
James Arten's user avatar
2 votes
1 answer
498 views

Is Positional Encoding always needed for using Transformer models correctly?

I am trying to make a model that uses a Transformer to see the relationship between several data vectors, but the order of the data is not relevant in this case, so I am not using the Positional ...
Angelo's user avatar
  • 211
3 votes
2 answers
109 views

Is there a notion of location in Transformer architecture in subsequent self-attention layers?

Transformer architecture (without position embedding) is by the very construction equivariant to the permutation of tokens. Given query $Q \in \mathbb{R}^{n \times d}$ and keys $K \in \mathbb{R}^{n \...
spiridon_the_sun_rotator's user avatar
3 votes
0 answers
480 views

Is there any point in adding the position embedding to the class token in Transformers?

The popular implementations of ViTs by Ross Wightman and Phil Wang add the position embedding to the class tokens as well as to the patches. Is there any point in doing so? The purpose of introduction ...
spiridon_the_sun_rotator's user avatar
2 votes
0 answers
614 views

Positional Encoding in Transformer on multi-variate time series data hurts performance

I set up a transformer model that embeds positional encodings in the encoder. The data is multi-variate time series-based data. As I just experiment with the positional encoding portion of the code I ...
Matt's user avatar
  • 121
0 votes
0 answers
377 views

Has positional encoding been used in convolutional layers?

Positional encoding (PE) is an essential part of the self-attention layers in the transformer architectures since without adding it in some way (fixed of learnable) to the input embeddings model has ...
spiridon_the_sun_rotator's user avatar
8 votes
2 answers
4k views

What is the difference between the positional encoding techniques of the Transformer and GPT?

I know the original Transformer and the GPT (1-3) use two slightly different positional encoding techniques. More specifically, in GPT they say positional encoding is learned. What does that mean? ...
Leevo's user avatar
  • 305
2 votes
0 answers
166 views

How does positional encoding work in the transformer model?

In the transformer model, to incorporate positional information of texts, the researchers have added a positional encoding to the model. How does positional encoding work? How does the positional ...
Eka's user avatar
  • 1,066
1 vote
0 answers
126 views

Why do both sine and cosine have been used in positional encoding in the transformer model?

The Transformer model proposed in "Attention Is All You Need" uses sinusoid functions to do the positional encoding. Why have both sine and cosine been used? And why do we need to separate the odd ...
Shiyu's user avatar
  • 11
2 votes
0 answers
265 views

How do the sine and cosine functions encode position in the transformer?

After going through both the "Illustrated Transformer" and "Annotated Transformer" blog posts, I still don't understand how the sinusoidal encodings are representing the position of elements in the ...
shoshi's user avatar
  • 121