arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.14391cs.LGcs.AIcs.CL
收藏

RePo:具有上下文重定位的语言模型

RePo: Language Models with Context Re-Positioning

University of Maryland(马里兰大学)

Huayang Li, Tianyu Zhao, Deng Cai, Richard Sproat

AI总结:

提出RePo机制,通过可微分模块重新分配token位置以减轻注意力层负担,在噪声上下文、结构化数据和长上下文任务上持续提升性能。

摘要:

上下文学习是现代大型语言模型(LLM)的基础;然而,主流架构通过分配线性或常数的位置索引来施加刚性且固定的上下文结构。刚性的位置信息将组织输入结构的全部负担强加给注意力层,从而减少了可用于更关键信息的注意力量。为了解决这个问题,我们提出了RePo,一种通过上下文重定位来减轻注意力层负担的新机制。与传统方法不同,RePo利用可微分模块$f_ϕ$来分配捕获上下文依赖关系的token位置,而不是依赖预定义的顺序。通过在OLMo-2 1B和7B模型上持续预训练,我们证明RePo在涉及噪声上下文、结构化数据和更长上下文长度的任务上持续提升性能,同时在一般短上下文任务上保持有竞争力的性能。分析表明,RePo成功地将更多注意力分配给遥远但相关的信息,在密集且非线性的空间中分配位置,并捕获输入上下文的内在结构。我们的代码位于https://github.com/SakanaAI/repo。

英文摘要:

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. The rigid position information poses the full burden of organizing the input structure to attention layers, thus reducing the amount of attention that could be allocated for more critical information. To address this, we propose RePo, a novel mechanism that alleviates the burden for attention layers via context re-positioning. Unlike conventional approaches, RePo utilizes a differentiable module, $f_ϕ$, to assign token positions that capture contextual dependencies, rather than replying on pre-defined order. By continually pre-training on the OLMo-2 1B \& 7B models, we demonstrate that RePo consistently enhances performance on tasks involving noisy contexts, structured data, and longer context length, while maintaining competitive performance on general short-context tasks. Analysis reveals that RePo successfully allocates more attention mass to distant but relevant information, assigns positions in a dense and non-linear space, and captures the intrinsic structure of the input context. Our code is at https://github.com/SakanaAI/repo.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑