---
title: Weisfeiler-Leman Features for Planning
url: https://www.emergentmind.com/topics/weisfeiler-leman-features-for-planning-wlfs
type: topic
---

# Weisfeiler-Leman Features for Planning

Weisfeiler-Leman Features for Planning (WLFs) are fixed-length, vectorized representations derived from symbolic planning states by applying the 1-dimensional Weisfeiler-Leman (WL) color-refinement algorithm to graph encodings of planning states. WLFs have decisive theoretical and empirical advantages in learning value functions and synthesizing heuristic functions for symbolic planning, outperforming both classical and deep neural models in efficiency, interpretability, and benchmark coverage [2508.18515][2403.16508][2508.18520].

## 1. Formal Definition and Theoretical Motivation

WLFs are constructed by transforming a planning state—typically a lifted STRIPS problem instance $P = \langle O, P, A, s_0, G \rangle$—into an *Instance Learning Graph* (ILG). The ILG is a bipartite, edge-labelled graph $G=(V, E, F, L)$, where:

- $V$: Union of object nodes and atom nodes (facts from $s_0$ and $G$).
- $E$: Each atom node $p=P(o_1,\ldots,o_k)$ connects bidirectionally to its $k$ argument objects ($o_i$), with each edge labeled by its argument position ($1 \leq i \leq k$).
- $F: V \to \Sigma_V$: Assigns node features distinguishing objects (“ob”) and atom types ((ap,P), (ug,P), (ag,P) for atoms “present only,” “goal only,” or “both,” tagged by predicate symbol).
- $L: E \to \{1, \dots, \max\text{-arity}\}$: Edge labeling by argument position.

The 1-dimensional WL algorithm iteratively refines node colorings using injective hashing over each node’s current color and the multiset of labeled neighbor colors, with edge labels dictating neighborhood structure. The color patterns produced capture domain-independent relational structure, with each coloring token representing an equivalence class of subgraph patterns relevant to the planning problem [2508.18515][2403.16508][2508.18520].

## 2. Algorithmic Construction of WLFs

The WLF construction proceeds as follows on the graph $G = (V, E, F, L)$ for $L$ iterations:

1. **Initialization:** Set $c^0(v) \gets F(v)$ for every $v \in V$.
2. **WL Refinement (for $\ell = 1\ldots L$):**  
   For each $v \in V$, collect the labeled neighborhood multiset $M_v = \{(c^{\ell-1}(u), L(u, v)) : u \in N(v)\}$ and update $c^\ell(v) \gets \text{HASH}(c^{\ell-1}(v), M_v)$.
3. **Feature Extraction:** Collect the multiset $\bigcup_{\ell=0}^L \{ c^\ell(v) : v \in V \}$ as the WLF vector for the state.

Across the dataset, the union $C$ of all observed colors determines the feature basis. Any new planning state’s feature vector $x(G) \in \mathbb{R}^{|C|}$ encodes counts of each color $c_i \in C$. This process is efficiently implementable with a lazy-injective hash table, and all experiments demonstrate scalability to millions of examples on single-core CPUs [2508.18515][2403.16508][2508.18520].

## 3. Hyperparameters and Empirical Trade-Offs

A comprehensive hyperparameter analysis found key trade-offs for WLFs [2508.18515]:

- **WL Algorithm Variant:**  
  - *WL* yields the fastest training and smallest models; *iWL*/*niWL* offer larger feature sets at quadratic cost with marginal (often negative) coverage benefit; *2-LWL* increases expressivity but not coverage.
- **WL Iterations ($L$):**  
  - Larger $L$ yields higher model size and training time without improving (and sometimes degrading) planning coverage; $L=1$ or $2$ balances cost and expressivity.
- **Feature Pruning:**  
  - *i-mf* (iterative MaxSAT + frequency pruning) condenses feature sets by 10–20% without coverage loss, enhancing generalization and training speed.
- **Hash Function:**  
  - *Set*-based hashing reduces the color basis size by up to 50% in various domains, leading to smaller models and faster feature generation.
- **State Representation:**  
  - *Partial* graphs (“part”; only relevant facts) yield $2\text{--}5\times$ smaller graphs and faster processing than *cmpl* (“complete,” all propositions), typically with equal or better coverage.
- **Heuristic Learner:**  
  - Ranking pipelines (rkLP, rkSVM, rkGPC) produce superior planning coverage vs regression (Lasso, SVR, GPR), with rank-SVM yielding the top performance at longer training times.

The best empirical configuration (WL, $L=1$, i-mf, set, part, rkSVM) consistently maximizes coverage and speed, supporting up to 447/900 coverage on IPC 2023 benchmarks—an absolute 12% gain over earlier defaults [2508.18515].

| Hyperparameter        | Choices/Range                                   | Best in Study         |
|----------------------|-------------------------------------------------|-----------------------|
| WL Algorithm         | WL, iWL, niWL, 2-LWL                            | WL                    |
| Iterations ($L$)     | 1–8                                             | 1                     |
| Feature Pruning      | none, i-mf                                      | i-mf                  |
| Hash Function        | multiset, set                                   | set                   |
| State Representation | part, cmpl                                      | part                  |
| Optimiser            | Lasso, SVR, GPR, rkLP, rkGPC, rkSVM             | rkSVM                 |

## 4. Statistical Analysis and Implementation

Large-scale experiments (over a million planning runs) found no statistically significant or strong correlation (Pearson $|\rho| \geq 0.5$, $p<0.05$) between standard training metrics (loss, model size, or training time) and actual planning coverage, for any optimizer. This result holds across all tested configurations and domains, confirming that validation on actual planning runs, not surrogate metrics, is required for robust model selection [2508.18515].

All experiments were performed with single-core Intel Xeon hardware, demonstrating that WLF-based pipelines excel without the need for GPU or multi-core infrastructure. The WLF algorithm can be implemented using lazy hash tables for color management to ensure injectivity and avoid expensive string manipulation. Set-based hashing and partial graphs are especially recommended for practical efficiency [2508.18515].

## 5. Practical Applications: Heuristic Learning and Novelty Detection

**Learning Heuristic Functions:**  
WLFs enable the transformation of planning states into dense, informative feature vectors that can be used to train heuristic value functions via regression or ranking. In comparisons against $h^{FF}$ and neural GNN baselines such as Muninn and GOOSE, WLF-based SVR and GPR consistently achieve higher coverage, train 2–3 orders of magnitude faster, and use 1–2 orders of magnitude fewer parameters [2403.16508].

**Novelty Heuristics and Symmetry Invariance:**  
WLFs have been successfully integrated into novelty heuristics, replacing atom-based novelty detection to yield symmetry-invariant exploration drives. Since WLFs are invariant to object renamings (isomorphisms of the planning state ILG), they prevent redundant exploration and yield improved coverage in highly symmetric domains. WL-based novelty heuristics outperform atom-novelty in domains such as Childsnack and Ferry [2508.18520].

## 6. Theoretical Connections and Expressivity

WLFs possess strictly higher or incomparable expressivity compared to leading alternatives:

- WLFs and general GNNs on ILG are provably equivalent in distinguishing non-isomorphic planning instances.
- Muninn’s GNN and Description Logic Features (DLF) are strictly less expressive; WLFs and DLF are mutually incomparable.
- No feature-extraction scheme among WLF, GNN-ILG, Muninn, or DLF guarantees perfect learnability of the optimal heuristic $h^*$ for all tasks (incompleteness in Theorem 4 and Corollary 5) [2403.16508].

This hierarchy establishes WLFs as maximally expressive within efficiently computable, domain-independent, relational feature extraction regimes for symbolic planning.

## 7. Domains, Benchmarks, and Empirical Results

WLFs have been evaluated on IPC Learning Track 2023 domains: Blocksworld, Childsnack, Ferry, Floortile, Miconic, Rovers, Satellite, Sokoban, Spanner, and Transport. Training utilized optimal $h^*$ labels with up to 65,000 labeled states per domain; testing involved 900 held-out problems. Metrics include coverage (problems solved within timeout), IPC score, and cumulative coverage over time. WLF-based heuristics uniformly outperform $h^{FF}$ and tie or beat LAMA on up to 7/10 domains in plan quality, while training in seconds and generalizing robustly across domains [2508.18515][2403.16508].

## References

- Weisfeiler-Leman Features for Planning: A 1,000,000 Sample Size Hyperparameter Study [2508.18515]
- Return to Tradition: Learning Reliable Heuristics with Classical Machine Learning [2403.16508]
- Symmetry-Invariant Novelty Heuristics via Unsupervised Weisfeiler-Leman Features [2508.18520]

Source: https://www.emergentmind.com/topics/weisfeiler-leman-features-for-planning-wlfs