Papers
Topics
Authors
Recent
Search
2000 character limit reached

Weisfeiler-Leman Features (WLFs) Explained

Updated 9 July 2026
  • Weisfeiler-Leman Features (WLFs) are graph representations derived from iterative color refinement that capture both local and global graph structures.
  • Their construction adapts classical methods by incorporating pre-coloring, edge features, and topological lifts to boost expressiveness in graph analysis.
  • WLFs find practical applications in molecular property prediction, planning heuristics, and graph neural networks, offering robust alternatives to traditional approaches.

Weisfeiler-Leman Features (WLFs) are graph representations derived from the iterative color refinement procedures of the Weisfeiler-Leman family of algorithms. In the classical setting, WLFs are obtained from the node colors, tuple colors, or their histograms after refinement stabilizes; in contemporary work, the same constructional logic is extended to pre-colored graphs, edge-featured graphs, continuous node attributes, planning states encoded as graphs, graph kernels, optimal-transport distances, and topological lifts such as path complexes. As a result, WLFs occupy a central position between graph isomorphism, descriptive complexity, graph kernels, and graph neural networks (GNNs) (Huang et al., 2022).

1. Core definition and construction

In the classical 1-WL or color-refinement procedure, each node vv is assigned an initial color and then iteratively updated by hashing its current color together with the multiset of neighbor colors: cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right). After stabilization, the multiset CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}, or a histogram built from the colors across iterations, serves as a graph invariant and as a graph-level feature representation. The kk-dimensional WL algorithm generalizes this from vertices to kk-tuples, initializing colors from the induced subgraph on each tuple and refining by aggregating colors of tuples obtained by coordinate replacement; the resulting multiset of tuple colors yields higher-order WLFs (Huang et al., 2022).

This basic construction is not restricted to uniform initialization. In the pre-coloring framework, one may start 1-WL from an arbitrary permutation-equivariant coloring CC, yielding 1-CCWL. The literature uses both combinatorial and spectral pre-colorings, including diagonal colors from kk-WL, $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$, and heat-kernel-based spectral features. In this formulation, WLFs are the node colorings, their histograms, or feature vectors obtained after refinement from a nontrivial initialization (Feldman et al., 2022).

Many applications expose WLFs explicitly as count vectors. In planning, for example, if the WL procedure on a graph GG returns a multiset cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).0 and cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).1 is the union of observed colors, then the state representation is written as

cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).2

This count-based representation makes WLFs directly compatible with linear models, ranking models, and kernel methods (Chen, 25 Aug 2025).

2. Expressive power, invariance, and limitations

WLFs are closely tied to the expressivity of graph-learning architectures. Standard message passing neural networks are at most as powerful as WL in distinguishing non-isomorphic graphs, and several higher-order GNN constructions are designed precisely to emulate or extend the corresponding WL refinements. A central consequence is that the representational ceiling of a GNN class can often be stated in WL terms (Nikolentzos et al., 2022).

A common misconception is that low-dimensional WLFs recover arbitrary motif statistics. The subgraph-count results are substantially more selective. For cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).3, up to isolated vertices, the class cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).4 of graphs whose subgraph counts are 1-WL-invariant consists exactly of the star graphs cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).5 and the 2-matching cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).6. For cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).7, explicit positive cases include matching graphs cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).8 iff cv=hash(cv1,{ ⁣ ⁣{cw1:wNG(v)} ⁣ ⁣}).c_v^\ell = \text{hash}\left(c_v^{\ell-1}, \{\!\!\{c_w^{\ell-1} : w \in \mathcal N_G(v)\}\!\!\}\right).9, cycle graphs CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}0 iff CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}1, and path graphs CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}2 iff CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}3. At the same time, CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}4, only finitely many cycles belong to CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}5 for every CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}6, and sufficiently long path graphs are omitted from CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}7 (Arvind et al., 2018).

On planar graphs, the situation is much stronger. There is a constant CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}8 such that every planar graph on CG={ ⁣ ⁣{cv:vV} ⁣ ⁣}\mathcal C_G = \{\!\!\{ c_v^\ell : v \in V \}\!\!\}9 vertices is identified by kk0-WL within kk1 iterations. For 3-connected planar graphs, the analysis of 2-WL colorings yields a trichotomy: after coloring all pairs with their 2-WL color, either the graph has fixing number 1 with respect to 1-WL, or there is a 2-WL-definable matching that transforms the graph into a smaller one, or 2-WL detects a connected subgraph essentially equal to a Platonic or Archimedean solid, a prism, a cycle, or kk2 (Grohe et al., 2021, Kiefer et al., 2022).

Worst-case behavior nonetheless remains highly nontrivial. The maximum iteration number of kk3-WL on kk4-vertex graphs is at least kk5 for all kk6, via compressed CFI constructions, while the WL-dimension of a graph on kk7 vertices is at most kk8 (Grohe et al., 2023, Schneider et al., 2024).

3. Principal variants and generalizations

The modern literature alters three main components of the classical WLF pipeline: initialization, neighborhood definition, and post-processing. Spectral and combinatorial pre-colorings enrich initialization; edge-aware refinements modify aggregation inputs; persistent and topological constructions append random-walk or homological structure; and sparse higher-order variants restrict tuple neighborhoods for scalability (Feldman et al., 2022, Yue et al., 4 Dec 2025, Park et al., 2022, Morris et al., 2019, Truong et al., 2023).

Variant Core construction Stated consequence
Spectral / combinatorial pre-coloring Run 1-kk9WL from kk0 or heat-kernel features Expressive power can increase ad infinitum; degree pre-coloring does not increase expressiveness
E-WL Replace neighbor-color multiset with kk1 At least as discriminative as 1-WL with edge features; reduces to 1-WL if edge features are absent
PWLR kk2 Integrates local topology, node degrees, and global topology; stable to perturbations
kk3-k-LWL / kk4-k-LWL+ Aggregate only over local tuple neighbors More scalable and less prone to overfitting; kk5-k-LWL+ is strictly more powerful than kk6-WL
PWL / path-complex lifting Color elementary paths using boundary, co-boundary, and upper/lower adjacency At least as powerful as SWL and CWL(kk7-IC) with maximum dimension 2

Several of these variants change the input object rather than only the hash. E-WL replaces the multiset of neighbor colors by multisets of node-edge tuples, so graphs with identical topology and node features but different edge features are no longer confused. PWLR normalizes WL propagation, then composes it with random walks and persistent homology to incorporate local topological features, node degrees, and global topological invariants while preserving stability from graph perturbations. The sparse higher-order variants kk8-k-LWL and kk9-k-LWL+ restrict aggregation to local tuple neighborhoods, giving reduced computation times and preventing overfitting, while path-complex lifts color elementary paths and generalize clique- or cycle-based topological message passing.

4. WLFs in molecular and graph representation learning

A prominent instantiation of WLFs appears in molecular GNNs. In this setting, each node CC0 has a label CC1, and the multiset of neighboring labels is CC2. Standard atomic embedding uses CC3, whereas naive WL embedding uses

CC4

with CC5 an injective hash on the pair of the atom label and the neighbor-label multiset. C-WL and G-WL further factorize atomic and neighborhood information and combine them by concatenation or gating. In representability terms, WL embedding can replace the first two layers of a ReLU GNN with a smaller weight norm (Ishiguro et al., 2020).

The empirical picture in molecular property prediction is correspondingly strong. On a synthetic subgraph-detection task, atomic embedding plus a single-layer GNN could not fit the task, whereas direct WL embedding with no GNN layers solved it. On 8 MoleculeNet datasets and 5 GNN architectures, at least one WL embedding variant improved performance in 37/40 dataset–architecture pairs; C-WL was the most consistently strong variant, shuffling neighbor labels reduced performance, and 2-step expansions helped when data was abundant while deeper expansions caused overfitting and sparsity.

For graph classification more broadly, PWLR defines

CC6

where normalized WL propagation, random walks, and persistent homology are combined in a single representation. The method generalizes many WL variants, handles both discrete and continuous node features, and yields low-dimensional feature vectors independent of the size of the training set. Its reported performance is comparable to state-of-the-art methods on graphs with discrete node labels and enhanced on graphs with continuous node features (Park et al., 2022).

A separate line interprets WLFs as a hierarchy that induces a node distance. In this framework, WLFs are the sequences of color classes assigned across WL iterations, and the distance CC7 is the tree distance in the resulting hierarchy. Because that hierarchy is tree-structured, the proposed embeddings are learned in the Poincaré ball. On a synthetic graph, the correlation between hyperbolic distances and WL hierarchy distances reached CC8, compared to CC9 for standard Euclidean GIN embeddings; the method is further described as robust to noise and as not suffering from over-smoothing as depth increases (Nikolentzos et al., 2022).

In planning, WLFs are state-centric, unsupervised features derived by encoding a planning problem as a graph and applying the WL algorithm. A lifted STRIPS problem CC0 is transformed into a graph CC1, where nodes represent objects, atoms from the initial state, and goal facts; edges encode relational structure and may carry argument-position labels. The experiments use the Instance Learning Graph, and WLFs are generated with a fixed number of iterations, CC2, producing a multiset denoted CC3 (Chen, 25 Aug 2025).

These features are then used in novelty heuristics. For a feature mapping CC4, the generalized QB heuristic is

CC5

with

CC6

CC7

If CC8, this recovers the standard atom-based novelty heuristic; if CC9, it yields the Weisfeiler-Leman Novelty Heuristic. Because the WL feature multiset is graph-invariant, kk0, so symmetric states are not distinguished. On IPC 1998–2023 and Hard To Ground benchmarks, WLF-based novelty outperformed atom-based novelty in some highly symmetric domains, atom and WL features were often complementary, and the union AT;WL often achieved higher coverage than either feature family alone. The same work also notes the main limitation: WL is incomplete for graph isomorphism, so some asymmetric states may be conflated, and excessive symmetry-invariance may harm progress in some domains.

A subsequent hyperparameter study scaled this planning use case to 1,000,000 samples. It evaluated WL, iWL, niWL, and 2-LWL, along with pruning, hash functions, state representations, and optimizers, across 10 IPC-Learning Track 2023 domains, up to 1,152 configurations per domain, and up to 1,036,800 planning runs. The best-performing configurations for coverage generally used WL (1-WL), 1 iteration, set hash, part state representation, and rkSVM. The study concludes that the best WLF hyperparameters for learning heuristic functions minimise execution time rather than maximise model expressivity, and it reports no significant correlation between training and planning metrics (Chen, 25 Aug 2025).

6. Distances, reinterpretations, and nonstandard domains

The WL distance turns WLFs into a metric-like object on labeled graphs. For a labeled measure Markov chain, the construction sets kk1, defines kk2, and aggregates globally as kk3. The depth-kk4 WL distance is then

kk5

This distance has the same discriminative power as the classic WL test, is reinterpreted via Markovian and bi-causal couplings, and is used to analyze the Lipschitz property and universal approximation results for message passing neural networks (Chen et al., 2023).

WLFs also appear in scientific inference outside standard graph classification. In weak chemical tagging, stars in a 15-dimensional elemental abundance space are turned into graphs by connecting stars whose Euclidean distance in chemical space is below kk6 dex; node labels are initialized by degree, and five WL iterations were found optimal. Combined with Gaussian Process Regression, the WL graph kernel was reported as superior in interpretability, efficacy and robustness compared to deep sets and graph convolutional neural networks, while enabling optimal training with kk7 simulations, a reduction of at least two orders of magnitude relative to graph neural networks (Ting et al., 2023).

A distinct reinterpretation arises in mechanistic interpretability. Sparse autoencoder features from GPT-2 Small are represented as token co-occurrence graphs whose node labels are log-binned into 64 bins and whose edges encode co-occurrence counts; a custom WL-style kernel performs kk8 iterations and uses the final node-label histogram as the explicit feature map. The resulting clustering recovered punctuation-heavy patterns, language and script clusters, and code-like templates not recovered by decoder cosine similarity. The token-histogram baseline still had higher overall purity (kk9 versus $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$0), but the WL-style kernel recovered an alphabetic-dominant cluster with purity $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$1, whereas decoder-cosine clustering had $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$2; cross-corpus consistency reached $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$3 and $\Delta(k\mbox{-}WL)(v)=C_{k\mbox{-}WL}(v,\ldots,v)$4 (Fernandez-Boullon et al., 7 May 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (18)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Weisfeiler-Leman Features (WLFs).