WL meet VC

Christopher Morris, Floris Geerts, Jan Tönshoff, Martin Grohe

Introduction

In the Graph Neural Network (GNN) community, "expressivity" is the gold standard. Researchers frequently evaluate models by asking whether a GNN can distinguish between two non-isomorphic graphs. This capability is traditionally benchmarked against the 1-dimensional Weisfeiler-Leman (1-WL) algorithm, a classic heuristic for the graph isomorphism problem.

However, being highly expressive is not synonymous with being a robust learner. A model that is "too expressive" risks simply memorizing the training set, failing to generalize to unseen graphs. While the field has developed a deep understanding of GNN expressivity, insights into their generalization performance have remained surprisingly thin. Existing generalization bounds often rely on superficial metrics—like the number of vertices or maximum degree—which fail to capture the nuanced structural complexity unique to graph data. This paper addresses this gap by establishing the first formal link between the expressive power of GNNs (via 1-WL) and their ability to generalize (via Vapnik-Chervonenkis dimension theory).

Theoretical Framework: VC Dimension and Graph Complexity

The authors investigate GNN generalization through the lens of Vapnik-Chervonenkis (VC) dimension, a cornerstone of statistical learning theory that measures the "capacity" or "flexibility" of a model class. They analyze this capacity across two primary regimes:

1. The Non-Uniform Regime (Bounded Graph Size) When graphs have a known maximum number of vertices ($n$), the authors prove that the VC dimension of an $L$-layer GNN is exactly equal to the number of equivalence classes (distinct graphs) that the 1-WL algorithm can distinguish. This establishes a direct, tight connection between structural distinguishability and learning capacity.

2. The Uniform Regime (Arbitrary Graph Size) When graphs can be of any size, architectural width alone does not dictate capacity. Instead, the authors show that the VC dimension is tightly bounded by the bitlength of the GNN's weights. Using a "bit extraction" proof technique, they demonstrate that even fixed-width GNNs can exhibit infinite VC dimension if their weights possess infinite precision. Crucially, they introduce an upper bound for the VC dimension based on the number of unique "colors" (labels) the 1-WL algorithm produces, formally linking structural complexity to learning capacity.

Key Insights and Empirical Results

By merging these theoretical frameworks, the paper yields several critical insights into how GNNs learn:

  • The Expressivity-Generalization Trade-off: The research formalizes a fundamental trade-off: the more "expressive" a graph's structure is (yielding more 1-WL colors), the higher the GNN's VC dimension becomes. While high expressivity is beneficial for distinguishing graphs, it inherently makes generalization harder, requiring more training data to avoid overfitting. Specifically, the VC dimension scales as $O(P \log(puP))$, where $P$ is the number of parameters and $u$ is the number of 1-WL colors.
  • First Tight Lower Bounds: While previous works focused on upper bounds (what a GNN cannot do), this paper provides the first tight lower bounds for GNN VC dimension, showing exactly how much data is needed to "shatter" specific graph sets.
  • Empirical Confirmation: The theoretical findings were validated using standard graph classification benchmarks (e.g., ENZYMES, MCF-7, MUTAGENICITY, NCI1) and synthetic directed trees. On the ENZYMES dataset, increasing the feature dimension (a proxy for parameter count) caused the generalization gap—the difference between training and testing accuracy—to skyrocket from 5% to over 45%. Furthermore, experiments on synthetic trees confirmed that higher-capacity GNNs could perfectly fit random labels, empirically validating the link between bitlength, parameters, and VC dimension.

Limitations and Future Directions

While this work provides foundational theoretical bounds, the authors acknowledge that VC dimension is a "worst-case" measure. In the modern era of over-parameterized deep learning, models often generalize well even when their theoretical capacity is massive—a phenomenon known as "benign overfitting." VC dimension does not fully capture the implicit regularization provided by optimizers like Stochastic Gradient Descent (SGD).

A key future challenge lies in understanding how graph structure influences the generalization of these over-parameterized GNNs in practice. Additionally, while this study focuses on the 1-WL algorithm, extending these tight bounds to higher-order GNNs ($k$-GNNs) and other expressive architectures remains an open and exciting area for deeper exploration.

Summary updated

BibTeX
@inproceedings{morris2023wl,
  author = {Christopher Morris and Floris Geerts and Jan Tönshoff and Martin Grohe},
  title = {{WL meet VC}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=o32SFpWNzY},
}
Figure