Abstract
Standard Transformer architectures suffer from quadratic complexity, limiting their applicability to long sequences. While sparse attention mechanisms offer efficiency, they often struggle with slow information propagation across distant tokens. We introduce Diffuser, a novel architecture that models token interactions as a graph diffusion process. By applying Personalized PageRank to sparse attention patterns, Diffuser captures long-range, multi-hop dependencies within a single layer. Our approach achieves state-of-the-art performance on the Long Range Arena (LRA) benchmark and provides significant memory savings compared to existing efficient Transformer variants.
Introduction: The Information Bottleneck
The self-attention mechanism in standard Transformers scales quadratically ($O(n^2)$) with sequence length $n$, creating a significant computational bottleneck for long-form text or high-resolution images. Sparse Transformers, such as Longformer and BigBird, address this by restricting attention to local windows or a subset of global tokens. However, these models introduce a "slow propagation" problem: information from token $i$ may require multiple layers to reach a distant token $j$ if they are not directly connected in the sparse pattern. This limitation reduces the model's expressiveness and makes it sensitive to sequence perturbations.
Methodology: Attention as Graph Diffusion
Diffuser bridges the gap between the efficiency of sparse attention and the global reach of full attention by treating the attention matrix as an adjacency matrix of a graph.
Multi-Hop Attention Diffusion
Instead of a standard one-step attention calculation, Diffuser employs a diffusion process—specifically Personalized PageRank (PPR)—to compute multi-hop correlations. This allows a token to "see" its neighbors' neighbors within a single layer, effectively expanding the receptive field without adding depth.
To maintain efficiency, Diffuser avoids explicit matrix powers. Instead, it uses an iterative power method: $$Z_{(k+1)} = (1-\alpha)AZ_{(k)} + \alpha V$$ where $A$ is the sparse attention matrix, $V$ is the initial value matrix, and $\alpha$ is the teleport probability. This iterative approach ensures linear complexity relative to the number of edges in the sparse graph.
Hybrid Sparse Patterns and Graph Theory
Diffuser utilizes a hybrid sparse pattern to ensure the underlying graph is an expander graph, which is mathematically optimized for rapid information mixing. The pattern includes local windows for immediate context, global tokens for central information exchange, and random shortcuts to enable direct paths between distant parts of the sequence.
Experimental Evaluation
The authors evaluated Diffuser across diverse benchmarks requiring long-range reasoning, including the Long Range Arena (LRA), Masked Language Modeling, and long-document text classification (Amazon-512 and Amazon-2048).
Key Results
- Performance: Diffuser outperformed BigBird by an average of 2.30% accuracy across the LRA suite. On long-form Amazon reviews, it surpassed BigBird by up to 1.2%, demonstrating superior handling of extremely long dependencies.
- Efficiency: The model achieved 1.67x memory savings over the Performer baseline while maintaining competitive runtimes.
- Theoretical Robustness: The paper provides a theoretical proof that Diffuser is a "universal approximator," capable of representing any continuous sequence-to-sequence function—a property often sacrificed in simpler sparse models.
Conclusion and Future Work
Diffuser demonstrates that graph-based diffusion is a powerful tool for scaling Transformers. By enabling multi-hop interactions in a single layer, it overcomes the information propagation limits of traditional sparse models. Future research may focus on optimizing custom hardware kernels for Sparse Matrix-Vector Multiplication (GSpMM) to further improve speed and exploring dynamic sparse patterns that adapt during the diffusion process.
Summary updated