Periodic RoPE for Infinite Context LLMs

Simin Huo
5/27/2026
2 citations
cs.CLcs.AI

Official code: Cominder/miniwin (3 stars, Python, Apache-2.0, last commit 2026-06-05).

Abstract

The ability to process ultra-long contexts is crucial for large language models (LLMs) to perform long-horizon tasks. While recent efforts have extended context windows to 1M and beyond, model performance degrades when sequence length exceeds the pre-trained range of positional encodings (e.g., RoPE), i.e., position exhaustion.

Show full abstract

This fundamental limitation must be overcome to achieve a truly infinite context. To address it, we propose Periodic RoPE (P-RoPE), a positional encoding mechanism designed to circumvent this exhaustion. It operates in conjunction with sliding window attention (SWA) to capture local dependencies and relative positions within each window. This local layer is then complemented by a global attention layer with No Positional Encoding (NoPE), enabling unbounded interaction across the entire sequence without positional constraints. By stacking these two types of layers, the model avoids the need for positional extrapolation to generalize longer and theoretically supports an infinite context window. Empirical results show that our model, MiniWin, outperforms MiniMInd with standard GPT architectures in long-context efficiency and stability. Our work provides a possible pathway toward LLMs with genuine infinite-context understanding. The code is available at \href{https://github.com/Cominder/miniwin}{https://github.com/Cominder/miniwin}.

View on arXivView PDF

Code Implementations(1)

Cominder/miniwinOfficial100%
Apache-2.0

a mini infinite context language model

30PythonMar 31, 20265 months agoApache-2.0
language-modelperiodic-rope

Similar Papers

Cite this paper

@article{huo2026periodic,
  title  = {Periodic RoPE for Infinite Context LLMs},
  author = {Simin Huo},
  year   = {2026},
  eprint = {2605.27980},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.27980v1}
}

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

Discussion