GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers

GuoguoAi, Guansong Pang, Hezhe Qiao, YuanGao, Hui Yan

TL;DR

GrokFormer is a novel Graph Transformer that overcomes the inherent "low-pass" limitation of standard self-attention by using a Graph Fourier Kolmogorov-Arnold Network (KAN). By modeling spectral filters as Fourier series over learnable activation functions, it adaptively captures both low- and high-frequency signals across multiple spectral orders, setting new state-of-the-art benchmarks for both homophilic and heterophilic graphs.

What Problem Does This Paper Address?

Graph Transformers (GTs) have become powerful tools for representation learning, but they suffer from a fundamental flaw: the self-attention mechanism acts as a low-pass filter. It excels at capturing similarities between nodes (low-frequency signals) but struggles with "heterophilic" graphs, where connected nodes are often different (high-frequency signals).

While recent models have tried to incorporate spectral filters to fix this, they are often rigid. They typically rely on fixed polynomial bases (like Chebyshev or Bernstein) or are restricted to the first-order graph spectrum. This lack of flexibility prevents them from fitting complex, "jagged" frequency responses needed for diverse real-world datasets. The authors ask: Can we build a GT that efficiently and flexibly extracts rich frequency signals across the multi-order spectrum of a graph?

Methods

The core innovation is the Graph Fourier KAN, which replaces the standard linear weights in a spectral filter with learnable activation functions.

  1. Fourier Series Parameterization: Unlike standard Kolmogorov-Arnold Networks that use splines (which can be unstable to train on graphs), GrokFormer uses Fourier series (sines and cosines) to model these learnable functions. This provides an orthogonal basis that is highly expressive and converges quickly.
  2. Dual Adaptivity:
    • Spectrum-Adaptive: The model learns coefficients for various frequency components, allowing it to "draw" any arbitrary filter shape.
  3. Order-Adaptive: It introduces learnable coefficients ($\alpha_k$) to weigh the importance of different spectral orders (from 1st up to $K$-th). This allows the model to decide whether it needs local or more global spectral information.
  4. Architecture: GrokFormer integrates this spectral filter alongside an Efficient Multi-Head Self-Attention (EMHA) module. This dual-path design captures global spatial dependencies and complex spectral patterns simultaneously.
The GrokFormer architecture combines spatial self-attention with a spectral Graph Fourier KAN path.

Datasets

The authors evaluated GrokFormer on a massive suite of benchmarks:

  • Node Classification (11 datasets): Includes homophilic graphs (Cora, Citeseer, Pubmed, Photo, WikiCS, Physics) and heterophilic graphs (Penn94, Chameleon, Squirrel, Actor, Texas).
  • Graph Classification (5 datasets): PROTEINS, MUTAG, PTC-MR, IMDB-B, and IMDB-M.
  • Long-Range Benchmarks: ZINC, CIFAR10, and Peptides-func.
  • Synthetic Filter Fitting: A 2D grid graph task used to test the model's ability to fit predefined complex filters (e.g., "Comb" filters).

Key Insights and Ideas

  • Beyond Polynomials: Traditional spectral GNNs are like trying to fit a complex curve using only a few fixed-shape blocks. GrokFormer’s Fourier-based KAN is more like a flexible string that can be tuned to match any "frequency melody" the graph requires.
  • The Power of Orthogonality: Using sines and cosines isn't just a gimmick; their orthogonality makes the learning process more stable and effective compared to standard polynomials.
  • Order Matters: The model's ability to adaptively weight different spectral orders is crucial. For homophilic graphs, it tends to focus on low orders ($K \leq 3$), while for complex heterophilic graphs like Squirrel, it utilizes higher-order information to capture intricate node differences.
Comparison of filter parameterizations and how different models fit a complex ground truth filter. GrokFormer (red) tracks the ground truth much more accurately than Specformer or BernNet.

Key Results

  • Superior Accuracy: GrokFormer outperformed 16 competitive baselines. On the heterophilic Squirrel dataset, it achieved 65.12% accuracy, a significant jump over the previous best spectral GT (Specformer at 64.64%) and spatial GNNs.
  • Graph Classification Gains: It showed a remarkable 11.9% relative improvement on the PTC-MR dataset compared to the strongest baseline.
  • Efficiency: Despite its expressiveness, GrokFormer is computationally efficient. It scales linearly with the number of nodes $N$ during the forward pass, making it faster and less memory-intensive than Specformer on large-scale graphs like Penn94.

Limitations and Future Work

  • Spectral Decomposition: Like most spectral methods, GrokFormer requires an offline step to compute eigenvalues and eigenvectors ($O(N^3)$ or $O(N^2q)$ with approximations). While this is done only once, it remains a bottleneck for extremely large, dynamic graphs.
  • Hyperparameter Tuning: The "grid size" $M$ (number of Fourier components) and the maximum order $K$ are hyperparameters that require tuning for optimal performance on new datasets.
  • Future Direction: The authors suggest exploring ways to learn these expressive filters without needing explicit spectral decomposition, potentially using iterative methods to further improve scalability.

Summary updated

BibTeX
@inproceedings{guoguoai2025grokformer,
  author = {GuoguoAi and Guansong Pang and Hezhe Qiao and YuanGao and Hui Yan},
  title = {{GrokFormer: Graph Fourier Kolmogorov-Arnold Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=wFBBh8bcoC},
}
Figure