Abstract
Graph Transformers (GTs) have emerged as powerful tools for capturing long-range dependencies in graph data. However, they frequently suffer from the "over-smoothing" paradox, where node representations become indistinguishable as model depth increases. We present ParaFormer, a novel Graph Transformer architecture that integrates a PageRank-inspired attention mechanism. By treating attention as a learnable, adaptive-pass filter, ParaFormer effectively captures both local and global dependencies. Our scalable implementation achieves linear complexity, enabling state-of-the-art performance on massive graphs with millions of nodes while significantly reducing memory overhead.
Introduction
Graph Neural Networks (GNNs) typically rely on local message-passing, which limits their ability to capture long-range relationships. While Graph Transformers (GTs) address this by employing global self-attention, they introduce a critical challenge: over-smoothing. In a graph context, over-smoothing occurs when node representations converge to a common value, washing out the unique features necessary for downstream tasks.
Theoretical analysis reveals that vanilla Transformers act as aggressive low-pass filters. Because they treat the graph as fully connected, they propagate information so rapidly that node identities vanish almost instantly, particularly in heterophilic graphs where neighbors often possess different labels.
Methodology
ParaFormer introduces two primary innovations to mitigate over-smoothing and enhance scalability: Generalized PageRank Attention (GPA) and a linear-complexity implementation.
Generalized PageRank Attention (GPA)
GPA reformulates the attention mechanism to mimic the behavior of the PageRank algorithm. Instead of a single attention pass, GPA iteratively accumulates value vectors through powers of the attention matrix. By utilizing learnable weights ($\gamma_k$) for each power iteration, the model adaptively determines the importance of immediate neighbors versus distant nodes. This allows ParaFormer to function as either a low-pass or high-pass filter depending on the graph's structural requirements.
Scalable Implementation
Standard self-attention scales quadratically ($O(n^2)$) with the number of nodes, making it impractical for large graphs. ParaFormer employs a "linear attention" trick by leveraging the associative property of matrix multiplication. By reordering operations, the complexity is reduced to $O(n)$, allowing the model to scale to datasets with millions of nodes without sacrificing accuracy.
Experimental Results
ParaFormer was evaluated across 13 benchmarks, including homophilic citation networks (e.g., Cora, PubMed) and heterophilic graphs (e.g., Film, Squirrel).
- Performance: ParaFormer consistently outperformed 16 competitive baselines, showing a 1.9% average improvement over existing Graph Transformers.
- Resilience to Depth: Unlike vanilla Transformers, which experience sharp performance degradation after 3 layers, ParaFormer maintains stable and distinct node representations even with increased iterations ($K$).
- Efficiency: The scalable GPA mechanism achieved significant memory savings, reducing GPU memory usage by over 80% on the PubMed dataset and nearly 60% on the Deezer dataset.
Discussion and Conclusion
The success of ParaFormer lies in its ability to "tune" itself to the graph's frequency. In heterophilic graphs, the model often learns negative weights for specific hops, effectively highlighting node differences—a classic high-pass filtering technique.
While ParaFormer is highly effective, future work could involve integrating structural positional encodings to further enhance topology awareness. Additionally, its ability to handle long-range dependencies makes it a promising candidate for complex biological networks, such as protein-protein interaction graphs.
Summary updated