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

k-th Order Deep Homomorphism Networks

Takanori MaeharaNeurIPS 2026

TL;DR

Standard Graph Neural Networks (GNNs) are notoriously blind to simple shapes like cycles, and giving them better eyesight usually requires an exponential jump in computational cost. This paper introduces a unified algebraic framework—and two neural architectures, $k$-DHN and $k$-FDHN—that lets us separately dial in global network reasoning and local motif detection. By decoupling these two axes, you can spot complex local structures in molecules or circuits at a fraction of the computational cost, while neatly unifying a messy zoo of existing GNN architectures under one mathematical roof.

What Problem Does This Paper Address?

Standard message-passing GNNs pass notes between immediate neighbors. While fast, this makes them mathematically equivalent to the 1-dimensional Weisfeiler–Leman (1-WL) graph isomorphism test—meaning they fundamentally cannot count cycles or distinguish many basic graph structures.

To see more, researchers usually turn to higher-order GNNs that track $k$-tuples of nodes simultaneously ($k$-WL or $k$-FWL). The catch? Memory and compute scale as $O(n^k)$. Consider a molecule like Adapalene or an electronic circuit: the global backbone is structurally simple (low treewidth, a measure of how "tree-like" a graph is), except for one or two dense, thorny 3D cages or bridge rectifiers.

Figure 1: (a) Adapalene [65]: ring backbone (blue, treewidth ≤2) via k = 2; adamantyl substituent (red, treewidth 3) via P. (b) Bridge rectifier (K4, treewidth 3) via P.

Raising $k$ across the entire graph just to spot one local cage is massive computational overkill. Conversely, existing pattern-matching networks like Deep Homomorphism Networks (DHN) let you specify local motifs to look for, but can only arrange them in globally tree-like ways ($k=1$). Until now, you had to choose one or the other; there was no way to tune global complexity ($k$) and local pattern vocabulary ($\mathcal{P}$) independently.

Methods

The author builds an algebraic engine for counting graph homomorphisms (structure-preserving maps from a small pattern graph into your target graph—essentially, a mathematically clean way to count substructures) using $k$-labelled patterns (graphs with $k$ distinguished anchor nodes).

Figure 2: Landscape of GNN models by skeleton complexity (k) and pattern vocabulary (P).
  • Standard Operations ($k$-DHN): Starting with basic patterns in a vocabulary $\mathcal{P}$, the framework builds larger structures using two classic operations: series composition ($\triangleright$, chaining patterns end-to-end and summing counts) and gluing ($\odot$, fusing anchor nodes together and multiplying counts). Turning these recursive sums and products into learnable neural layers yields $k$-DHN, which generalizes standard $k$-WL models.
Figure 3: Series composition and gluing at k = 2. Purple vertices carry the current labels; grey vertices are unlabelled. Blue edges are contributed by P.
  • Novel Operation ($k$-FDHN): In GNN lore, "Folklore" WL ($k$-FWL) is strictly more expressive than $k$-WL despite using the same $O(n^k)$ memory, because it synchronizes node substitutions. To capture this algebraically, the author invents auxiliary gluing ($\circledast$). It temporarily glues $k$ patterns together at a phantom vertex $*$ before erasing $*$’s label. Adding this operation to the neural layer (via elementwise vector products, similar to matrix multiplication at $k=2$) yields $k$-FDHN.

Datasets

  • BREC: An established, tough expressivity benchmark of 400 pairs of non-isomorphic graphs (spanning Basic, Regular, Extension, and CFI categories) designed to stress-test WL-style algorithms.
  • Synthetic Planted-Motif Graphs (New): Binary classification datasets of 32-node random 5-regular graphs rewired to hide specific dense subgraphs ($K_4$ cliques, $K_4^-$ diamonds, or $K_{3,3}$ bipartite graphs) to test whether neural models actually learn to use their theoretical expressivity from data.

Key Insights and Ideas

  • Why $k$-FWL beats $k$-WL (The Lifting Theorem): Using auxiliary gluing ($\circledast$), a symmetric $k$-label system can generate every single pattern of a $(k+1)$-label system without needing the extra label. This provides a clean, purely algebraic proof of the famous $(k+1)\text{-WL} \equiv k\text{-FWL}$ equivalence.
  • A Grand Unification (and Open Problems Solved): By plugging different pattern sets $\mathcal{P}$ and orders $k$ into this framework, you recover $k$-GNN, PPGN, spectral invariant GNNs, and node-marking subgraph GNNs. Using this lens, the author resolves open theoretical questions in the literature, proving strict expressivity hierarchies ($k\text{-WL} < \delta\text{-}k\text{-LWL} < \text{SLFWL}(k) < k\text{-FWL}$ for all $k \ge 2$).
  • Surrogate Learning Signals: Even if a target motif lies outside a model's theoretical pattern closure, lower-order patterns (like paths of length 2) can still achieve above-chance accuracy if their counts statistically covary with the hidden motif—though this shortcut breaks down when distractor motifs share those same lower-order stats.

Key Results

  • Speed vs. Power on BREC: Running $k=2$ with a $K_{3,3}$ pattern, 2-FDHN(+K_{3,3}) distinguishes 356/400 graph pairs in just 19.2 seconds total (6.5s pattern precomputation + 12.7s refinement) with $O(n^2)$ memory. Compare that to 3-FWL, which distinguishes 380/400 pairs, requires $O(n^3)$ memory, and takes 1,823.1 seconds—nearly 100x slower.
  • Confirming the Lifting Theorem: Adding a triangle pattern ($K_3$, treewidth 2) boosts 2-DHN from 0 to 168 pairs on BREC, whereas 2-FDHN stays flat at 270—confirming 2-FDHN already gets treewidth-2 patterns "for free" via auxiliary gluing.
  • Planted Motifs: Standard baselines (GIN and vanilla 2-FDHN) sit at ~50% random chance across all tasks. Adding $+K_4$ solves the $K_4$ vs. random (98.7%) and $K_4$ vs. diamond (91.2%) tasks, while $+K_{3,3}$ nails $K_{3,3}$ vs. random (99.3%).

Limitations and Future Work

  • Worst-case Pattern Counting: Counting homomorphisms for arbitrary patterns is #W[1]-hard in general. It runs in near-linear time in practice only because real-world graphs (like molecules and social networks) are sparse. Dense host graphs would bottleneck the precomputation step.
  • Open Theoretical Question: Does strictly expanding the set of constructible patterns ($\langle\mathcal{P}_1\rangle \subsetneq \langle\mathcal{P}_2\rangle$) always guarantee strictly stronger graph-distinguishing power? This is only proven when the smaller class is already "homomorphism-distinguishing closed," leaving the general case open.
  • Real-World Benchmarks: Because simple surrogate patterns worked surprisingly well on coarse synthetic tasks, the author notes that standard real-world GNN benchmarks might suffer from this same "surrogate shortcut" effect—a promising avenue to investigate why heavy higher-order GNNs often show only modest gains in practice.

Summary updated

Abstract

We develop a pattern-algebraic framework for higher-order graph neural networks by extending Deep Homomorphism Networks (DHN) from rooted patterns to $k$-labelled patterns. The framework captures GNN expressivity along two independent axes: skeleton complexity $k$, which controls global structure, and pattern vocabulary $\mathcal{P}$, which captures local structure. We introduce auxiliary gluing ($\circledast$), the pattern-algebraic counterpart of the $k$-FWL sift. A pattern closure built with $\circledast$ and invariant under label permutations generates every pattern of its $(k{+}1)$-label idle lift with only $k$ labels and therefore matches its expressive power. This yields an algebraic proof of $(k{+}1)$-WL $\equiv$ $k$-FWL. Neuralising these operations gives $k$-DHN and $k$-FDHN, which recover the distinguishing power of $k$-GNN, PPGN, $\delta$-$k$-LWL, and spectral invariant GNNs, and capture node-marking subgraph GNNs, with expressivity characterised by homomorphism indistinguishability over their pattern closures. The framework also resolves open expressivity separation problems in the $\delta$-$k$-LWL hierarchy at every $k \geq 2$, and gives a CFI-based proof of homomorphism-distinguishing closedness for the bounded-cycle cactus class associated with $r$-$\ell$WL.
BibTeX
@inproceedings{maehara2026k,
  author = {Takanori Maehara},
  title = {{k-th Order Deep Homomorphism Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=QHyHF56a42},
}
Figure