Cluster-wise Graph Transformer with Dual-granularity Kernelized Attention

Siyuan Huang, Yunchong Song, Jiayue Zhou, Zhouhan Lin

Introduction: The Detail vs. Scale Trade-off

In graph representation learning, researchers have long grappled with a fundamental trade-off between computational efficiency and informational granularity. Standard Graph Transformers (GTs) offer powerful global modeling capabilities but suffer from quadratic computational complexity ($O(N^2)$), making them impractical for large-scale graphs. To mitigate this, many hierarchical methods employ graph coarsening, where nodes are grouped into clusters and collapsed into single representative embeddings.

However, this aggressive pooling approach often results in "homogeneous" cluster representations that discard the rich, fine-grained details of individual nodes. The Cluster-wise Graph Transformer (Cluster-GT) addresses this by treating graphs as networks of interconnected node sets rather than compressed points, enabling global communication without sacrificing local structural variance.

The Cluster-GT Framework

Cluster-GT introduces a novel Node-to-Cluster Attention (N2C-Attn) mechanism. Unlike traditional coarsening pipelines that lose node-level information, N2C-Attn maintains a dual-granularity view of the graph. Every node is assigned a bi-level identity consisting of unique node-level features and collective cluster-level features.

The N2C-Attn mechanism views the graph as interconnected node sets, avoiding the information loss of the standard coarsening pipeline.

Dual-Granularity and Multiple Kernel Learning

To effectively fuse these two levels of information, the authors utilize Multiple Kernel Learning (MKL) within the attention framework. They propose two primary variants:

  1. N2C-Attn-T (Tensor Product): Multiplies node and cluster kernels to capture complex interactions across all feature dimensions.
  2. N2C-Attn-L (Convex Sum): Emplies a learnable weight ($\alpha$) to dynamically balance the importance of node-level versus cluster-level information based on the dataset.

Linear Efficiency via Kernelization

To maintain scalability, Cluster-GT leverages kernelized softmax to rephrase the attention calculation. This mathematical optimization transforms the process into a four-step cluster-wise message-passing routine (Aggregation, Gate Calculation, Propagation, and Unpacking). This reduces the computational complexity from quadratic to linear ($O(|N|)$), allowing the model to scale to large graphs while preserving the benefits of global attention.

The overall architecture follows a streamlined pipeline: a standard GNN extracts local features, the Metis algorithm partitions the graph into clusters, the N2C-Attn module facilitates global communication, and global pooling produces the final graph-level embedding.

Experimental Results and Domain Insights

Cluster-GT was evaluated across eight diverse benchmarks spanning social networks and bioinformatics. The model demonstrated superior performance, notably achieving 87.11% accuracy on the MUTAG dataset (outperforming GIN's 81.39%) and a Mean Absolute Error (MAE) of 0.071 on the ZINC molecular benchmark.

One of the most significant findings involves the learnable weight $\alpha$, which reveals how different domains prioritize information granularity.

Visualization of the learnable weight alpha shows the model prioritizing cluster-level info for social networks more than for bioinformatics.

As shown in the visualization, the model naturally learns that social networks rely more heavily on broad cluster-level patterns (higher $\alpha$). In contrast, biological and chemical graphs require a more balanced integration of fine-grained node-level details (lower $\alpha$) to capture specific molecular interactions.

Conclusion

Cluster-GT proves that hierarchical graph learning does not require the loss of fine-grained information. By treating clusters as sets of nodes rather than single points and utilizing dual-granularity attention, the model achieves state-of-the-art results with linear efficiency. Future work may explore replacing the fixed Metis partitioning with learnable "soft" partitioning to further enhance the model's flexibility in discovering optimal hierarchical structures.

Summary updated

BibTeX
@inproceedings{huang2024cluster,
  author = {Siyuan Huang and Yunchong Song and Jiayue Zhou and Zhouhan Lin},
  title = {{Cluster-wise Graph Transformer with Dual-granularity Kernelized Attention}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=3j2nasmKkP},
}
Figure