paper-with-me

홈 › Papers

Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalization

2024-12-23 · Ermo Hua, Che Jiang, Xingtai Lv, Kaiyan Zhang, Ning Ding, Youbang Sun, Biqing Qi, Yuchen Fan, Xuekai Zhu, BoWen Zhou

Extending the context length of Language Models (LMs) by improving Rotary Position Embedding (RoPE) has become a trend. While existing works mainly address RoPE's limitations within attention mechanism, this paper provides an analysis across nearly all parts of LMs, uncovering their adverse effects on length generalization for RoPE-based attention. Using Discrete Signal Processing theory, we show that RoPE enables periodic attention by implicitly achieving Non-Uniform Discrete Fourier Transform. However, this periodicity is undermined by the spectral damage caused by: 1) linear layers and activation functions outside of attention; 2) insufficiently trained frequency components brought by time-domain truncation. Building on our observations, we propose Fourier Position Embedding (FoPE), which enhances attention's frequency-domain properties to improve both its periodic extension and length generalization. FoPE constructs Fourier Series and zero-outs the destructive frequency components, increasing model robustness against the spectrum damage. Experiments across various model scales and benchmarks show that, within varying context windows, FoPE maintains a more stable performance compared to RoPE and ALiBi. Several analyses and ablations bring further support to our method and theoretical modeling.

📄 PDF Abstract BibTeX arXiv:2412.17739

Code (1)

tsinghuac3i/fourier-position-embedding 공식 구현 pytorch

Tasks

Position

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
FoPE 설명 없음

Similar Papers 제목 키워드 기반

ClockRoPE: Random Fourier Rotations for Temporal Routine Modeling

2026-07-29 · Yiwen Chen, Joshua Ainslie, Krzysztof Choromanski, Xiang Gao 외 arxiv

Rotary Position Embedding (RoPE) has been widely adopted in transformer-based large language models. However, its log-linear frequency schedule, originally designed to produce long-term attention decay, limits its adopti…

Sequential Recommendation

Periodic Artifact Reduction in Fourier transforms of Full Field Atomic Resolution Images

2022-10-14 · Robert Hovden, Yi Jiang, Huolin L. Xin, Lena F. Kourkoutis

The discrete Fourier transform is among the most routine tools used in high-resolution scanning / transmission electron microscopy (S/TEM). However, when calculating a Fourier transform, periodic boundary conditions are …

FAN-Unet: Enhancing Unet with vision Fourier Analysis Block for Biomedical Image Segmentation

2024-11-28 · Jiashu Xu

Medical image segmentation is a critical aspect of modern medical research and clinical practice. Despite the remarkable performance of Convolutional Neural Networks (CNNs) in this domain, they inherently struggle to cap…

Image SegmentationMedical Image SegmentationSegmentationSemantic Segmentation

Fourier Neural Networks as Function Approximators and Differential Equation Solvers

2020-05-27 · Marieme Ngom, Oana Marin

We present a Fourier neural network (FNN) that can be mapped directly to the Fourier decomposition. The choice of activation and loss function yields results that replicate a Fourier series expansion closely while preser…

Edge effect removal in Fourier ptychographic microscopy via periodic plus smooth image decomposition

2020-09-07 · An Pan, Aiye Wang, Junfu Zheng, Yuting Gao 외

Fourier ptychographic microscopy (FPM) is a promising computational imaging technique with high resolution, wide field-of-view (FOV) and quantitative phase recovery. So far, a series of system errors that may corrupt the…