Invariant-Based Diagnostics for Graph Benchmarks

Richard von Moos, Mathieu Alain, Bastian RieckarXiv 2026

TL;DR

This paper introduces a diagnostic framework for graph machine learning benchmarks using graph invariants—permutation-invariant, task-agnostic structural descriptors (like the Wiener index or degree entropy). By pairing these non-trainable structural features with a simple XGBoost classifier, the authors reveal that standard graph neural networks (GNNs) often fail to leverage graph structure effectively. Surprisingly, this simple invariant-based baseline frequently matches or outperforms state-of-the-art GNNs and graph transformers across 26 datasets.

What Problem Does This Paper Address?

Progress toward building Graph Foundation Models (GFMs) is currently bottlenecked by flawed benchmarking practices. Standard graph datasets often conflate the contributions of node features and graph connectivity, making it incredibly difficult to tell whether a complex model is actually learning from the graph's structure or simply over-relying on local node features.

Furthermore, current evaluation practices suffer from small dataset sizes, a lack of structural diversity, and an over-emphasis on theoretical expressivity (like the Weisfeiler-Lehman test) that doesn't necessarily translate to real-world predictive performance. The authors tackle this by asking a fundamental question: How much does graph structure actually matter for a given task, and are our models truly capturing it?

Methods

Instead of using trainable message-passing layers to extract structure, the authors precompute a diverse family of static graph invariants divided into four categories:

  1. Basic graph-theoretic: Number of vertices/edges, circuit rank, diameter, radius, transitivity, density, etc.
  2. Entropy-based: Degree entropy, von Neumann entropy, and Kolmogorov complexity.
  3. Geometric and topological: Magnitude, analytic torsion, homomorphism counts, Forman-Ricci/Ollivier-Ricci curvature, and commute time.
  4. Graph indices: Wiener, Randić, Zagreb, Schultz, Gutman, Szeged, and Balaban indices.

These invariants are concatenated into a single tabular feature vector per graph. To evaluate performance, the authors feed these vectors into XGBoost, an efficient and easily tuned gradient-boosted tree ensemble. They define four primary input configurations to isolate the effects of features vs. structure:

  • sum: A basic sum-based node feature representation.
  • agg: An aggregation-based feature representation that mimics message-passing without non-linearities or training.
  • I: The full set of graph invariants.
  • S: A minimal, highly expressive subset of invariants determined via greedy selection on the BREC dataset.

The authors also introduce a "meta-classification" task, where an XGBoost model tries to predict which dataset a graph belongs to based solely on its structural invariants.

Datasets

The framework is evaluated across 26 datasets spanning multiple domains:

  • Molecular: BACE, BBBP, HIV, ZINC (12k), Lipo, PCQM4Mv2, Peptides-func, Peptides-struct, PCBA, QM9.
  • Computer Vision: CIFAR10 (represented as pixel grid graphs).
  • Combinatorial Optimization: CO_BA_small.
  • Electronic Circuits: Circuits_5_eff, Circuits_5_vout, Circuits_7_eff, Circuits_10_eff, Circuits_10_vout.
  • Algorithmic Reasoning: Flow_easy, Flow_medium, Flow_hard.
  • Social & Biological: NCI1, NCI109, COLLAB, PROTEINS, IMDB-b, REDDIT-b.
  • Expressivity Benchmark: BREC (400 pairs of 1-WL indistinguishable graphs).

Key Insights and Ideas

  • Expressivity $\neq$ Downstream Performance: While a subset of just four invariants (S) can match the full set's expressivity on the theoretical BREC benchmark, it yields significantly worse predictive performance on downstream tasks. Theoretical expressivity alone is a poor proxy for real-world utility.
  • Pronounced Dataset Shift: The meta-classification model achieved roughly 56% accuracy across 23 mixed datasets, and up to 93% accuracy when classifying datasets within the same domain. This means graphs from different benchmarks are structurally distinct, highlighting a severe lack of structural homogeneity that impedes the development of generalizable graph foundation models.
  • Structure is Often Redundant: In many standard benchmarks, adding invariants to a simple sum baseline yields massive gains, but adding them to an agg baseline yields diminishing returns. This indicates that basic, non-trainable neighborhood aggregation already captures the bulk of the structural information needed for the task.

Key Results

  • Outperforming Deep Models: On the algorithmic "Flow" datasets, the simple invariant baseline (agg + I) outperformed the best-reported deep learning results by a large margin.
  • Competitive with Transformers: As shown in Figure 6, the agg + I baseline performs on par with or better than highly parameterized graph transformers (like GPS and GRIT) and message-passing architectures across several standard classification and regression datasets (e.g., PROTEINS, BBBP, Peptides-struct).
Performance comparison of the invariant baseline against literature methods across multiple datasets.
  • Predicting Multi-Task Suitability: The authors found a strong negative correlation between meta-classification accuracy and multi-task learning performance (Figures 2 and 3). If invariants can easily distinguish two datasets structurally, training a model on both tasks simultaneously will cause gradient misalignment and degrade performance.

Limitations and Future Work

  • Graph-Level Restriction: The current analysis is strictly limited to graph-level classification and regression tasks; it does not yet extend to node-level or edge-level predictions.
  • Computational Intractability: Several highly informative invariants (like analytic torsion or large homomorphism counts) become computationally intractable on large or dense graphs, requiring the use of a pruned, "reduced-invariant" regime.
  • Static vs. Dynamic Interplay: The multi-task experiments alter both the graph structure and the task objective simultaneously. Future work is needed to vary these factors independently to isolate their exact interactions.

Summary updated

BibTeX
@misc{moos2026invariant,
  author = {Richard von Moos and Mathieu Alain and Bastian Rieck},
  title = {{Invariant-Based Diagnostics for Graph Benchmarks}},
  year = {2026},
  eprint = {2605.06462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.06462},
}
Figure