arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.07678cs.LG
收藏

数据如何塑造RoPE频率使用:从位置尺度匹配到长度泛化

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

MIT IDSS(麻省理工学院信息系统与决策科学实验室);IIIS, Tsinghua University(清华大学交叉信息研究院)

Xinyi Wu, Siyuan Liu, Ali Jadbabaie

AI总结:

研究RoPE频率使用不均匀的原因,提出数据诱导依赖决定频率使用,最佳频率与1/W成比例,该原则解释了相关观察,还将频率选择与长度泛化联系,表明自然语言有自相似性,长上下文泛化取决于两种尺度匹配。

摘要:

旋转位置嵌入(RoPE)为Transformer提供了固定的位置频率网格,但训练模型对这些频率的使用极不均匀。我们研究了决定这种频率使用的因素,并提出了一种以数据为中心的解释:RoPE频率是为了匹配训练数据的相对距离结构而选择的。将每个频率视为一个位置透镜,我们形式化了场分辨率的权衡,并表明,对于宽度为W的数据诱导依赖配置文件,最佳频率与1/W成比例。这种频率匹配原则解释了对合成数据和基于文本的数据的控制观察结果,并表明语言模型中观察到的中低频带源于自然语言的多尺度依赖结构。我们进一步将频率选择与基于位置插值的长度泛化联系起来:降低频率会扩大有效场,同时降低分辨率。当更长上下文的依赖关系是训练期间观察到的依赖关系的近似扩张时,这会有所帮助,但当相关依赖关系不随上下文长度缩放时,可能会失败。从经验上看,我们表明自然语言在位置尺度上表现出近似的自相似性,这解释了为什么测试时频率缩放可以支持长上下文泛化。总的来说,我们的结果确定了RoPE频率使用出现背后的数据驱动机制,并表明长上下文泛化取决于两种形式的尺度匹配:学习频率与训练时依赖关系之间的匹配,以及频率缩放与这些依赖关系如何扩展到更长上下文之间的匹配。

英文摘要:

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 a data-centered explanation: RoPE frequencies are selected to match the relative-distance structure of the training data. Viewing each frequency as a positional lens, we formalize a field-resolution tradeoff and show that, for a data-induced dependency profile of width $W$, the optimal frequency scales as $1/W$. This frequency-matching principle explains controlled observations on synthetic and text-based data, and suggests that the mid-low frequency bands observed in language models arise from the multi-scale dependency structure of natural language. We further connect frequency selection to position-interpolation-based length generalization: scaling frequencies down expands the effective field while reducing resolution. This helps when longer-context dependencies are approximate dilations of those seen during training, but can fail when relevant dependencies do not scale with context length. Empirically, we show that natural language exhibits approximate self-similarity across positional scales, explaining why test-time frequency scaling can support long-context generalization. Overall, our results identify a data-driven mechanism behind emergent RoPE frequency usage and show that long-context generalization depends on two forms of scale matching: between learned frequencies and training-time dependencies, and between frequency scaling and how those dependencies extend to longer contexts.

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

↑