Paper: 2602.05258 Authors: Haoran Li, Sucheng Ren, Alan Yuille, Feng Wang Categories: cs.CL, cs.AI, cs.LG

Abstract

CoPE applies soft clipping to low-frequency components of Rotary Positional Embedding (RoPE), addressing out-of-distribution issues and improving semantic signal quality. The method prevents spectral leakage caused by hard clipping and demonstrates performance improvements scaling to 256k context length, establishing a new state-of-the-art for length generalization.

Key Contributions

  • Soft clipping for RoPE: A simple modification to low-frequency components that eliminates outliers
  • Spectral leakage prevention: Avoids artifacts from hard clipping approaches
  • 256k context generalization: New state-of-the-art for length generalization
  • Free lunch: No additional training cost or architectural changes required

Background: RoPE and Long Context

Rotary Positional Embedding (RoPE) encodes position information by rotating query and key vectors at frequencies determined by their position. Different frequency components capture different scales of positional information:

  • High-frequency components: Capture local, fine-grained positional relationships
  • Low-frequency components: Capture long-range, global positional relationships

When extending to longer contexts than seen during training, the low-frequency components encounter out-of-distribution values, causing attention degradation.

The CoPE Approach

CoPE applies soft clipping to the low-frequency components of RoPE. This achieves two goals:

  1. Mitigates OOD issues: Prevents low-frequency components from taking extreme values at unseen positions
  2. Improves semantic signals: Eliminates outliers that corrupt attention patterns

Why Soft Clipping?

Previous approaches used hard clipping (e.g., NTK-aware scaling, YaRN), but hard clipping introduces spectral leakage — discontinuities that create artifacts in the frequency domain. Soft clipping provides a smooth transition that preserves signal quality.

Results

  • State-of-the-art length generalization up to 256k context length
  • No additional training cost — works as a drop-in modification
  • Compatible with existing RoPE-based models
  • Code, data, and models publicly available

Why This Matters

  1. Free lunch: Performance improvement with zero additional compute cost
  2. Principled approach: Grounded in signal processing theory (spectral leakage prevention)
  3. Practical deployment: Drop-in replacement for existing RoPE implementations
  4. Scaling enabler: Unlocks longer context windows without retraining

论文: 2602.05258 作者: Haoran Li, Sucheng Ren, Alan Yuille, Feng Wang 分类: cs.CL, cs.AI, cs.LG

摘要

CoPE对旋转位置编码(RoPE)的低频分量应用软裁剪,解决分布外问题并提高语义信号质量。该方法防止了硬裁剪导致的频谱泄漏,在256k上下文长度上展示了性能提升,建立了长度泛化的新最先进水平。

主要贡献

  • RoPE软裁剪:对低频分量的简单修改,消除异常值
  • 防止频谱泄漏:避免硬裁剪方法产生的伪影
  • 256k上下文泛化:长度泛化的新最先进水平
  • 免费午餐:无需额外训练成本或架构更改

背景:RoPE与长上下文

旋转位置编码(RoPE)通过以位置决定的频率旋转查询和键向量来编码位置信息。不同的频率分量捕获不同尺度的位置信息:

  • 高频分量:捕获局部、细粒度的位置关系
  • 低频分量:捕获长距离、全局的位置关系

当扩展到训练时未见过的更长上下文时,低频分量遇到分布外的值,导致注意力退化。

CoPE方法

CoPE对RoPE的低频分量应用软裁剪。这实现了两个目标:

  1. 缓解OOD问题:防止低频分量在未见位置取极端值
  2. 改善语义信号:消除破坏注意力模式的异常值

为什么是软裁剪?

之前的方法使用硬裁剪(如NTK感知缩放、YaRN),但硬裁剪引入频谱泄漏——不连续性在频域中产生伪影。软裁剪提供平滑过渡,保持信号质量。

实验结果

  • 最先进的长度泛化,达到256k上下文长度
  • 无额外训练成本——作为即插即用修改
  • 与现有基于RoPE的模型兼容
  • 代码、数据和模型公开可用

重要意义

  1. 免费午餐:零额外计算成本的性能提升
  2. 有原则的方法:基于信号处理理论(频谱泄漏防止)
  3. 实际部署:现有RoPE实现的即插即用替代
  4. 扩展使能:无需重新训练即可解锁更长的上下文窗口