TL;DR
This paper introduces Polynormer, a novel graph transformer architecture that achieves state-of-the-art performance on a wide range of graph datasets while maintaining linear time complexity. It achieves this by leveraging a polynomial-expressive attention mechanism that can learn complex relationships within graph data without relying on expensive computations or nonlinear activation functions.
What Problem Does This Paper Address?
Graph Transformers (GTs) have shown promise in surpassing the limitations of traditional Graph Neural Networks (GNNs) by allowing nodes to attend to all other nodes. However, most existing GT models suffer from quadratic complexity, making them impractical for large-scale graph datasets. While some linear GTs have been proposed, they often sacrifice expressivity and underperform GNNs. This paper addresses the critical trade-off between expressivity and scalability in GTs, aiming to develop a model that is both highly expressive and computationally efficient for large graphs.
Methods
The core innovation of Polynormer lies in its polynomial-expressive attention mechanism. Instead of directly computing attention scores, Polynormer learns a high-degree polynomial function where the coefficients are determined by attention scores. This allows the model to inherently capture complex, non-linear relationships within the data.
Key techniques include:
- Polynomial-Expressive Base Model: A novel attention model that explicitly learns a polynomial function of input features.
- Equivariant Local and Global Attention: The base model is extended to be permutation equivariant by integrating graph topology and node features separately. This results in local attention (using sparse attention matrices like GAT) and global attention (using a linearized kernel trick to avoid quadratic complexity).
- Local-to-Global Attention Scheme: Polynormer employs a sequential local-to-global attention mechanism. Local attention first captures local structural information, and its output is then fed into the global attention module to capture broader relationships. This is a departure from prior "local-and-global" schemes that applied them in parallel.
- Linear Complexity: By avoiding dense attention matrices and using a kernel trick for global attention, Polynormer achieves linear complexity with respect to the number of nodes and edges.
- No Nonlinear Activation Functions (by default): Remarkably, Polynormer achieves strong performance even without traditional nonlinear activation functions, relying on its polynomial expressivity.
Datasets
Polynormer was evaluated on a comprehensive set of 13 datasets, encompassing both homophilic (nodes with similar labels tend to be connected) and heterophilic (nodes with different labels tend to be connected) graphs. These datasets vary in size, including large-scale graphs with millions of nodes.
Specific datasets mentioned include:
- Homophilic: Computer, Photo, CS, Physics, WikiCS, ogbn-arxiv, ogbn-products.
- Heterophilic: roman-empire, amazon-ratings, minesweeper, tolokers, questions, pokec.
- Large-scale: ogbn-arxiv, ogbn-products, pokec.
- Specialized: TpuGraphs (for AI model runtime prediction).
Key Insights and Ideas
- Polynomial Expressivity as a Key to Performance: The paper strongly advocates for polynomial expressivity as a fundamental property for graph learning models, suggesting it can unlock higher accuracy even without nonlinearities.
- Linear Complexity is Achievable with High Expressivity: Polynormer demonstrates that it's possible to achieve both linear scalability and sophisticated polynomial modeling in graph transformers.
- Local-to-Global Attention is Superior to Local-and-Global: The sequential application of local then global attention in Polynormer outperforms parallel application, suggesting a more structured way to integrate information.
- Heterophilic Graphs Benefit Significantly from Global Attention: The results highlight that Polynormer's global attention mechanism is particularly effective on heterophilic graphs, where understanding distant relationships is crucial.
- No Need for Complex PE/SE Methods: By directly learning polynomial functions, Polynormer bypasses the need for computationally expensive positional or structural encoding methods.
Key Results
- State-of-the-Art Performance: Polynormer outperforms 22 competitive GNN and GT baselines on most homophilic and heterophilic datasets.
- Significant Gains on Heterophilic Graphs: Polynormer-r (with ReLU) shows accuracy improvements of up to 3.55% on heterophilic datasets.
- Scalability: Polynormer demonstrates linear scaling on large graphs with millions of nodes, outperforming baselines in both accuracy and efficiency.
- Efficiency: Polynormer achieves competitive training times and low memory usage, ranking among the top 3 fastest models on large realistic graphs.
- No Activation Functions Needed: Polynormer achieves SOTA results even without nonlinear activation functions, showcasing the power of its polynomial expressivity. Adding ReLU further boosts performance.
Limitations and Future Work
- Polynormer-v2 vs. Polynormer-v1: While Polynormer-v2 (using a non-trivial Laplacian eigenvector) is shown to be strictly more expressive than 1-WL GNNs on distinguishing non-isomorphic graphs, it does not consistently outperform Polynormer-v1 on realistic node classification datasets. The authors suggest that unique node features in real-world data diminish the importance of explicit positional encoding.
- Future Work: The authors suggest further exploring the improvement of Polynormer-v2 for practical applications and investigating other Laplacian eigenvectors for polynomial coefficient design. They also mention exploring other sparse attention approaches for the local attention module.
Summary updated