Skip to content

FourierQK: Spectral Preprocessing of Query-Key Projections Improves Transformer Attention

Jul 2026 · arXiv.org · Vol abs/2607.07478 · 0 citations · 17 references
Computer Science Engineering

TL;DR

FFT-based spectral preprocessing of learned query-key (Q/K) projections substantially improves transformer attention on character-level language modelling and defines an architectural boundary between bilateral spectral attention and genuinely causal spectral attention at word-scale tokenisation.

Abstract

FFT-based spectral preprocessing of learned query-key (Q/K) projections substantially improves transformer attention on character-level language modelling. On TinyShakespeare: a fixed random spectral filter achieves val=1.031 (Delta=+0.443); a single learned frequency at paragraph scale achieves val=0.608 (Delta=+0.867); and four learned frequencies spanning paragraph to word scale achieve val=0.309 (Delta=+1.166), a 79% reduction over standard dot-product attention. The single-frequency result is confirmed across three random seeds (mean val=0.236, std=0.019). The four frequencies converge to a near-geometric multi-scale ordering (49, 27, 10, 6 tokens/cycle) corresponding to paragraph, sub-paragraph, phrase, and word scales. The gain is specific to spectral preprocessing: random orthogonal and non-orthogonal projections of Q/K produce no measurable improvement, suggesting the benefit comes from global frequency-domain mixing rather than metric distortion. All results are verified by a shuffled-validation diagnostic against positional leakage. Causal filters (Gaussian, Mexican Hat, Morlet) do not improve over standard attention at character-level tokenisation: the bilateral FFT kernel is structurally non-causal, coupling every position to future tokens. This defines an architectural boundary between bilateral spectral attention (this paper) and genuinely causal spectral attention at word-scale tokenisation (companion paper MorletQK). This work is architecturally distinct from FNet (Lee-Thorp et al., 2021), which replaces attention with Fourier mixing of token embeddings. Here, spectral preprocessing applies only to Q/K projections while the full attention score structure is preserved.

View source

Similar papers

#natural language process... Preprint Sep 2026

Structured Transforms for Low-Overhead Quantization of Language Models

The proposed greedy algorithm with alternating updates guarantees the four-peak distribution required for stable 2-bit clustering of each factor and admits closed-form initialization of cluster centers, removing the multi-restart k-means bottleneck of prior work.

Daria Cherniuk, A. Rudikov, B. Kashin et al. · 0 citations
Open access Aug 2026

SwiftQK: Fast and Communication-Efficient Tensor Parallelism for Query-Key Normalization

SwiftQK is presented, a multi-GPU RMSNorm kernel that exchanges only scalar normalization statistics and overlaps the remaining Peer-to-Peer reduction with independent element-wise computation in a deadlock-safe persistent kernel.

Gyudong Kim, Wonjun Han, Young Geun Kim · 0 citations
Preprint Aug 2026

TransRetrieval: Scaling Up Transformer-Based Retrieval for Industrial Recommendation

TransRetrieval is presented, a Transformer-based retrieval framework that scales with both computational budget and cross-domain data and introduces weighted average aggregation, which restores the homogeneous-token assumption Transformers rely on, and target token compression that cuts per-candidate FLOPs while preser...

Zhi-Fei Zheng, Yun-Fei Liu, Bin Liu et al. · 0 citations
Preprint Aug 2026

Sparse PPMI Graph Averaging for Random Indexing Embeddings

A specific sparse post-processing pipeline for Random Indexing on kinship analogies in a small fairytales corpus is studied; the results do not establish a generally effective embedding method.

S. Loganathan, Gokul Anand, A. B. Bo et al. · 0 citations
Preprint Aug 2026

ATFlash: Per-RoPE-Wavelength Attention Windows for Compute/Memory-Efficient LLM Inference

The per-RoPE-wavelength distance window is proposed: it prunes the query--key inner-product terms beyond a wavelength-proportional distance within each model's native context length, and examines absolute scores on long-context benchmarks such as RULER, OpenAI-MRCR, LongCodeQA, and $\infty$Bench: they are broadly prese...

Shun-ichiro Hayashi, Daichi Mukunoki, Tetsuya Hoshino et al. · 1 citation
#natural language process... Preprint Aug 2026

All You Need Is Non-Commutative Words

It is shown that the noncommutativity of matrix product captures word order without positional encodings (PEs) and yields several capabilities, including antisymmetric self-attention with no query, key, or value projections, and parallel composition of variable-length text chunks at a reduced attention cost.

Carla Quispe Flores, Stanley Salvatierra, Renan Cabrera · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.