The self-attention mechanism is the core of the Transformer architecture, enabling its massive success in natural language processing and computer vision. However, it suffers from a well-known bottleneck: computational and memory costs scale quadratically ($O(n^2)$) with sequence length $n$. This paper introduces a novel approach using Multiresolution Analysis (MRA) to approximate self-attention, achieving $O(n)$ complexity while capturing both local and global dependencies.
The Limits of Existing Approximations
Existing efficient Transformers typically rely on two paradigms:
- Low-rank approximations: These assume the attention matrix has a globally simple structure. They struggle when attention is "peaky" or highly concentrated on specific tokens.
- Sparse approximations: Methods like sliding windows assume tokens primarily interact with their immediate neighbors, often failing to capture critical long-range dependencies.
A gap remains for a method that can simultaneously capture local "high-frequency" details and global "low-frequency" structures without incurring quadratic costs.
The Multiresolution Analysis (MRA) Approach
To bridge this gap, the authors adapt Multiresolution Analysis (MRA)—a classical signal processing technique akin to wavelets—to process the attention matrix.
- Wavelet-Inspired Decomposition: The attention matrix is treated as a 2D signal and decomposed into different scales. Instead of standard Haar wavelets, which are difficult to optimize on modern hardware, the authors propose a hardware-friendly overcomplete frame. This represents the matrix as a sum of blocks at varying resolutions.
- Greedy Construction: Rather than computing every resolution across the entire matrix, a greedy algorithm identifies high-importance regions (where attention weights are largest) and refines only those specific areas to a higher resolution.
- Efficient Computation: The authors derive a method to compute the product of the approximated attention matrix and the Value matrix without ever materializing the full $n \times n$ matrix, maintaining linear or near-linear complexity.
Key Insights
- Parsimony in Attention: A fundamental observation driving this work is that attention matrices are highly compressible. Only about 10% of wavelet coefficients are typically needed to reconstruct the matrix with high fidelity.
- Entropy Robustness: MRA adapts dynamically to the "spread" of attention weights. It succeeds where low-rank methods fail (low-entropy/concentrated attention) and where sparse methods fail (high-entropy/diffuse attention).
- Hardware-First Design: By moving from theoretical wavelets to a specific frame optimized for block-based GPU operations, the authors overcome the implementation hurdles that have historically limited wavelet use in deep learning.
Performance and Results
The MRA approach (specifically the MRA-2 and sparse MRA-2-s variants) was rigorously evaluated across language modeling (RoBERTa), downstream NLP (MNLI, WikiHop), the Long Range Arena (LRA) benchmark, and ImageNet classification.
- Accuracy: MRA-2 achieved significantly lower relative error than popular baselines like Performer, Linformer, and Big Bird.
- Efficiency: On 4096-length sequences, MRA-2 was roughly 4x faster and used 14x less memory than a standard Transformer. On standard 512-length RoBERTa models, it matched or exceeded full Transformer accuracy while remaining faster and more memory-efficient.
- LRA Dominance: MRA-2-s achieved the highest average score across all LRA tasks compared to over a dozen efficient Transformer variants, excelling particularly in tasks requiring spatial structure understanding like Image and Pathfinder.
Limitations and Future Directions
While highly effective, MRA currently relies on custom CUDA kernels for block-sparsity to achieve peak hardware performance. The lack of native, high-level library support is a minor barrier to plug-and-play adoption. Additionally, the greedy heuristic used to select refinement regions, while successful, could potentially be optimized further. Future work may also extend this MRA framework beyond self-attention to other operators, such as large-scale graph convolutions.
Summary updated