On the Limitations and Capabilities of Position Embeddings for Length Generalization

Yang Chen, Yitao Liang, Zhouchen Lin
10/5/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

In Transformers, Position Embeddings (PEs) significantly influence Length Generalization (LG) performance, yet their fundamental role remains unclear. In this work, we investigate the limitations and capabilities of PEs in achieving LG. We theoretically analyze PEs in Position-Only Linear Attentions (POLAs), introducing Linear Representation Complexity (LRC) to characterize when PEs enable LG. Our analysis shows that PEs do not expand computational capabilities but structure learned computations across positions. Extending to practical Transformers, we propose Sequential Representation Complexity (SRC) and conjecture that LG is possible if and only if SRC remains invariant across scales. We support this hypothesis with empirical evidence in various reasoning tasks. To enhance LG, we introduce Scale Hint, allowing flexible instance scaling, and a Learning-Based Position Embedding framework that automatically learns positional relations. Our work provides theoretical insights and practical strategies for improving LG in Transformers.

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{chen2025limitations,
  title  = {On the Limitations and Capabilities of Position Embeddings for Length Generalization},
  author = {Yang Chen and Yitao Liang and Zhouchen Lin},
  year   = {2025},
  eprint = {2510.04130},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.04130v1}
}

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/2510.04130.svg)](https://codeofpaper.com/paper/2510.04130)

Discussion