[Paper Review] Rethinking Graph Transformers with Spectral Attention
Introduces Spectral Attention Network (SAN) that uses learned Laplacian-spectrum-based positional encodings to enable fully-connected graph transformers, achieving competitive or state-of-the-art results on standard graph benchmarks.
In recent years, the Transformer architecture has proven to be very successful in sequence processing, but its application to other data structures, such as graphs, has remained limited due to the difficulty of properly defining positions. Here, we present the $ extit{Spectral Attention Network}$ (SAN), which uses a learned positional encoding (LPE) that can take advantage of the full Laplacian spectrum to learn the position of each node in a given graph. This LPE is then added to the node features of the graph and passed to a fully-connected Transformer. By leveraging the full spectrum of the Laplacian, our model is theoretically powerful in distinguishing graphs, and can better detect similar sub-structures from their resonance. Further, by fully connecting the graph, the Transformer does not suffer from over-squashing, an information bottleneck of most GNNs, and enables better modeling of physical phenomenons such as heat transfer and electric interaction. When tested empirically on a set of 4 standard datasets, our model performs on par or better than state-of-the-art GNNs, and outperforms any attention-based model by a wide margin, becoming the first fully-connected architecture to perform well on graph benchmarks.
Motivation & Objective
- Motivate graphs as data without hard structural biases and address limitations of message-passing GNNs.
- Develop learnable spectral positional encodings that leverage the full Laplacian spectrum.
- Create a fully-connected graph Transformer architecture that mitigates over-squashing.
- Demonstrate empirical performance gains on standard graph benchmarks compared to SOTA GNNs and attention-based models.
Proposed method
- Define absolute and relative positional encodings from Laplacian eigenfunctions for graphs.
- Propose a Learned Positional Encoding (LPE) transformer over nodes to project spectral information into fixed-size node embeddings.
- Concatenate LPE with node features and feed into a main Graph Transformer with full-graph attention.
- Enable a two-branch attention mechanism that handles sparse graph edges and added full-graph connections with a tunable gamma parameter.
- Optionally present an edge-wise LPE variant to achieve sign-invariance, with higher computational cost.
- Discuss theoretical properties: expressivity beyond WL tests and reduced over-squashing due to full connectivity.
Experimental results
Research questions
- RQ1How can Laplacian eigenfunctions be used to create effective positional encodings for graphs in a Transformer setting?
- RQ2Does full-graph attention with spectral encodings improve expressivity and performance over traditional message-passing GNNs?
- RQ3What are the trade-offs (computational and accuracy) between node-wise and edge-wise LPEs and between sparse vs. full attention?
- RQ4Can SAN achieve state-of-the-art performance on standard graph benchmarks across molecular and SBM datasets?
Key findings
- SAN matches or surpasses state-of-the-art on multiple standard graph benchmarks.
- Full-graph attention with spectral encodings provides empirical gains over equivalent sparse-message-passing models.
- Node-wise LPEs contribute significantly on molecular datasets due to substructure detection.
- The proposed method consistently outperforms attention-only baselines across tested datasets.
- Edge-wise LPE offers sign-invariance benefits but with higher computational cost.
- SAN is the first fully-connected architecture reported to perform well on graph benchmarks compared to attention-based models.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.