# Why positional embeddings are implemented as just simple embeddings?

**URL:** <https://discuss.huggingface.co/t/why-positional-embeddings-are-implemented-as-just-simple-embeddings/585>\
**Category:** Beginners\
**Created:** [August 4, 2020, 1:32pm UTC](https://discuss.huggingface.co/t/why-positional-embeddings-are-implemented-as-just-simple-embeddings/585 "2020-08-04T13:32:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![yjernite](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/yjernite/32/2239_2.png) [@yjernite](https://discuss.huggingface.co/u/yjernite)\
**Post date:** [August 14, 2020, 4:12pm UTC](https://discuss.huggingface.co/t/why-positional-embeddings-are-implemented-as-just-simple-embeddings/585/6 "2020-08-14T16:12:36Z")

</div>

In theory, the trigonometric functions have the ability to generalize beyond positions that are seen at training time. They also allow the model to rely on relative rather than absolute positions, and as such their dot product can be computed more efficiently as shown in the TransformerXL paper.

On the other hand, the learned index embeddings offer more parameters, which might enable the model to learn faster in some situations.

As for many other things, it really depends on your use case 😉

---

_[View the full topic](https://discuss.huggingface.co/t/why-positional-embeddings-are-implemented-as-just-simple-embeddings/585)._
