arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.01258cs.LGcs.CLeess.SP
收藏

超越正弦波:基于Morlet小波的Transformer位置编码框架

Beyond Sinusoids: A Morlet Wavelet Framework for Transformer Positional Encoding

Independent Researcher(独立研究者);Athens, Greece(希腊雅典)

Athanasios Zeris

AI总结:

提出Morlet位置编码(MoPE),通过可学习的频率和局部带宽统一了正弦位置编码和旋转位置编码,并在TinyShakespeare上结合能量门控注意力提升了0.119的性能。

摘要:

标准Transformer位置编码——正弦编码和旋转位置编码(RoPE)——将每个位置视为同等局部:它们编码了标记的位置,但未编码其位置影响应延伸多远。我们提出Morlet小波(同时最小化位置和频率的不确定性)是位置编码的自然基础,并引入Morlet位置编码(MoPE):每个嵌入维度从数据中学习其自身的频率和局部带宽。主要理论结果是统一:当局部性关闭时(sigma_i -> 无穷大),正弦PE和RoPE相关核都作为MoPE的极限情况出现。MoPE的相位精确恢复了RoPE旋转角度;幅度增加了一个标准编码所缺乏的可学习高斯局部核。实验上,MoPE结合能量门控注意力在TinyShakespeare上比标准注意力提升了0.119,优于任一单独组件。对学习参数的分析显示,所有128个频率-带宽对收敛到小波可容许边界——这一经验观察与关于能量门控的伴随结果一致,表明字符级语言信号的一个可重现性质,值得进一步研究。

英文摘要:

Standard positional encodings for transformers - sinusoidal and rotary (RoPE) - treat every position as equally local: they encode where a token is, but not how far its positional influence should extend. We propose that the Morlet wavelet, which simultaneously minimises uncertainty in position and frequency, is the natural basis for positional encoding, and introduce Morlet Positional Encoding (MoPE): each embedding dimension learns its own frequency and locality bandwidth from data. The main theoretical result is a unification: sinusoidal PE and the RoPE correlation kernel both emerge as limiting cases of MoPE when locality is switched off (sigma_i -> infinity). The phase of MoPE recovers the RoPE rotation angle exactly; the amplitude adds a learned Gaussian locality kernel that standard encodings lack. Empirically, MoPE combined with Energy-Gated Attention achieves +0.119 improvement over standard attention on TinyShakespeare, outperforming either component alone. Analysis of the learned parameters reveals that all 128 frequency-bandwidth pairs converge to the wavelet admissibility boundary - an empirical observation consistent with a companion result on energy gating, suggesting a reproducible property of character-level language signals that warrants further investigation.

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

↑