CoPE: Clipped RoPE as A Scalable Free Lunch for Long Context LLMs
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 into two categories: (1) out-of-distribution (OOD) mitigation, which scales RoPE frequencies to accommodate unseen positions, and (2) Semantic Modeling, which posits that the attention scores computed with RoPE should always prioritize semantically similar tokens. In this work, we unify these seemingly distinct objectives through a minimalist intervention, namely CoPE: soft clipping lowfrequency components of RoPE. CoPE not only eliminates OOD outliers and refines semantic signals, but also prevents spectral leakage caused by hard clipping. Extensive experiments demonstrate that simply applying our soft clipping strategy to RoPE yields significant performance gains that scale up to 256k context length, validating our theoretical analysis and establishing CoPE as a new state-of-the-art for length generalization. Our code, data, and models are available at https://github.com/hrlics/CoPE.
69857dc74ad556f294b7ec72
Haoran Li
claimed_verified
2026-02-06T18:50:51.426Z
6877291f2ae5ca930a86bb18
https://cdn-avatars.huggingface.co/v1/production/uploads/6877291f2ae5ca930a86bb18/QPYZvZmLyZw2axm4MtsAs.jpeg
Haoran Li
haoranli-ml
user
haoranli-ml
69857dc74ad556f294b7ec73
Sucheng Ren
69857dc74ad556f294b7ec74
Alan Yuille
69857dc74ad556f294b7ec75
Feng Wang
CoPE: Clipped RoPE as A Scalable Free Lunch for Long Context LLMs
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 into two categories: (1) out-of-distribution (OOD) mitigation, which scales RoPE frequencies to accommodate unseen positions, and (2) Semantic Modeling, which posits that the attention scores computed with RoPE should always prioritize semantically similar tokens. In this work, we unify these seemingly distinct objectives through a minimalist intervention, namely CoPE: soft clipping lowfrequency components of RoPE. CoPE not only eliminates OOD outliers and refines semantic signals, but also prevents spectral leakage caused by hard clipping. Extensive experiments demonstrate that simply applying our soft clipping strategy to RoPE yields significant performance gains that scale up to 256k context length, validating our theoretical analysis and establishing CoPE as a new state-of-the-art for length generalization. Our code, data, and models are available at https://github.com/hrlics/CoPE.
CoPE introduces a soft clipping method for Rotary Positional Embedding that unifies out-of-distribution mitigation and semantic modeling while enabling effective long-context processing up to 256k length.
Rotary Positional Embedding context scaling Large Language Models out-of-distribution mitigation Semantic Modeling attention scores spectral leakage soft clipping length generalization