atlas

Research map / Architectures and efficiency / Attention and transformers

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

ICML 2025 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Fourier Position Embedding (FoPE), which replaces each RoPE dimension with a Fourier series of frequencies and zeroes out under-trained low frequencies, improving length generalization of pre-trained and fine-tuned LMs.

Problem

RoPE-based language models fail to length-generalize because the periodic extension of attention is damaged by spectral distortion from linear/activation layers and by under-trained low-frequency components from finite-length truncation.

Approach

Model RoPE as a non-uniform discrete Fourier transform, then give each attention dimension a Fourier series (dominant frequency plus learned harmonics with random small coefficients) and set frequencies below the floor 2π/N to zero, with the harmonic weights implemented as fixed (non-trained) matrices.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace RoPE with FoPESmolLM-1.7B · GovReport, MultiNews, TREC and SAMSum across 0-4k, 4-8k and 8k+; TriviaQA 8k+score: GovReport: +0.25, +1.15, +0.36; MultiNews: +0.21, +1.87, +1.38; TREC: +4.00, +14.0, +15.0; SAMSum: +9.50, +9.48, +8.87; Helped
Replace RoPE with FoPESmolLM-1.7B · TriviaQA 0-4k and 4-8kscore: TriviaQA 0-4k: ↓3.24; 4-8k: ↓2.49Hurt
Add Fourier Series (FS) to FoPE (ablation)60M FoPE model · Gutenberg Books; length generalizationperplexity and Passkey Retrieval accuracyHelped
Clip the floor frequency to zero (CF) (ablation)60M FoPE model · Gutenberg Books; current dataset and sequence lengthperplexityHelped
Combine Fourier Series and Clip Floor to Zero (ablation)60M FoPE model · Gutenberg Books; length generalizationperplexity and Passkey Retrieval accuracyHelped
Increase attention-head dimension (ablation)FoPE · Gutenberg Books; length generalizationperplexity and Passkey Retrieval accuracyHelped
Increase the number of attention heads or layers (ablation)FoPE · Gutenberg Books; length generalizationperplexity and Passkey Retrieval accuracyHurt
Set the variance σ of frequency coefficients to 0.3 (ablation)60M FoPE model with D=16 · Gutenberg Books; longer contextsperplexityHelped
Set the number D of sampled frequencies to 64 (ablation)60M FoPE model with σ=0.3 · Gutenberg BooksPasskey Retrieval accuracyHelped
Vary D from 16 to 128 (ablation)FoPE · Gutenberg BooksperplexityNo clear effect
Apply QK_Norm (ablation)RoPE · Toy models; sequence lengths 512, 1024, 2048, 4096 and 8192loss: 5.50 -> 5.46; 6.01 -> 5.56; 6.58 -> 5.89; 6.99 -> 6.32; 7.16 -> 6.66Helped
Apply QK_Norm (ablation)RoPE-A · Toy models; sequence lengths 512, 1024, 2048, 4096 and 8192loss: 5.72 -> 5.69; 5.86 -> 5.89; 6.18 -> 6.27; 6.46 -> 6.59; 6.67 -> 6.81Mixed

Surprising findings

Limitations

Experimental setup

Datasets: C4 Gutenberg Books GovReport MultiNews TREC TriviaQA SAMSum Passkey Retrieval

Benchmarks: Passkey Retrieval GovReport MultiNews TREC TriviaQA SAMSum MMLU PIQA HellaSwag ARC Easy

Metrics: perplexity accuracy cross-entropy loss ROUGE

Baselines: RoPE ALiBi NoPE KERPLE FIRE YaRN RoPE-A

Builds on: RoPE ALiBi YaRN OLMo SmolLM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy