vix.ing · top · new · best · stats

SPECTRE: An FFT-Based Efficient Drop-In Replacement to Self-Attention for Long Contexts

2025/02/25 by Jacob Fein-Ashley, Fein-Ashley, Jacob, Neelesh Gupta +6 · 22 voices · 1 citation
Computer Science · #Advanced Neural Network Applications #Autoregressive model #Computational complexity theory #Context (archaeology) #Matching (statistics) #Multimodal Machine Learning Applications #Natural Language Processing Techniques #Quadratic equation #Representation (politics) #Transformer #Wavelet

paper · pdf · doi:10.48550/arxiv.2502.18394

published in arXiv (Cornell University) (Cornell University)

openalex publication_date 2025/02/25 · openalex created_date 2025/10/10 · openalex updated_date 2026/08/05

Abstract

Long-context transformers face significant efficiency challenges due to the quadratic cost of self-attention. However, many modern applications-from multi-turn dialogue to high-resolution vision-require contexts spanning tens of thousands of tokens. We introduce SPECTRE, a method that replaces each attention head with a fast real FFT, a content-adaptive spectral gate, and an inverse FFT, reducing per-layer complexity from O(L2) to O(Llog L) while preserving the surrounding architecture. We extend this efficiency to autoregressive generation through our Prefix-FFT cache and enhance local feature representation with an optional wavelet module that adds negligible computational overhead. Our experiments demonstrate that SPECTRE operates up to 7× faster than FlashAttention-2 on 128k-token contexts while matching or exceeding baseline performance on PG-19 language modeling and ImageNet-1k classification tasks. SPECTRE achieves these improvements by adding fewer than 6% parameters to the base model, making hundred-kilotoken context processing feasible on commodity GPUs without specialized hardware.

Citations

Cited by

Discussions

Related