Lune

ICML2025Top-tier venue

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

Ermo Hua, Che Jiang, Xingtai Lv, Kaiyan Zhang, Youbang Sun, Yuchen Fan, Xuekai Zhu, Biqing Qi, Ning Ding, Bowen Zhou

Abstract

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 RoPEbased 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 AL-iBi. Several analyses and ablations bring further support to our method and theoretical modeling.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

12 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Deconstructing Positional Information: From Attention Logits to Training Biases cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Deconstructing Positional Information: From Attention Logits to Training Biases cites YaRN: Efficient Context Window Extension of Large Language Models
  • Deconstructing Positional Information: From Attention Logits to Training Biases cites The Impact of Positional Encoding on Length Generalization in Transformers
  • YaRN: Efficient Context Window Extension of Large Language Models cites The Impact of Positional Encoding on Length Generalization in Transformers
  • YaRN: Efficient Context Window Extension of Large Language Models cites Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
  • The Impact of Positional Encoding on Length Generalization in Transformers cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • MrRoPE: Mixed-radix Rotary Position Embedding cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • MrRoPE: Mixed-radix Rotary Position Embedding cites YaRN: Efficient Context Window Extension of Large Language Models
  • MrRoPE: Mixed-radix Rotary Position Embedding cites The Impact of Positional Encoding on Length Generalization in Transformers
  • MrRoPE: Mixed-radix Rotary Position Embedding cites Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
  • FoNE: Precise Single-Token Number Embeddings via Fourier Features cites Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional Domains
  • Causality-Induced Positional Encoding for Transformer-Based Representation Learning of Non-Sequential Features cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Extending the Context of Pretrained LLMs by Dropping Their Positional Embedding cites Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • Extending the Context of Pretrained LLMs by Dropping Their Positional Embedding cites YaRN: Efficient Context Window Extension of Large Language Models
  • Extending the Context of Pretrained LLMs by Dropping Their Positional Embedding cites The Impact of Positional Encoding on Length Generalization in Transformers
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers12

  1. FoNE: Precise Single-Token Number Embeddings via Fourier FeaturesTianyi Zhou, Deqing Fu, Mahdi Soltanolkotabi, Robin Jia et al.ICLR 2026 · 24 citations
  2. Extending the Context of Pretrained LLMs by Dropping Their Positional EmbeddingYoav Gelberg, Koshi Eguchi, Takuya Akiba, Edoardo CetinICLR 2026 · 13 citations
  3. Deconstructing Positional Information: From Attention Logits to Training BiasesZihan Gu, Ruoyu Chen, Han Zhang, Hua Zhang et al.ICLR 2026 · 4 citations
  4. Causality-Induced Positional Encoding for Transformer-Based Representation Learning of Non-Sequential FeaturesKaichen Xu, Yihang Du, Mianpeng Liu, Zimu Yu et al.NeurIPS 2025 · 4 citations
  5. MrRoPE: Mixed-radix Rotary Position EmbeddingQingyuan Tian, Wenhong Zhu, Xiaoran Liu, Xiaofeng Wang et al.ICLR 2026 · 3 citations

Builds on19

  1. Fourier Features Let Networks Learn High Frequency Functions in Low Dimensional DomainsMatthew Tancik, Pratul P. Srinivasan, Ben Mildenhall, Sara Fridovich-Keil et al.NeurIPS 2020 · 4,036 citations
  2. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
  3. Train Short, Test Long: Attention with Linear Biases Enables Input Length ExtrapolationOfir Press, Noah A. Smith, Mike LewisICLR 2022 · 1,168 citations
  4. YaRN: Efficient Context Window Extension of Large Language ModelsBowen Peng, Jeffrey Quesnelle, Honglu Fan, Enrico ShippoleICLR 2024 · 508 citations
  5. The Impact of Positional Encoding on Length Generalization in TransformersAmirhossein Kazemnejad, Inkit Padhi, Karthikeyan Natesan Ramamurthy, Payel Das et al.NeurIPS 2023 · 444 citations

Related papers

  1. HoPE: A Novel Positional Encoding Without Long-Term Decay for Enhanced Context Awareness and ExtrapolationYuhan Chen, Ang Lv, Jian Luan, Bin Wang et al.ACL 2025
  2. Wavelet-based Positional Representation for Long ContextYui Oka, Taku Hasegawa, Kyosuke Nishida, Kuniko SaitoICLR 2025
  3. AdaRoPE: Not All Attention Heads Should Rotate and Scale EquallyShaowen Wang, Yuke Zheng, Tansheng Zhu, Shuang Chen et al.ICML 2026
  4. Frequency Bands in RoPE: Base Frequency and Context Length Shape the Interpolation-Extrapolation Trade-offYui Oka, Itsumi Saito, Kyosuke Nishida, Kuniko SaitoICLR 2026
  5. LaMPE: Length-aware Multi-grained Positional Encoding for Adaptive Long-context Scaling Without TrainingSikui Zhang, Guangze Gao, Ziyun Gan, Chunfeng Yuan et al.ACL Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines