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

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

Valeria Ruscio, Umberto Nanni, Fabrizio Silvestri

Abstract

This paper explores the emergent behavior of Transformers utilizing Rotary Position Embeddings (RoPE), revealing that they spontaneously organize attention heads into a multi-resolution framework mimicking a discrete wavelet transform. This self-organization allows models to navigate the Heisenberg-Gabor uncertainty principle, balancing positional precision with frequency resolution. Our analysis across various state-of-the-art models demonstrates that this wavelet-like structure is a mathematically precise characterization of RoPE-based attention, explaining their robustness to varying sequence lengths.

Introduction

Position encoding is fundamental to a Transformer's ability to process sequential data. While Rotary Position Embeddings (RoPE) have become the standard in models like LLaMA and Mistral, they face a theoretical hurdle: the Heisenberg-Gabor uncertainty principle. In signal processing, achieving high resolution in both the time (position) and frequency domains simultaneously is mathematically constrained. For RoPE, this implies a trade-off between precise local positioning and broad global context. This study investigates how RoPE-equipped models overcome these constraints in practice.

Methods

The researchers treated Transformer attention patterns as signals, applying several signal-processing techniques:

  • Frequency Analysis: Discrete Fourier Transforms (DFT) were used to categorize attention heads into low, mid, and high frequency bands.
  • Wavelet Analysis: Daubechies-2 (db2) wavelets were employed to decompose attention patterns, providing localization in both time and frequency.
  • Uncertainty Quantification: Positional and spectral entropy were measured to calculate the correlation ($\rho$) between spatial and frequency focus.
  • Scale Invariance Testing: The stability of internal representations was tested by downsampling input sequences.
  • Evolutionary Analysis: Metrics were tracked across Pythia model training checkpoints to observe the emergence of these properties.

The Multi-Resolution Toolkit

Attention heads do not function uniformly; instead, they specialize into a multi-resolution "toolkit." Low-frequency heads typically form a "contextual backbone," while high-frequency heads focus on fine-grained, local syntactic details. This specialization is not hard-coded but evolves during training to maximize information capture within architectural constraints.

Figure 3: Average band power across layers shows the specialization of frequency bands as the model depth increases.

Training follows a distinct trajectory: an initial "exploratory phase" characterized by high spectral entropy and low selectivity, followed by a "specialization phase" where heads settle into their specific functional niches. Notably, RoPE is unique among encoding schemes (compared to T5 or BERT) in developing these robust, scale-invariant wavelet properties.

Key Results

The study confirms that RoPE-based models effectively navigate the physical constraints of the uncertainty principle. Every model analyzed showed a consistent negative position-spectrum correlation ($\rho$). Furthermore, the models exhibited remarkably low sensitivity to sequence rescaling, maintaining performance even when the input scale changed significantly.

Figure 4: Quantitative metrics across various models, showing scale sensitivity, position-spectrum correlation, and reconstruction error.

One of the most striking findings is the reconstruction accuracy: original attention patterns can be reconstructed from wavelet coefficients with an error rate ($\mu$) as low as $10^{-7}$. This confirms that the wavelet description is a mathematically precise model of Transformer attention behavior.

Discussion and Future Work

While these findings provide a new lens for understanding RoPE, the analysis was primarily limited to English-language models. Future research should investigate if these wavelet properties emerge in multilingual models or other modalities like vision and audio. Additionally, the discovery of the "exploratory phase" suggests that pre-initializing attention heads with wavelet-like bases could potentially accelerate training by bypassing inefficient early stages.

Summary updated

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