Position Information Emerges in Causal Transformers Without Positional Encodings via Similarity of Nearby Embeddings

Chunsheng Zuo, Pavel Guerzhoy, Michael Guerzhoy
12/30/2024
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Transformers with causal attention can solve tasks that require positional information without using positional encodings. In this work, we propose and investigate a new hypothesis about how positional information can be stored without using explicit positional encoding. We observe that nearby embeddings are more similar to each other than faraway embeddings, allowing the transformer to potentially reconstruct the positions of tokens. We show that this pattern can occur in both the trained and the randomly initialized Transformer models with causal attention and no positional encodings over a common range of hyperparameters.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zuo2024position,
  title  = {Position Information Emerges in Causal Transformers Without Positional Encodings via Similarity of Nearby Embeddings},
  author = {Chunsheng Zuo and Pavel Guerzhoy and Michael Guerzhoy},
  year   = {2024},
  eprint = {2501.00073},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.00073v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.00073.svg)](https://codeofpaper.com/paper/2501.00073)

Discussion