Gradient LabSign up free

ML glossary › Positional encoding

What is positional encoding in machine learning?

Extra numbers added to each token that tell the model where it sits in the sentence.

Where it shows up

Transformers and LLMs

Positional encoding

positional encoding adds a unique pattern for each position: waves of different speeds, read off at that spot. Position 1 gets one pattern, position 2 another. These are added to each word’s embedding.

See positional encoding in motion. The lesson animates it step by step, free.

Open the lesson