paper-with-me

Papers

Resonance RoPE: Improving Context Length Generalization of Large Language Models

2024-02-29 · Suyuchen Wang, Ivan Kobyzev, Peng Lu, Mehdi Rezagholizadeh, Bang Liu

This paper addresses the challenge of train-short-test-long (TSTL) scenarios in Large Language Models (LLMs) equipped with Rotary Position Embedding (RoPE), where models pre-trained on shorter sequences face difficulty with out-of-distribution (OOD) token positions in longer sequences. We introduce Resonance RoPE, a novel approach designed to narrow the generalization gap in TSTL scenarios by refining the interpolation of RoPE features for OOD positions, significantly improving the model performance without additional online computational costs. Furthermore, we present PosGen, a new synthetic benchmark specifically designed for fine-grained behavior analysis in TSTL scenarios, aiming to isolate the constantly increasing difficulty of token generation on long contexts from the challenges of recognizing new token positions. Our experiments on synthetic tasks show that after applying Resonance RoPE, Transformers recognize OOD position better and more robustly. Our extensive LLM experiments also show superior performance after applying Resonance RoPE to the current state-of-the-art RoPE scaling method, YaRN, on both upstream language modeling tasks and a variety of downstream long-text applications.

📄 PDF Abstract BibTeX arXiv:2403.00071

Code (1)

sheryc/resonance_rope 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingPosition

Similar Papers 제목 키워드 기반

Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalization

2024-12-23 · Ermo Hua, Che Jiang, Xingtai Lv, Kaiyan Zhang 외

Extending the context length of Language Models (LMs) by improving Rotary Position Embedding (RoPE) has become a trend. While existing works mainly address RoPE's limitations within attention mechanism, this paper provid…

Position

Length Generalization of Causal Transformers without Position Encoding

2024-04-18 · Jie Wang, Tao Ji, Yuanbin Wu, Hang Yan 외

Generalizing to longer sentences is important for recent Transformer-based language models. Besides algorithms manipulating explicit position features, the success of Transformers without position encodings (NoPE) provid…

Language ModelingLanguage ModellingPositionRetrieval

Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models

2025-11-28 · Xiang Hu, Zhanchao Zhou, Ruiqi Liang, Zehuan Li 외 arxiv

This work explores the challenge of building ``Machines that Can Remember'', framing long-term memory as the problem of efficient ultra-long context modeling. We argue that this requires three key properties: \textbf{spa…

How Data Shapes RoPE Frequency Usage: From Positional Scale Matching to Length Generalization

2026-07-08 · Xinyi Wu, Siyuan Liu, Ali Jadbabaie arxiv

Rotary Position Embeddings (RoPE) provide transformers with a fixed grid of positional frequencies, yet trained models use these frequencies highly non-uniformly. We study what determines this frequency usage and propose…

CoPE: Clipped RoPE as A Scalable Free Lunch for Long Context LLMs

2026-02-05 · Haoran Li, Sucheng Ren, Alan Yuille, Feng Wang arxiv

Rotary Positional Embedding (RoPE) is a key component of context scaling in Large Language Models (LLMs). While various methods have been proposed to adapt RoPE to longer contexts, their guiding principles generally fall…