NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Beyond Position: the emergence of wavelet-like properties in Transformers

Valeria Ruscio, Fabrizio Silvestri, Silvestri, Fabrizio · DOI

Abstract

This paper studies how Transformer models with Rotary Position Embeddings (RoPE) develop emergent, wavelet-like properties that compensate for the positional encoding's theoretical limitations. Through an analysis spanning model scales, architectures, and training checkpoints, we show that attention heads evolve to implement multi-resolution processing analogous to wavelet transforms. We demonstrate that this scale-invariant behavior is unique to RoPE, emerges through distinct evolutionary phases during training, and statistically adheres to the fundamental uncertainty principle. Our findings suggest that the effectiveness of modern Transformers stems from their remarkable ability to spontaneously develop optimal, multi-resolution decompositions to address inherent architectural constraints.

Introduction

In the architecture of Transformers, understanding the relative position of tokens is as vital as the tokens' semantic content. Rotary Position Embeddings (RoPE) have become the industry standard for this task, utilized in prominent models such as LLaMA and Mistral. However, signal processing theory posits a fundamental "paradox": an inherent trade-off exists between positional precision and frequency resolution, similar to the Heisenberg Uncertainty Principle. This research investigates whether Transformers have bypassed this limitation by evolving attention heads to function as wavelets—mathematical functions that provide an optimal balance between time and frequency.

Methods

The researchers conducted a comprehensive analysis of the internal states of several popular Large Language Models (LLMs) using the following techniques:

  • Frequency Analysis: Discrete Fourier Transforms (DFT) were used to identify the spectral specialization (low, mid, or high frequency) of attention heads.
  • Wavelet Decomposition: Attention patterns were mathematically reconstructed using Daubechies-2 (db2) wavelets to verify their wavelet-like nature.
  • Uncertainty Quantification: The correlation between positional entropy and spectral entropy was measured to assess adherence to the Heisenberg-Gabor uncertainty principle.
  • Evolutionary Tracking: The Pythia model family was analyzed across training checkpoints (from step 0 to 143,000) to observe the emergence of these properties.
  • Ablation Studies: RoPE was compared against T5 (relative bias), BERT (absolute embeddings), and "No Position Encoding" configurations.

Datasets

The study evaluated pre-trained models on a curated sample of 500 sequences from Wikipedia. The models analyzed included Gemma 2 (2B), Pythia (2.8B, 6.9B, 12B), LLaMA-3.2 (1B), LLaMA-3.1 (8B), Mistral (7B), and Qwen 2.5.

Key Insights

The Wavelet Packet Strategy

Attention heads do not act uniformly; they divide and conquer. Low-frequency heads handle the "contextual backbone" (global dependencies), while high-frequency heads focus on "fine-grained details" (local syntax). This specialization allows for multi-resolution signal processing.

Implicit Learning of the Uncertainty Principle

The models statistically obey the Heisenberg-Gabor uncertainty principle. As a head becomes more precise in its positioning, its frequency resolution naturally blurs, and vice versa. The model manages this by diversifying these strategies across different heads.

Training Phases and Scale Invariance

The emergence of these properties is non-linear, progressing from an "Exploratory Phase" to a "Specialization Phase." RoPE is uniquely scale-invariant; unlike BERT or T5, RoPE models maintain their internal structure when sequence lengths change because their wavelet-like heads naturally adapt to signal dilation.

Key Results

Comparative Performance of Positional Encodings

Ablation studies demonstrate that wavelet-like behavior and scale invariance are unique to RoPE. As shown in the table below, RoPE-based models exhibit significantly lower scale sensitivity compared to BERT and T5.

Comparison of positional encoding types across spectral and sensitivity metrics.

Frequency Distribution Across Layers

In mature models like Pythia 12B, low-frequency components capture 60–80% of the spectral power, forming the global understanding, while mid and high frequencies handle the remaining 20-40% for local precision. This distribution evolves across the model's layers.

Evolution of average band power (Low, Mid, High) across model layers.

Reconstruction Accuracy

Using inverse wavelet transforms, attention patterns were reconstructed with a tiny mean error of approximately $1.2 \times 10^{-7}$. This confirms that the wavelet description is a mathematically precise characterization of the model's operation.

Limitations and Future Work

The study focused exclusively on English text. Future research should investigate if Vision Transformers (ViTs) or audio models develop similar wavelet properties. Additionally, identifying the exact triggers for the transition between training phases could enable the design of more efficient architectures pre-initialized with wavelet properties.

Summary updated

BibTeX
@inproceedings{ruscio2025beyond,
  author = {Valeria Ruscio and Fabrizio Silvestri and Silvestri, Fabrizio},
  title = {{Beyond Position: the emergence of wavelet-like properties in Transformers}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure