WavePrune: One period is often enough for RoPE
cs.CL, cs.SD
Submitted: 2026-10-03
Updated: 2026-10-03
Code: https://github.com/ducatiqwq/WavePrune
License: http://creativecommons.org/licenses/by/4.0/
The gist: Rotary Position Embedding (RoPE) encodes token positions by rotating each two-dimensional channel of the query and key vectors at a channel-specific frequency, making the attention logits invariant
Abstract
Rotary Position Embedding (RoPE) encodes token positions by rotating each two-dimensional channel of the query and key vectors at a channel-specific frequency, making the attention logits invariant to a common shift of positions. However, this rotation is periodic, and it leads to position aliasing where relative positions separated by a full rotation period become hard to tell apart. To address this, we propose WavePrune, which restricts each channel to its first rotation period. We show that it removes the distractions in attention maps created by position aliasing and improves overall long-context performance. Specifically, WavePrune raises the HELMET score on four of five models we test without any extra tuning (e.g., 35.7 -> 40.0 on Qwen3-8B). When pretraining models from scratch, WavePrune also achieves lower validation loss at extrapolated lengths than pretraining without it. Because WavePrune restricts each channel to a sliding window, it induces a fine-grained sparsity that our hardware-aligned CUDA kernels exploit for 1.15x prefill and 1.24x decoding speedups over FlashAttention-2 at 32K context. Together, these results show that RoPE's periodic structure, widely regarded as essential, is largely redundant beyond the first rotation period.
Sources
- Program Synthesis with Large Language Models
- Longformer: The Long-Document Transformer
- Evaluating Large Language Models Trained on Code
- Extending Context Window of Large Language Models via Positional Interpolation
- Generating Long Sequences with Sparse Transformers
- LongNet: Scaling Transformers to 1,000,000,000 Tokens
- RoPE Distinguishes Neither Positions Nor Tokens in Long Contexts, Provably
- The Llama 3 Herd of Models
- ATFlash: Per-RoPE-Wavelength Attention Windows for Compute/Memory-Efficient LLM Inference
- CoPE: Clipped RoPE as A Scalable Free Lunch for Long Context LLMs
- Ministral 3
- Challenging BIG-Bench Tasks and Whether Chain-of-Thought Can Solve Them
- Gemma 3 Technical Report
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering