✓ Mechanism works 2026

Rooted Motif Positional Encoding

Implementation & benchmark of arXiv:2607.01358 — Beyond Degree: Rooted Motif Signatures for Latent Position Identifiability in Graphon Models

Usefulness7/10
Difficulty4/10
Novelty6/10

Source paper: Beyond Degree: Rooted Motif Signatures for Latent Position Identifiability in Graphon Models arXiv:2607.01358 ⓘ · analyzed Aug 30, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Augment every graph node with a vector of rooted walk and motif densities rather than relying only on degree or Laplacian positional encodings. This should distinguish nodes or communities with identical expected degree but different connectivity profiles, especially in equal-degree stochastic block models and graphs with locally heterogeneous structure.

Formulas

$$g(u)=\int_0^1 W(u,v)\,dv=T_W\mathbf{1}(u)$$
$$h_k(u)=T_W^k\mathbf{1}(u)=\sum_{j=1}^{m}\lambda_j^k c_j\phi_j(u),\qquad c_j=\langle\mathbf{1},\phi_j\rangle$$
$$\begin{pmatrix}h_1(u)\\h_2(u)\\\vdots\\h_m(u)\end{pmatrix}=V\,\operatorname{diag}(c_1,\ldots,c_m)\begin{pmatrix}\phi_1(u)\\\phi_2(u)\\\vdots\\\phi_m(u)\end{pmatrix},\quad V_{kj}=\lambda_j^k$$
$$\det(V)=\left(\prod_{j=1}^{m}\lambda_j\right)\prod_{1\leq i<j\leq m}(\lambda_j-\lambda_i)\neq0,\qquad \widehat h_k=\left(\frac{A}{n}\right)^k\mathbf{1},\quad \widehat t_{\triangle}(i)=\left[\left(\frac{A}{n}\right)^3\right]_{ii}$$

Mathematical statement

Let W be a graphon and let T_W f(u) = integral from 0 to 1 of W(u,v) f(v) dv be its integral operator. The degree function is g(u) = T_W 1(u). For a finite-rank graphon with W(u,v) = sum from j=1 to m of lambda_j phi_j(u) phi_j(v), where the eigenvalues lambda_1 through lambda_m are pairwise distinct, define c_j = inner product of 1 and phi_j. The rooted walk moments satisfy h_k(u) = T_W^k 1(u) = sum from j=1 to m of lambda_j^k c_j phi_j(u). For k = 1 through m, the moment vector equals V diag(c_1,...,c_m) times the eigenfunction-coordinate vector, where V_{kj} = lambda_j^k. The paper gives det(V) = (product over j of lambda_j) times (product over i less than j of (lambda_j - lambda_i)), which is nonzero under distinct nonzero eigenvalues. If every c_j is nonzero, the moments determine the eigenfunction coordinates. For a finite graph with adjacency matrix A and n nodes, use empirical features h_hat_k(i) = ((A/n)^k 1)_i. A rooted triangle feature is t_hat_triangle(i) = [(A/n)^3]_{ii}. Small eigenvalue gaps or small overlaps c_j predict unstable or non-discriminative encodings.

Implementation notes

Integrate this at the input positional-encoding stage of a message-passing GNN or graph transformer. For a graph with adjacency matrix A and n nodes, compute K short rooted-walk channels without constructing dense matrix powers. Initialize q to an all-ones vector. For k from 1 through K, replace q by (A multiplied by q) divided by n, and append q as the k-th node feature channel. Compute a rooted triangle channel as the diagonal of A multiplied by A multiplied by A, divided by n cubed. With sparse graphs, use sparse matrix-vector products for walks and sparse matrix-matrix products or a triangle-counting kernel for triangles. Concatenate the original node features with all motif channels, standardize each channel across nodes, then apply LayerNorm and a learned linear projection before the first GNN or attention layer. Pseudocode is: q = ones(n); channels = []; for k in 1,...,K: q = sparse_matvec(A,q)/n; channels.append(q); triangle = diag(A @ A @ A)/n^3; z = Linear(LayerNorm(concat(x, channels, triangle))); output = GNN(z,A). Use K equal to 3 or 4 initially. The exact mathematical computation is the rooted-walk recursion and the finite-rank Vandermonde identifiability argument; eigenvalues do not need to be estimated in the first implementation. For a conditioning-aware variant, estimate the leading eigenvalues of A/n with Lanczos and reduce the weight of channels when eigenvalue gaps are small or when the empirical feature variance is near zero. First experiment: use a two-layer GCN and a graph transformer for node classification on four-block stochastic block model graphs whose blocks have equal expected degrees but different within-block connectivity patterns. Compare raw features, degree features, Laplacian positional encodings, and the proposed features at similar parameter counts. Use graphs with 500 to 2000 nodes and sparse matrix operations. The main success signal is higher test accuracy and better accuracy with fewer labeled nodes, while also reporting feature-computation time and robustness under edge noise.

Verification

Mechanism works

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Not tested

Stage 2 · Practical benchmark result: Not run

Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works

Stage 1 — Mechanism check agent confidence 7/10

Built a sparse rooted-walk and rooted-triangle feature extractor plus a finite-rank Vandermonde numerical verification. The mathematical identities passed at approximately 1e-17 numerical error. On the equal-row-sum four-block SBM, degree-only accuracy was 25.08%, walks-only 24.94%, triangles-only 25.12%, while walks plus triangles reached 27.30%, a modest but consistent improvement over chance and the baseline; the idea shows a promising signal, though not every channel helped alone.

Agent confidence
7/10
Baseline
Degree features: mean accuracy 0.2508 +/- 0.0126 over 8 runs
Idea
Walks + rooted triangle: mean accuracy 0.2730 +/- 0.0156 over 8 runs; mean feature computation time 0.296 s per graph

Limitations: This MVP used a logistic classifier rather than a GNN or graph transformer, tested one 800-node SBM family and one 20% labeled split, and did not test Laplacian encodings, edge-noise robustness, larger graphs, GPU execution, or multiple graph families. The improvement is modest and rooted walks alone did not outperform degree.

How to run: python3 experiment.py > results.json

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Artifacts

Implementation overview ⬇ Download all as ZIP 3 files · code, reports and structured results