NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Generalization of ViT/MLP-Mixer to Graphs

Xiaoxin He, Bryan Hooi, Thomas Laurent, Adam Perold, Yann LeCun, Xavier Bresson · DOI

Abstract

Traditional Graph Neural Networks (GNNs) based on message-passing mechanisms often suffer from over-squashing and an inability to capture long-range dependencies. While Graph Transformers offer a solution, their quadratic computational complexity limits scalability. This paper introduces Graph ViT/MLP-Mixer, a novel architecture that bridges computer vision and graph machine learning. By partitioning graphs into "patches" and utilizing a linear-complexity mixer, the proposed model achieves global context awareness with $O(N+E)$ efficiency, outperforming standard GNNs and competitive Transformers on long-range tasks.

Introduction: The Bottleneck of Message Passing

Standard Graph Neural Networks (GNNs) rely on Message-Passing (MP), where nodes iteratively aggregate information from their immediate neighbors. While effective for local structures, this approach faces two primary challenges:

  1. Over-squashing: Information from distant nodes must be compressed into fixed-length vectors, leading to a "bottleneck" where crucial data is lost as the graph depth increases.
  2. Long-range Dependencies: MP-GNNs struggle to connect nodes separated by many hops. Graph Transformers address this via global attention but suffer from quadratic complexity ($O(N^2)$), making them impractical for large-scale graphs.

The authors propose a model that captures global context with the efficiency of a standard GNN by adapting the "patching" concept from Vision Transformers (ViT) and MLP-Mixers to the graph domain.

Methodology: From Pixels to Patches

The Graph ViT/MLP-Mixer architecture processes graphs through four distinct stages:

1. Patch Extraction

Unlike images, which have a natural grid structure, graphs are irregular. The authors employ the METIS algorithm to partition the graph into $P$ clusters or "patches." To preserve topological information at the boundaries, patches are allowed to overlap by including the 1-hop neighborhood of each cluster.

Analogy between image patching in ViT and graph partitioning into patches.

2. Patch Encoder

Each extracted patch is processed by a local GNN (e.g., GCN or GatedGCN), which summarizes the subgraph into a single vectorial token. This hierarchical approach reduces the "effective distance" between any two nodes in the original graph.

3. Mixer Layers

The core of the model alternates between two operations to capture global and local features:

  • Token Mixing: Fuses information across different patches to capture the global graph structure.
  • Channel Mixing: Fuses information within the feature dimensions of each token. A Graph ViT variant is also proposed, utilizing modified multi-head attention (gMHA) between tokens.

4. Positional Encoding (PE)

To account for the lack of inherent order in graphs, the model incorporates Node PE (to distinguish nodes within a patch) and Patch PE (to define relative patch positions based on connectivity).

Expressivity and Expressive Power

Standard MP-GNNs are limited by the 1-Weisfeiler-Leman (1-WL) test, meaning they cannot distinguish certain non-isomorphic graphs. Graph ViT/MLP-Mixer empirically reaches 3-WL expressivity, allowing it to identify complex structural symmetries. Furthermore, the model demonstrates superior resistance to over-squashing; in synthetic stress tests (TreeNeighbourMatch), it generalized perfectly up to a depth of 7, whereas standard GNNs failed at depth 4.

Experimental Results

The model was evaluated across various benchmarks, including molecular regression (ZINC), image-to-graph classification (MNIST, CIFAR10), and the Long-Range Graph Benchmark (LRGB).

  • State-of-the-Art on Long-Range Tasks: On the LRGB Peptides-func dataset, the model achieved an Average Precision of 0.6970, significantly outperforming standard GNNs (~0.59) and specialized Graph Transformers.
  • Efficiency: Graph MLP-Mixer proved to be up to 40x faster than competitive models like SAN or SUN while utilizing significantly less memory.
  • Mathematical Expressivity: The model achieved 100% accuracy on the CSL, EXP, and SR25 datasets, where traditional GNNs fail to distinguish underlying structures.

Conclusion

Graph ViT/MLP-Mixer represents a significant step toward efficient, global graph representation learning. By abstracting subgraphs into tokens, it overcomes the fundamental limitations of message-passing while maintaining linear complexity. Future work includes addressing hyperparameter sensitivity regarding cluster counts and exploring the potential of large-scale pre-training on diverse graph repositories.

Summary updated

BibTeX
@inproceedings{he2023generalization,
  author = {Xiaoxin He and Bryan Hooi and Thomas Laurent and Adam Perold and Yann LeCun and Xavier Bresson},
  title = {{A Generalization of ViT/MLP-Mixer to Graphs}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=_Jx6f6EpCBP},
}
Figure