RePo: Language Models with Context Re-Positioning

Huayang Li, Tianyu Zhao, Richard Sproat
12/16/2025
cs.LGcs.AIcs.CL

Official code: SakanaAI/repo (83 stars, last commit 2026-03-30). 1 more implementation below.

Abstract

In-context learning is fundamental to modern Large Language Models (LLMs); however, prevailing architectures impose a rigid and fixed contextual structure by assigning linear or constant positional indices. Drawing on Cognitive Load Theory (CLT), we argue that this uninformative structure increases extraneous cognitive load, consuming finite working memory capacity that should be allocated to deep reasoning and attention allocation. To address this, we propose RePo, a novel mechanism that reduces extraneous load via context re-positioning. Unlike standard approaches, RePo utilizes a differentiable module, $f_φ$, to assign token positions that capture contextual dependencies, rather than replying on pre-defined integer range. By continually pre-training on the OLMo-2 1B backbone, we demonstrate that RePo significantly enhances performance on tasks involving noisy contexts, structured data, and longer context length, while maintaining competitive performance on general short-context tasks. Detailed analysis reveals that RePo successfully allocate higher attention to distant but relevant information, assign positions in dense and non-linear space, and capture the intrinsic structure of the input context. Our code is available at https://github.com/SakanaAI/repo.

View on arXivView PDF

Code Implementations(2)

SakanaAI/repoOfficial100%

RePo: Language Models with Context Re-Positioning

839C, C++Nov 6, 20256 months ago
MIT

RePo: Language Models with Context Re-Positioning by Sakana AI

00PythonJan 20, 20269 months agoMIT
aillmpositional-encodingtransformers

Similar Papers

Cite this paper

@article{li2025repo,
  title  = {RePo: Language Models with Context Re-Positioning},
  author = {Huayang Li and Tianyu Zhao and Richard Sproat},
  year   = {2025},
  eprint = {2512.14391},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.14391v1}
}

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

Discussion