HyperAIHyperAI

Command Palette

Search for a command to run...

Apprentissage Profond

Au-delà de Weisfeiler-Lehman : un cadre quantitatif pour la puissance expressive des GNN

Bohang Zhang Jingchu Gai Yiheng Du Qiwei Ye Di He Liwei Wang

Résumé

La conception de réseaux de neurones sur graphes (GNN) expressifs est un sujet fondamental au sein de la communauté de l'apprentissage sur graphes. Jusqu'à présent, la puissance expressive des GNN a été principalement évaluée par le biais de la hiérarchie de Weisfeiler-Lehman (WL). Toutefois, cette mesure de l'expressivité présente des limites notables : elle est intrinsèquement grossière, qualitative et peut ne pas refléter fidèlement les exigences pratiques (par exemple, la capacité à encoder des sous-structures). Dans cet article, nous introduisons un nouveau cadre pour l'étude quantitative de la puissance expressive des architectures GNN, répondant à l'ensemble des limites mentionnées ci-dessus. Plus précisément, nous identifions une mesure fondamentale de l'expressivité, appelée expressivité par homomorphisme, qui quantifie la capacité des modèles GNN à compter des graphes au sens des homomorphismes. L'expressivité par homomorphisme offre un outil d'évaluation complet et pratique : la complétude permet des comparaisons directes de puissance expressive entre modèles GNN, tandis que le caractère pratique permet de comprendre des capacités concrètes des GNN, telles que le comptage de sous-graphes. En étudiant quatre classes de GNN emblématiques comme cas d'application, nous dérivons des descriptions simples, unifiées et élégantes de leur expressivité par homomorphisme, tant dans les cadres invariant qu'équivariant. Nos résultats fournissent des perspectives nouvelles sur une série de travaux antérieurs, unifient le paysage des différents sous-domaines de la communauté et résolvent plusieurs questions ouvertes. Sur le plan empirique, de nombreuses expériences sur des tâches synthétiques et réelles vérifient notre théorie, montrant que la performance pratique des modèles GNN est bien alignée avec la métrique proposée.

One-sentence Summary

Researchers from Peking University and Beijing Academy of Artificial Intelligence introduce homomorphism expressivity, a quantitative framework that measures GNN expressiveness by counting graphs under homomorphism, overcoming the coarse and qualitative limitations of the Weisfeiler-Lehman hierarchy and unifying expressivity comparisons across both invariant and equivariant architectures.

Key Contributions

  • Homomorphism expressivity is introduced as a quantitative framework for assessing Graph Neural Networks by measuring their ability to count graphs under homomorphism, providing complete expressivity comparisons beyond the qualitative Weisfeiler-Lehman hierarchy.

  • Exact homomorphism expressivity descriptions are derived for four prominent GNN families in invariant and equivariant settings, establishing model hierarchies, graph, node, and edge-level subgraph counting capabilities, and resolving several open questions.

  • Extensive synthetic and real-world experiments support the theoretical results and show that empirical GNN performance correlates with the homomorphism expressivity metric.

Introduction

Graph neural networks are widely used for graph-structured data, but their ability to distinguish different graph structures is often limited. A common way to measure this limitation is the Weisfeiler-Lehman hierarchy, especially the 1-WL bound for message-passing GNNs. However, this yardstick is too coarse for practical models: higher-order methods can be expensive, and 1-WL-based proof results may rely on small example graphs and fail to explain real-world performance. The authors leverage homomorphism counting to study which graph substructures a GNN can encode, and they give precise descriptions of the expressive power of MPNNs, Subgraph GNNs, Local GNNs, and Folklore-type GNNs, along with extensions to node-level, edge-level, and higher-order variants.

Method

The method establishes a unified analytical framework for measuring the expressive power of graph neural network architectures through homomorphism counting. For a graph representation model MMM with representation χGM(⋅)\chi_G^M(\cdot)χGM​(⋅), the core idea is to characterize exactly which substructures are invisible to the model. A graph family FM\mathcal{F}^MFM is defined as a maximal family of labeled graphs such that two graphs receive the same representation if and only if all homomorphism counts from graphs in FM\mathcal{F}^MFM are identical. Formally, the equivalence condition is written as:

χGM(G)=χHM(H)⟺hom(F,G)=hom(F,H)∀F∈FM.\chi_G^M(G)=\chi_H^M(H) \quad\Longleftrightarrow\quad \mathsf{hom}(F,G)=\mathsf{hom}(F,H) \quad \forall F\in\mathcal{F}^M.χGM​(G)=χHM​(H)⟺hom(F,G)=hom(F,H)∀F∈FM.

Maximality means that if a graph FFF is outside FM\mathcal{F}^MFM, there exist graphs GGG and HHH with identical representations under MMM but different homomorphism counts from FFF. This makes FM\mathcal{F}^MFM a complete quantitative expressivity measure. Comparing two models M1M_1M1​ and M2M_2M2​ reduces to comparing families: if FM2⊊FM1\mathcal{F}^{M_2}\subsetneq \mathcal{F}^{M_1}FM2​⊊FM1​, then M1M_1M1​ is strictly more expressive, and the gap is given by the family difference FM1∖FM2\mathcal{F}^{M_1}\setminus \mathcal{F}^{M_2}FM1​∖FM2​.

The central module for deriving these families is a nested ear decomposition framework. For a graph, a decomposition partitions the edge set into simple paths called ears. Initial ears correspond to disjoint starting paths for connected components. Later ears must be nested on earlier ears, meaning one or both endpoints of a new ear attach to an earlier ear, while the interior vertices are new. When both endpoints attach to the same parent ear, the corresponding subpath in the parent ear defines a nested interval. The global structure can be viewed as a forest of ears, where each ear has a parent ear through its nesting relation. Variants of this structure correspond to different model classes:

  • Endpoint-shared nested ear decomposition requires all ears with nonempty nested intervals to share one endpoint.
  • Strong nested ear decomposition requires child intervals of the same parent ear to be nested by inclusion.
  • Almost-strong nested ear decomposition weakens the condition by considering only child intervals of length greater than one.

The organization of ears, parent relationships, and nested intervals is illustrated below.

Using these decomposition variants, the framework gives exact characterizations for major GNN architectures. MPNNs can count forests, Subgraph GNNs correspond to graphs admitting an endpoint-shared nested ear decomposition, Local 2-GNNs correspond to strong nested ear decompositions, Local 2-FGNNs correspond to almost-strong nested ear decompositions, and 2-FGNNs correspond to general nested ear decompositions. An equivalent description for Subgraph GNNs is that a graph belongs to its expressive family if deleting one suitable vertex leaves a forest.

The proof pipeline behind the characterization is itself a modular method. First, an unfolding-tree perspective identifies graph structures whose homomorphism counts determine the model representation, yielding a lower-bound family based on tree decomposition. Second, the decomposition characterization is translated into the nested ear decomposition language, providing a compact description that aligns with practical GNN operations. Third, maximality is shown by constructing graph pairs that remain indistinguishable to the model but differ in homomorphism counts for excluded structures, using connections among tree decomposition, pebble games, and specially constructed indistinguishable graph families.

The framework also extends to node-level and edge-level expressivity. For node-level analysis, the relevant family consists of connected rooted graphs FwF^wFw, where one vertex in FFF is marked and compared against a vertex in the input graph. The representation equivalence becomes

χGM(u)=χHM(v)⟺hom(Fw,Gu)=hom(Fw,Hv)∀Fw∈FnM.\chi_G^M(u)=\chi_H^M(v) \quad\Longleftrightarrow\quad \mathsf{hom}(F^w,G^u)=\mathsf{hom}(F^w,H^v) \quad \forall F^w\in\mathcal{F}_{\mathfrak{n}}^M.χGM​(u)=χHM​(v)⟺hom(Fw,Gu)=hom(Fw,Hv)∀Fw∈FnM​.

For MPNNs, the node-level family is trees. For Subgraph GNNs, a rooted graph is expressible when removing the root leaves a forest. For 2-FGNN-like models, the root must be an endpoint of the first ear in a suitable nested ear decomposition, and the edge-level variant marks two vertices and corresponds to endpoints of the first ear.

The method generalizes naturally to higher-order GNN families. Subgraph kkk-GNNs are characterized by allowing the removal of up to kkk vertices so that the remaining graph is a forest. Local kkk-GNNs require a higher-order analogue of nested ear decomposition. A kkk-order ear is formed from a small core graph of at most kkk vertices together with kkk paths connecting that core to external endpoints. Nested intervals and strong nesting conditions are then defined over these higher-order ears. The shape of these higher-order building blocks and their nested interval structure is shown below.

With these tools, the framework also yields a complete qualitative hierarchy. The base families satisfy strict inclusions:

FMP⊊FSub⊊FL⊊FLF⊊FF.\mathcal{F}^{\mathsf{MP}} \subsetneq \mathcal{F}^{\mathsf{Sub}} \subsetneq \mathcal{F}^{\mathsf{L}} \subsetneq \mathcal{F}^{\mathsf{LF}} \subsetneq \mathcal{F}^{\mathsf{F}}.FMP⊊FSub⊊FL⊊FLF⊊FF.

Higher-order variants expand the picture into an infinite hierarchy. Subgraph kkk-GNNs gain expressivity with kkk, Local kkk-GNNs gain expressivity with kkk, and Local (k+1)(k+1)(k+1)-GNNs lie between kkk-FWL and (k+1)(k+1)(k+1)-FWL. The expressive power of Subgraph kkk-GNNs is generally incomparable with kkk-FWL when k>1k>1k>1, but it is contained within (k+1)(k+1)(k+1)-FWL. The resulting architecture hierarchy is summarized below.

A major application of the framework is subgraph counting. Subgraph counts are not direct homomorphism counts, but they can be expressed as linear combinations of homomorphism counts over homomorphic images of the target pattern. Given a pattern FFF, let Spasm(F)\mathsf{Spasm}(F)Spasm(F) denote its homomorphic images, and let Spasm≠(F)\mathsf{Spasm}^{\neq}(F)Spasm=(F) be a maximal set of pairwise non-isomorphic images. Then for any graph GGG,

sub⁡(F,G)=∑F~∈Spasm≠(F)α(F,F~) hom(F~,G),\operatorname{sub}(F,G) = \sum_{\tilde{F}\in\mathsf{Spasm}^{\neq}(F)} \alpha(F,\tilde{F})\, \mathsf{hom}(\tilde{F},G),sub(F,G)=F~∈Spasm=(F)∑​α(F,F~)hom(F~,G),

where α(F,F~)\alpha(F,\tilde{F})α(F,F~) is a nonzero constant depending only on FFF and F~\tilde{F}F~, not on GGG. Therefore, a model can subgraph-count FFF whenever every homomorphic image F~∈Spasm(F)\tilde{F}\in\mathsf{Spasm}(F)F~∈Spasm(F) lies in its homomorphism expressivity family. Conversely, if some homomorphic image is outside the family, a pair of graphs can be constructed where the model representations agree but the subgraph counts differ. This gives a complete counting criterion at graph, node, and edge levels. The homomorphic-image decomposition for cyclic patterns is illustrated below.

The same characterization also connects to polynomial expressivity. Membership in FM\mathcal{F}^MFM or FnM\mathcal{F}_{\mathfrak{n}}^MFnM​ and FeM\mathcal{F}_{\mathfrak{e}}^MFeM​ determines whether invariant or equivariant graph polynomials associated with patterns or rooted patterns can be computed by the model. This turns the nested ear decomposition framework into a practical tool for reasoning about which structural polynomials are available to different architectures, including standard message passing, subgraph-based, local higher-order, and global higher-order variants.

Experiment

The experiments evaluate MPNN, Subgraph GNN, Local 2‑GNN, and Local 2‑FGNN under matched GIN-based designs to test the proposed homomorphism expressivity theory on synthetic substructure counting, cycle counting, and real-world graph benchmarks. The results show that model capability broadly follows the theoretical hierarchy, with Local 2‑FGNN consistently encoding more structures, counting diverse cycles more effectively, and achieving the strongest performance on practical datasets. Overall, the findings support the conclusion that stronger homomorphism expressivity translates into measurable advantages in both controlled and applied graph learning tasks.

The example characterizes which cycles and paths different GNN architectures can count at graph, node, and edge levels. More expressive models broaden the class of countable structures, with MPNN showing the strongest limitations and Local 2-(F)GNN models showing stronger cycle counting power. MPNN can count only very short simple paths and no cycles at the shown levels Subgraph GNNs and Local 2-(F)GNN models expand cycle and path counting capacity, with Local 2-(F)GNN models consistent with the strongest practical cycle counting performance

The results show that models with stronger local subgraph processing generally achieve lower normalized test error when counting homomorphism information. Local 2-FGNN is consistently accurate across graph-level, node-level, and edge-level tasks, while MPNN fails to capture any tested substructure. Subgraph GNN performs well on some cases but is less stable than Local 2-GNN and Local 2-FGNN, especially on harder substructures. Local 2-FGNN maintains low error across all tested homomorphism counting tasks. MPNN shows substantially worse performance than the subgraph-based models. Local 2-GNN improves over Subgraph GNN and provides more consistent low errors. Performance trends match the expected expressivity ordering among the compared GNN models.

The real-world benchmark results show that models with stronger theoretical expressivity generally achieve better performance on chemical graph tasks. Across the evaluated GNN variants, performance improves as the architecture moves from MPNN to Subgraph GNN and further to Local 2-GNN. Local 2-FGNN attains the best results on all reported tasks, indicating that its expressivity advantage can translate into practical gains. Expressiveness gains correlate with lower benchmark error on ZINC and Alchemy tasks. Local 2-FGNN consistently outperforms MPNN, Subgraph GNN, and Local 2-GNN.

Cycle-counting results show a clear expressive hierarchy among the compared GNN architectures when model size and training budget are matched. MPNN has the largest errors and cannot count edge-level cycles reliably, while Subgraph GNN improves substantially but still struggles with several longer and chordal cycles. Local 2-GNN and Local 2-FGNN achieve consistently lower errors, with Local 2-FGNN showing the strongest overall performance across graph, node, and edge levels. MPNN fails to count cycles effectively at all levels, especially at edge level. Local 2-FGNN achieves the best or near-best cycle counting errors despite comparable computational cost.

The experiments compare GNN architectures across synthetic cycle and path counting, homomorphism counting, and chemical benchmark tasks under matched model size and training budget. They validate that stronger local subgraph processing expands the class of countable structures and improves practical performance. MPNN is the most limited, while Subgraph GNN offers partial gains, and Local 2 GNN and especially Local 2 FGNN consistently count more complex cycles and paths with lower errors. These results show that theoretical expressivity translates into more accurate and stable performance at the graph, node, and edge levels.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp