CoPE:剪裁RoPE作为长上下文LLM的可扩展免费午餐
CoPE: Clipped RoPE as A Scalable Free Lunch for Long Context LLMs
AI总结:
CoPE通过软剪裁RoPE的低频成分,有效提升长上下文LLM的性能,实现可扩展的免费午餐。
摘要:
旋转位置嵌入(RoPE)是大型语言模型(LLM)上下文扩展中的关键组件。尽管已提出多种方法来适应更长的上下文,但其指导原则通常分为两类:(1)分布外(OOD)缓解,即通过扩展RoPE频率来适应未见位置;(2)语义建模,即认为通过RoPE计算的注意力分数应始终优先考虑语义相似的令牌。在本工作中,我们通过一种极简的干预,即CoPE:对RoPE的低频成分进行软剪裁,统一了这些看似不同的目标。CoPE不仅消除了OOD异常值并优化了语义信号,还防止了由硬剪裁引起的频谱泄漏。广泛实验表明,仅将我们的软剪裁策略应用于RoPE即可获得显著的性能提升,甚至在256k上下文长度上也能扩展,验证了我们的理论分析,并将CoPE确立为长度泛化的新状态-of-the-art。我们的代码、数据和模型可在https://github.com/hrlics/CoPE上获取。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。