Abstract
Graph Transformers (GTs) have emerged as a powerful alternative to Message Passing Neural Networks (MPNNs), yet their extension to higher-order structures remains computationally daunting and theoretically opaque. This work establishes a rigorous foundation for higher-order graph transformers, demonstrating that naive implementations are surprisingly weak—often less expressive than the $k$-Weisfeiler Lehman ($k$-WL) test. We propose a suite of sparse, structure-aware attention mechanisms—including Neighbor, Local Neighbor, and Simplicial Attention—that reduce complexity from $O(n^{2k})$ to $O(n^k)$ while matching or exceeding the expressive power of the $k$-WL hierarchy.
Introduction
The success of Graph Transformers is largely attributed to their global self-attention, which effectively captures long-range dependencies. However, most existing GTs operate at the node level. In the broader context of Graph Neural Networks (GNNs), higher-order structures (e.g., $k$-tuples of nodes) are known to significantly enhance expressive power, enabling models to distinguish complex graph topologies that simpler architectures cannot.
The primary obstacles to higher-order GTs are two-fold: computational explosive complexity ($O(n^{2k})$ for a naive order-$k$ transformer) and a lack of theoretical understanding regarding their expressive limits. This paper addresses these challenges by redesigning the attention mechanism to be both computationally efficient and theoretically potent.
The Expressivity Gap and the "Index" Paradox
A central finding of this research is that a "plain" order-$k$ transformer ($A_k$) is strictly less expressive than the $k$-WL test. This stems from the "Index Paradox": while $k$-WL relies on knowing which specific nodes are being permuted within a tuple, a standard Transformer treats every tuple as an independent, opaque token. Without structural "index" information or specific connectivity biases, the transformer loses the relational context necessary to match $k$-WL performance.
Proposed Sparse Attention Mechanisms
To bridge this gap, we introduce several novel attention designs that leverage graph topology to improve both efficiency and expressiveness:
- Neighbor Attention ($A_k^{Ngbh}$): Restricts attention to "neighboring" tuples (those differing by exactly one node), mimicking the $k$-WL update rule and reducing complexity to $O(n^{k+1})$.
- Local Neighbor Attention ($A_k^{LN}$): Further restricts attention to neighbors physically connected in the input graph. This "structure-aware" approach boosts expressiveness to match the $\delta$-$k$-LWL hierarchy.
- Virtual Tuple Attention ($A_k^{VT}$): Utilizes a global hub for communication, achieving $O(n^k)$ complexity.
- Simplicial Transformers ($AS$): Operates only on simplices (nodes, edges, triangles) present in the graph, exploiting natural sparsity for significant speedups.
Theoretical and Computational Analysis
The proposed models represent a significant shift in the design space of higher-order transformers. By introducing sparsity based on graph topology, we not only reduce the computational burden but also bake in inductive biases that enhance the model's ability to distinguish non-isomorphic graphs.
As shown in the table above, the transition from dense to sparse attention allows for a reduction in complexity while maintaining or improving expressive power. For instance, $A_k^{LN}$ achieves expressiveness $\geq \delta$-$k$-LWL with significantly lower complexity than the dense $A_k$.
Experimental Validation
The proposed architectures were evaluated across synthetic and real-world benchmarks:
- Expressiveness: The $A_2^{LN}$ model achieved 100% accuracy on the Circular Skip Links (CSL) benchmark, a task where standard Transformers and GIN fail completely.
- Molecular Benchmarks: On the ZINC-12k dataset, the sparse $A_2^{LN+VT}$ model achieved a Test MAE of 0.069, outperforming state-of-the-art models like GPS (0.070) while maintaining higher efficiency.
- Scalability: Simplicial Transformers ($AS_{0:1}$) successfully scaled to large-scale datasets in the Long Range Graph Benchmark (LRGB), outperforming GPS on the Peptides-struct task (MAE 0.2486 vs 0.2500).
- Substructure Counting: Sparse variants like $A_2^{Ngbh+}$ demonstrated near-perfect accuracy in counting triangles and cycles, tasks that standard global transformers struggle with.
Conclusion
This work demonstrates that sparsity in higher-order graph transformers is not merely a tool for efficiency but a critical component for expressive power. By aligning attention mechanisms with the underlying graph structure, we can build models that are both theoretically grounded and practically scalable, providing a robust framework for the next generation of graph representation learning.
Summary updated