[Paper Review] Specformer: Spectral Graph Neural Networks Meet Transformers
Specformer introduces a Transformer-based set-to-set spectral filter for graph Laplacian eigenvalues, enabling learnable, non-local spectral convolutions that are permutation-equivariant and outperform state-of-the-art GNNs on node- and graph-level tasks.
Spectral graph neural networks (GNNs) learn graph representations via spectral-domain graph convolutions. However, most existing spectral graph filters are scalar-to-scalar functions, i.e., mapping a single eigenvalue to a single filtered value, thus ignoring the global pattern of the spectrum. Furthermore, these filters are often constructed based on some fixed-order polynomials, which have limited expressiveness and flexibility. To tackle these issues, we introduce Specformer, which effectively encodes the set of all eigenvalues and performs self-attention in the spectral domain, leading to a learnable set-to-set spectral filter. We also design a decoder with learnable bases to enable non-local graph convolution. Importantly, Specformer is equivariant to permutation. By stacking multiple Specformer layers, one can build a powerful spectral GNN. On synthetic datasets, we show that our Specformer can better recover ground-truth spectral filters than other spectral GNNs. Extensive experiments of both node-level and graph-level tasks on real-world graph datasets show that our Specformer outperforms state-of-the-art GNNs and learns meaningful spectrum patterns. Code and data are available at https://github.com/bdy9527/Specformer.
Motivation & Objective
- Motivate the limitations of scalar-to-scalar spectral filters and fixed-order polynomial bases in spectral GNNs.
- Develop a Transformer-based set-to-set spectral filter to capture magnitudes and relative differences of all Laplacian eigenvalues.
- Design a learnable bases decoder to enable non-local graph convolutions.
- Ensure permutation equivariance and scalability for practical graph learning tasks.
- Demonstrate superior performance on synthetic and real-world graph benchmarks across node and graph levels.
Proposed method
- Encode the spectrum by mapping each eigenvalue with a sinusoidal-embedding function to obtain high-dimensional representations.
- Apply a standard Transformer block to learn dependencies among eigenvalues in the spectral domain.
- Decode multiple spectral bases via attention-based heads to generate new eigenvalues, then construct learnable bases with an FFN.
- Reconstruct per-channel spectral filters as a combination of learnable bases and apply a graph convolution with residual connections.
- Maintain permutation equivariance and allow non-local graph convolution through the learned spectral filter.
Experimental results
Research questions
- RQ1Can a Transformer-based set-to-set spectral filter capture both magnitude and relative frequency information of all Laplacian eigenvalues?
- RQ2Do learnable spectral bases enable more expressive and flexible spectral filtering than fixed polynomial bases?
- RQ3Is Specformer permutation-equivariant and capable of non-local graph convolution while performing well on both node- and graph-level tasks?
- RQ4How does Specformer compare to traditional spatial GNNs, polynomial-based spectral GNNs, and Graph Transformers on synthetic and real-world datasets?
Key findings
- Specformer learns more expressive spectral filters than fixed polynomial spectral GNNs on synthetic data, accurately recovering ground-truth filters.
- On node-level and graph-level benchmarks, Specformer outperforms state-of-the-art GNNs including spatial, spectral, and graph Transformer baselines.
- The model demonstrates permutation equivariance and enables non-local graph convolution through learned spectral bases.
- Ablation studies show the eigenvalue encoding and attention module consistently improve performance, and model size scales with task difficulty.
- Specformer achieves strong results on both homophilic and heterophilic datasets, with notable gains on heterophilic graphs.
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.