Which choices for positional embeddings in transformers networks exist?
- User
Which choices for positional embeddings in transformers networks exist?
Assistant
There are several common choices for positional embeddings in transformer networks:
- Sinusoidal positional embeddings: This encodes the position using sinusoids of different frequencies. For example:
PE(pos, 2i) = sin(pos/10000^(2i/d_model)) PE(pos, 2i+1) = cos(pos/10000^(2i/d_model))Where pos is the position, i is the dimension index, and d_model is the model dimensionality.
-
Learned positional embeddings: This learns positional embeddings as model parameters during training. They are initialized randomly and then optimized via backpropagation.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.