betaFeedback

WorksComputer Science

Random Probing for Structural Self-Interactions in Graph Neural Networks

Abstract

Graph Neural Networks (GNNs) fundamentally lack the ability to capture structural properties defined by node self-interactions, such as cycle counts, subgraph centrality, and heat kernel signatures. Existing solutions often rely on computationally expensive higher-order architectures or hand-crafted features. In this work, we introduce DIAL, a message-passing layer that gives nodes access to graph structure through the diagonal of graph-derived operators. Our approach uses randomized probing to provide nodes with learnable, permutation equivariant access to diagonal entries. We prove that our approach can express important structural features, including cycle counts, subgraph centrality, and heat kernel signatures. The proposed method can be integrated directly into message passing layers. Experiments on molecular property prediction, cycle counting, and pattern detection demonstrate the effectiveness of DIAL across a range of graph learning tasks.

Introduction

Graph Neural Networks (GNNs) have been successful in many applications. However, they are known to have limited expressive power, often failing to distinguish basic structures or count fundamental motifs like cycles [1]. Higher-order GNN architectures can partially address these limitations, but often at a significant computational cost [2]. In practice, one often resorts to hand-crafted structural features, such as cycle or motif counts [3]. While effective, this approach is brittle and requires choosing the relevant structures in advance.

Many structural node properties that message passing fails to capture can be described in terms of self-interactions of nodes. Intuitively, these interactions quantify how information originating from a node flows through the graph and returns to it. Standard GNNs cannot capture such patterns—for example closed-walk participation—as they require isolating information that originates from a node and later returns to it. This concept naturally generalizes to subgraph centrality, which characterizes a node’s global importance by weighing its closed walk participation. In the spectral domain, Laplacian-based self-interactions cover graph angles (Figure 2), as well as diffusion dynamics like the heat kernel signature, which measures heat return rates over time.

Figure 2. Graph-angle structural encodings compared to Laplacian positional encodings. Left: Laplacian PE represents node ii by Φi,:\Phi_{i,:}, the row of eigenvector coordinates (in practice only a subset). This captures relative position in the graph: nodes 0 and 1 are close to each other so their encodings are similar, whereas nodes 4 and 5 are in different components so their encodings can be very different. Right: graph angles represent node ii by ((Pμj)ii)j=1q\left((P_{\mu_j})_{ii}\right)_{j=1}^{q}, where μ1,…,μq\mu_1,\ldots,\mu_q are the distinct (Laplacian) eigenvalues. Graph angles are an example of a structural encoding: unlike eigenvectors, graph angles assign the same representation to automorphic nodes (such as 4 and 5). They are also invariant to basis and sign choices.

Mathematically, these notions can all be expressed as functions of a Graph Shift Operator (GSO) SS, such as the adjacency matrix AA or Laplacian LL. Crucially, all such node-level self-interactions correspond to the diagonal entries of these GSO-derived operators M=f(S)∈Rn×nM=f(S) \in\mathbb{R}^{n \times n}. In practice, ff is often approximated by low-degree polynomials of the GSO, M=∑k=0K−1αkSkM = \sum_{k=0}^{K-1} \alpha_k S^k. This naturally aligns with message-passing architectures, which implicitly compute GSO polynomials through neighborhood aggregation. However, standard message-passing GNNs cannot express any of the self-interaction-based structural properties above. The aggregation mechanism mixes information from different nodes, failing to isolate self-interactions.

Our key observation is that message passing algorithms can access diagonal entries in a permutation equivariant way using a randomized probing mechanism. With a stochastic approach based on the Hutchinson diagonal estimator [4], nodes can efficiently approximate the diagonal of GSO powers, and hence the diagonal of any graph-derived operator, through simple message passing steps. This mechanism allows nodes to capture structural properties, such as cycle counts, within a fully learnable framework, avoiding rigid hand-crafted features and expensive higher-order architectures. See Figure 1 for an example of triangle counting.

Message-passing view of Hutchinson’s diagonal estimator

Figure 1. Message-passing view of Hutchinson’s diagonal estimator. We illustrate triangle counting for all nodes simultaneously using random probes and ordinary message passing. Left: The arrowed paths show a subset of length-3 messages received at v1v_1 and v4v_4. After propagation, node vv observes (A3z)v=∑u(A3)vuzu(A^3z)_v = \sum_u (A^3)_{vu}z_u, which mixes self-returning messages with messages originating elsewhere. Without identifying information, standard message passing cannot isolate the diagonal term. Right: Hutchinson’s estimator correlates the propagated value with the original probe zvz_v. Since E[zvzu]=0\mathbb{E}[z_vz_u] = 0 for u≠vu \ne v and E[zv2]=1\mathbb{E}[z_v^2] = 1, the non-diagonal terms vanish in expectation, yielding E[zv(A3z)v]=(A3)vv\mathbb{E}[z_v(A^3z)_v] = (A^3)_{vv}. For an adjacency matrix, this diagonal entry counts length-3 closed walks at vv, i.e., twice the number of triangles incident to vv.

The resulting architecture, which we call DIAL, can be integrated into any standard GNN and is permutation equivariant in expectation. Adjusting the number of random probes allows a trade-off between computational cost and estimation accuracy. We prove DIAL can express a variety of important structural properties, including cycle counts, graph angles, subgraph centrality, and heat kernel signatures.

Empirically, we evaluate DIAL on molecular property prediction on ZINC and on synthetic node-level pattern counting tasks. The results show that DIAL is competitive with spectral and random-probe positional encoding methods on ZINC, and improves over other random-probe methods on cycle counting while remaining substantially cheaper than specialized subgraph and higher-order architectures.1

Preliminaries

A graph is denoted G=(V,E)G = (V, E) with ∣V∣=n|V| = n. A graph shift operator (GSO) is a matrix S∈Rn×n\mathbf{S} \in\mathbb{R}^{n \times n}. Common choices include the adjacency matrix A\mathbf{A}, normalized adjacency D−1/2AD−1/2\mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2}, the Laplacian L=D−A\mathbf{L} = \mathbf{D} - \mathbf{A}, where D\mathbf{D} is the degree matrix, or the normalized Laplacian. We consider message-passing layers of the form

X(ℓ)=σ(∑k=0K−1SkX(ℓ−1)Hk(ℓ)),(1)\mathbf{X}^{(\ell)} = \sigma\left(\sum_{k=0}^{K-1}\mathbf{S}^{k}\mathbf{X}^{(\ell-1)}\mathbf{H}_{k}^{(\ell)}\right), \tag*{(1)}

where σ\sigma is a nonlinearity and Hk(ℓ)\mathbf{H}_{k}^{(\ell)} are learnable weights. The parameter KK controls the maximum hop distance used for aggregation (specifically K−1K - 1), with K=2K = 2 for typical GNNs such as GCN.

In what follows, we assume the graph is undirected, making the GSO symmetric. Let S=ΦΛΦ−1\mathbf{S} = \mathbf{\Phi}\mathbf{\Lambda}\mathbf{\Phi}^{-1} be the eigendecomposition of the GSO S\mathbf{S}, where Λ=diag⁡(λ1,…,λn)\mathbf{\Lambda} = \operatorname{diag}(\lambda_1,\ldots,\lambda_n) is the diagonal matrix of eigenvalues and Φ=[ϕ1,…,ϕn]\Phi= [\phi_1,\ldots,\phi_n] is the matrix of eigenvectors. For symmetric GSOs (undirected graphs), Φ\Phi is orthonormal, i.e. Φ−1=ΦT\Phi^{-1} = \Phi^T.

Each eigenvalue μ\mu defines an eigenspace EμE_\mu spanned by the eigenvectors with eigenvalue μ\mu. Let Iμ={i:λi=μ}I_\mu= \{i : \lambda_i = \mu\} denote the corresponding index set and let Φμ∈Rn×∣Iμ∣\Phi_\mu\in\mathbb{R}^{n \times|I_\mu|} be the matrix whose columns are these eigenvectors. The projector onto EμE_\mu is Pμ=ΦμΦμTP_\mu= \Phi_\mu\Phi_\mu^T. These projections allow the GSO to be expressed as a sum over eigenspaces: S=∑μμPμS = \sum_\mu\mu P_\mu, where the sum is over distinct eigenvalues.

Graph angles describe how nodes relate to these eigenspaces. For a node vv, let eve_v denote its indicator vector. The graph angle of vv with respect to EμE_\mu is

∠μ(v)=(Pμ)vv=∥Pμev∥2=∑i∈Iμ(ϕi(v))2.\angle_\mu(v) = (P_\mu)_{vv} = \lVert P_\mu e_v\rVert^2 = \sum_{i\in I_\mu}(\phi_i(v))^2.

The term graph angle comes from the geometric interpretation

(Pμ)vv=cos⁡2(θv,μ),θv,μ=∠(ev,Eμ).(P_\mu)_{vv} = \cos^2(\theta_{v,\mu}), \qquad\theta_{v,\mu} = \angle(e_v,E_\mu).

Unlike individual eigenvector coordinates, graph angles are invariant to sign changes and changes of basis inside eigenspaces. These invariances remove arbitrary choices from the representation and can therefore simplify learning [5].

Graph filters are operators of the form p(S)p(S), where p:R→Rp : \mathbb{R} \to\mathbb{R} is applied to the GSO SS. For symmetric GSOs, spectral filters can be written as

p(S)=Φp(Λ)ΦT=∑μp(μ)Pμ.p(S) = \Phi p(\Lambda)\Phi^T = \sum_\mu p(\mu)P_\mu.

A polynomial filter is the special case where p(μ)=∑k=0K−1akμkp(\mu) = \sum_{k=0}^{K-1} a_k\mu^k, equivalently

p(S)=∑k=0K−1akSk.p(S) = \sum_{k=0}^{K-1} a_kS^k.

The linear propagation part of Equation (1) naturally implements polynomial filters of the GSO.

Related Work

Expressivity of GNNs. Standard message passing architectures are limited in their expressiveness. In particular, they are at most as powerful as the Weisfeiler-Leman test [1] in distinguishing non-isomorphic graphs. This limitation surfaces in the inability of message-passing GNNs to count many basic substructures [6]. For example, standard GNNs cannot count triangles [2] or longer cycles, despite the practical relevance of this information in several applications, such as molecular property prediction [7]. From the perspective of this work, this limitation stems from the fact that message passing aggregates information arriving from neighboring nodes, but does not keep track of where that information originally comes from. Consequently, message passing cannot isolate self-interactions such as cycles.

There have been many works proposing more expressive GNN architectures [2, 6, 8, 9, 10]. Higher-order GNNs operate on tuples of nodes, making richer structural interactions available to the model [2]. However, this comes at a cost growing polynomially with the tuple order. Other approaches increase expressivity by explicitly augmenting node representations with structural information. Substructure-counting methods add counts of selected substructures [3, 6], but require selecting the relevant substructures in advance. Distance encodings instead assign each node an encoding of its distance to a target node set [11], conditioning the resulting representation on that set. In contrast to these approaches, our method exposes self-interaction information through randomized diagonal estimation. This allows a standard message passing backbone to access structural information without higher-order tuples, a preselected substructure vocabulary, or target-conditioned encodings.

Random Features in GNNs. Random node features have been studied as a way to overcome expressivity limitations in message passing [12, 13, 14]. These works show that random initialization can break node symmetries and increase expressive power, with universality results in some settings [15].

However, this relies on the model learning to use randomness as node identifiers, and the theoretical power does not directly provide stable, task-relevant structural quantities. Hence, more direct uses of random features have been proposed [16, 17, 18].

R-PEARL [17] introduces a randomized variant of a positional encoding framework. While effective for PEs, its expressivity guarantees are limited.2

Eliasof et al. [18] use message passing with random features to learn positional encodings. They show that, combined with appropriate normalization, random feature propagation simulates power iteration and subspace iteration. This allows approximating the leading eigenvectors of the graph shift operator. They also note that random features can be used to estimate cycle counts using Hutchinson’s trace estimator. However, the focus of their work is on positional encodings, and their analysis is based on what can be achieved in the limit as the propagation depth increases. In contrast, we focus on structural self-interactions and explicitly correlate propagated signals with the input randomness. This correlation is essential: it yields an unbiased estimator of diagonal entries in expectation and provides a stable structural signal that can be learned from finite random probes.

Spectral Graph Theory and GNNs. Spectral approaches to graph learning are rooted in spectral graph theory and graph signal processing [19]. Graph signal processing interprets node features as signals on the graph and defines filters as functions of a graph shift operator [20]. Classical spectral filters are typically fixed or analytically chosen.

Spectral GNNs learn such filters from data. Early spectral GNNs implemented filters directly in the Fourier basis, requiring an eigendecomposition [21]. ChebNet [22] introduced Chebyshev polynomial approximations. GCN can be viewed as a first-order approximation of this spectral filtering perspective [23]. These methods apply graph-derived operators to node features, but the resulting node representations do not explicitly expose the diagonal entries of those operators. Our method complements spectral GNNs by showing how randomized probing can make these diagonal entries accessible to message passing.

Main Tool: Diagonal Estimation via Message Passing

This section presents our main technical tool: a randomized technique to estimate the diagonal entries of a matrix via message passing. It is based on Hutchinson’s diagonal estimator [4], which is formalized in the next lemma:

Lemma 4.1. Let M∈Rn×nM \in\mathbb{R}^{n \times n}. Let z∈Rnz \in\mathbb{R}^{n} be a random vector with i.i.d. Rademacher entries (i.e., each entry is independently +1+1 or −1-1 with probability 1/21/2). Then

E[z⊙(Mz)]=diag⁡(M)\mathbb{E}[z \odot(Mz)] = \operatorname{diag}(M)

where ⊙\odot is the elementwise product. The variance of the iith entry is ∑j≠iMij2\sum_{j \ne i} M_{ij}^{2}.

Proof. The iith entry is E[zi(Mz)i]=E[∑jMijzizj]\mathbb{E}[z_i(Mz)_i] = \mathbb{E}[\sum_j M_{ij}z_i z_j]. Here, E[zizj]=0\mathbb{E}[z_i z_j] = 0 for i≠ji \ne j since E[zi]=0\mathbb{E}[z_i] = 0 and zi,zjz_i,z_j are independent, making all cross terms vanish. Thus, only the j=ij = i term remains, giving E[zi2]Mii=Mii\mathbb{E}[z_i^2]M_{ii} = M_{ii}.

The variance is computed from Var⁡(di)=E[di2]−(E[di])2\operatorname{Var}(d_i) = \mathbb{E}[d_i^2] - (\mathbb{E}[d_i])^2. Here,

di2=(∑jMijzizj)(∑jMijzizj)=∑j,kMijMikzi2zjzk=∑j,kMijMikzjzkd_i^2 = \left(\sum_j M_{ij}z_i z_j\right)\left(\sum_j M_{ij}z_i z_j\right) = \sum_{j,k} M_{ij}M_{ik}z_i^2 z_j z_k = \sum_{j,k} M_{ij}M_{ik}z_j z_k

because zi2=1z_i^2 = 1. Taking the expectation, E[di2]=E[∑j,kMijMikzjzk]=∑jMij2\mathbb{E}[d_i^2] = \mathbb{E}\left[\sum_{j,k} M_{ij}M_{ik}z_jz_k\right] = \sum_j M_{ij}^{2}, since E[zjzk]=0\mathbb{E}[z_jz_k] = 0 for j≠kj \ne k. Thus, Var⁡(di)=E[di2]−(E[di])2=∑jMij2−Mii2\operatorname{Var}(d_i) = \mathbb{E}[d_i^2] - (\mathbb{E}[d_i])^2 = \sum_j M_{ij}^{2} - M_{ii}^{2}

In the context of GNNs, the matrix MM can be the GSO or a matrix derived from it, such as powers or spectral filters. MzMz corresponds to a message passing operation on the graph with input features zz.

Warm-up: Cycle Counting via Diagonal Estimation

Consider a message passing model of the form

X(l)=σ(AX(l−1)W)(2)X^{(l)} = \sigma\left(A X^{(l-1)} W\right) \tag*{(2)}

Ignoring nonlinearities and weights, after kk layers, we have X(k)=AkX(0)X^{(k)} = A^k X^{(0)}. We illustrate how diagonal estimation can be used to compute cycle counts of the graph:

Lemma 4.2. With a GNN in Equation (2) and uniformly random initial features X(0)∈{−1,1}nX^{(0)} \in\{-1,1\}^n, each node vv can compute the number of closed walks of length kk starting and ending at vv in expectation.

Proof. Initialize node features as independent Rademacher random variables, z∈{−1,1}nz \in\{-1,1\}^n. By Lemma 4.1, E[z⊙(Akz)]=diag⁡(Ak)\mathbb{E}[z \odot(A^k z)] = \operatorname{diag}(A^k). It is well known that (Ak)vv(A^k)_{vv} counts the number of closed walks of length kk starting and ending at node vv (see Lemma B.1).

DIAL: Diagonal Access Layer

Building on Lemma 4.1, we propose the Diagonal Access Layer (DIAL), a stochastic message-passing module that gives nodes access to structural quantities through diagonal entries of graph-derived operators. DIAL is based on propagating random features, and correlating the propagated probes with the original random values. The technique is general and can be applied to directed and undirected graphs for any GNN architecture.

Random probes. For initial features, we sample a probe vector z∈{−1,1}nz \in\{-1,1\}^n with i.i.d. Rademacher entries.

Probe propagation. Let p(0)=zp^{(0)} = z. DIAL’s main hyperparameter is KK, the number of layers from which diagonal estimates are formed. For k=1,…,K−1k = 1,\ldots,K-1, DIAL propagates the probe features by

p(k)=TS(k)(p(k−1)),p^{(k)} = \mathcal{T}^{(k)}_S\left(p^{(k-1)}\right),

where TS(k)\mathcal{T}^{(k)}_S is a local propagation operator built from the GSO SS. For example, choosing TS(k)(p)=Sp\mathcal{T}^{(k)}_S(\mathbf{p}) = S\mathbf{p} gives p(k)=Skzp^{(k)} = S^k z. More generally, the stack of probe-propagation layers may implement powers of the GSO or polynomial filters, such as those arising from the linear propagation part of Equation (1). Thus each propagated probe state can be written as p(k)=Mkzp^{(k)} = M_k z for some graph-derived operator MkM_k.

Diagonal readout. For each state k=0,…,K−1k = 0,\ldots,K-1, DIAL forms a local correlation with the original probe,

d(k)=z⊙p(k),d^{(k)} = z \odot p^{(k)},

where ⊙\odot denotes the elementwise product. For every kk, Lemma 4.1 gives

E[z⊙p(k)]=diag⁡(Mk).\mathbb{E}\left[z \odot p^{(k)}\right] = \operatorname{diag}(M_k).

Thus the KK DIAL readouts expose structural signals corresponding to the diagonals of M0,…,MK−1M_0,\ldots,M_{K-1}. For instance, if Mk=AkM_k = A^k, these signals give closed-walk counts up to length K−1K-1.

Aggregation. In practice, we reduce variance by using rr independent probes z(1),…,z(r)z^{(1)},\ldots,z^{(r)}. Equivalently, stacking them as Z=[z(1),…,z(r)]∈Rn×rZ = [z^{(1)},\ldots,z^{(r)}] \in\mathbb{R}^{n \times r} introduces a sample dimension, and the same probe propagation is applied column-wise to produce estimates D(k)∈Rn×rD^{(k)} \in\mathbb{R}^{n \times r}. The state-wise estimates are then aggregated across propagation depths and independent probes using a shared readout:

hiDIAL=1r∑s=1rMLP⁡(∥k=0K−1Di,s(k))∈Rddial.h_i^{\mathrm{DIAL}} = \frac{1}{r}\sum_{s=1}^{r}\operatorname{MLP}\left(\left\|_{k=0}^{K-1}D_{i,s}^{(k)}\right.\right) \in\mathbb{R}^{d_{\mathrm{dial}}}.

Averaging over rr probes reduces the estimator variance at a rate of 1/r1/r, while the distribution of the probes makes the construction permutation equivariant in expectation.

The resulting DIAL layer can be stacked with a standard message-passing GNN by using hiDIALh_i^{\mathrm{DIAL}} directly as a structural node representation or concatenating it with ordinary node features,

Hi(0)=xi∥hiDIAL.H_i^{(0)} = x_i \mathbin\Vert h_i^{\mathrm{DIAL}}.

Structural Embeddings via Diagonal Estimation

Many classical node-level structural features, such as closed-walk counts and centrality measures, can be expressed as node-wise statistics derived from linear operators on the graph. In this section, we first show that DIAL gives nodes access to diagonal entries of graph filters. This can be used to recover several classical node quantities relevant for structural embeddings, including closed-walk counts, subgraph centrality, heat kernel signatures and graph angles. We also extend the diagonal estimation technique to off-diagonals for neighboring nodes, which is useful for counting simple cycles. Proofs for this section are in Appendix § 9.

Diagonals of Graph Filters

Recall that a polynomial filter of degree K−1K-1 can be expressed as

p(S)=∑k=0K−1akSkp(S)=\sum_{k=0}^{K-1}a_kS^k

where SS is a graph shift operator. With diagonalization, this can also be written as p(S)=Φp(Λ)ΦTp(S)=\Phi p(\Lambda)\Phi^{\mathsf{T}}, where p(Λ)=diag⁡(p(λ1),…,p(λn))p(\Lambda)=\operatorname{diag}(p(\lambda_1),\ldots,p(\lambda_n)). In particular, spectral filters act independently on each eigenspace of SS.

The linear propagation part of Equation (1) allows such filters to be applied in message passing effectively. However, many relevant structural properties, such as cycle counts, depend on self-interactions. Intuitively, this is encoded in the diagonal entries of p(S)p(S). The diagonal is not accessible via standard message passing, which aggregates information row-wise and cannot isolate self-interactions. The following theorem shows that diagonal entries can be accessed in expectation using DIAL:

Theorem 5.1. DIAL can compute node-wise statistics of the form

v↦(p(S))vvv \mapsto(p(S))_{vv}

in expectation, where pp is a polynomial filter of degree at most K−1K-1. Equivalently, DIAL can compute expressions of the form

v↦∑i=1ng(λi)(ϕi(v))2v \mapsto\sum_{i=1}^{n} g(\lambda_i)(\phi_i(v))^2

where λi\lambda_i and ϕi\phi_i are the eigenvalues and eigenvectors of the GSO, and gg is any polynomial function of degree at most K−1K-1. Moreover, multiple polynomial filters can be expressed in parallel by increasing the (output) feature dimension.

Structural Quantities

The diagonal-filter view gives a compact way to recover several standard structural embeddings. We first focus on the quantities that can be expressed as polynomials of the GSO.

Example: graph angles. Figure 2 illustrates the distinction between positional and structural spectral encodings. Graph angles, defined in the preliminaries, are a canonical example of diagonal spectral features. They describe how strongly a node participates in an eigenspace through ∠μ(v)=(Pμ)vv\angle_\mu(v) = (P_\mu)_{vv}. This differs from eigenvector positional encodings, which assign nodes coordinates in selected eigenvectors. While eigenvector coordinates are useful positional features, they depend on sign choices and, for repeated eigenvalues, on an arbitrary basis for the eigenspace. Graph angles instead summarize the whole eigenspace through the projector PμP_\mu, making them intrinsic structural features.

Theorem 5.2. DIAL can compute the following node-level structural quantities in expectation:

  • Closed-walk counts. For every 1≤k≤K−11 \le k \le K-1,

    v↦(Ak)vvv \mapsto(A^k)_{vv}

    gives the number of closed walks of length kk starting and ending at vv.

  • Graph angles. For a Laplacian eigenspace EμE_\mu with projector PμP_\mu,

    v↦∠μ(v)=(Pμ)vvv \mapsto\angle_\mu(v) = (P_\mu)_{vv}

    can be computed, provided the eigenspace projector PμP_\mu is represented by a polynomial in LL of degree at most K−1K-1. In particular, this holds if LL has at most KK distinct eigenvalues.

Spectral quantities defined by exponential graph filters can be approximated with polynomials of the GSO:

Theorem 5.3. DIAL can approximate the following node-level structural quantities in expectation:

  • Subgraph centrality. For SC(v)=(eA)vv\mathrm{SC}(v) = (e^A)_{vv}, if AA is symmetric and ∥A∥2≤α\lVert A\rVert_2 \le\alpha, the degree-(K−1)(K-1) Taylor approximation yields an estimate SC^K(v)\widehat{\mathrm{SC}}_K(v) satisfying

    ∣E[SC^K(v)]−SC(v)∣≤eααKK!.\left|\mathbb{E}[\widehat{\mathrm{SC}}_K(v)]-\mathrm{SC}(v)\right| \le\frac{e^\alpha\alpha^K}{K!}.
  • Heat kernel signature. For HKSt(v)=(e−tL)vv\mathrm{HKS}_t(v) = (e^{-tL})_{vv}, if LL is symmetric and ∥L∥2≤β\lVert L\rVert_2 \le\beta, the degree-(K−1)(K-1) Taylor approximation yields an estimate HKS^t,K(v)\widehat{\mathrm{HKS}}_{t,K}(v) satisfying

    ∣E[HKS^t,K(v)]−HKSt(v)∣≤(tβ)KK!.\left|\mathbb{E}[\widehat{\mathrm{HKS}}_{t,K}(v)]-\mathrm{HKS}_t(v)\right| \le\frac{(t\beta)^K}{K!}.

Estimator variances for both the exact and approximate quantities above are derived in Appendix § 9.§ 1.

Neighbor Off-Diagonal Readout

Some structural quantities require off-diagonal entries of graph-derived operators. For example, the number of common neighbors of adjacent nodes uu and vv is (A2)uv(A^2)_{uv}, which is useful for link prediction, and also appears in formulas for counting simple cycles. The same random probing idea can estimate such entries: nodes first share their original probe values with their neighbors, and after ℓ\ell layers of message propagation, each endpoint correlates the last layer state with the original probe values of their neighbors.

Theorem 5.4. For each node vv, DIAL can compute the multiset of off-diagonal elements of p(S)p(S) over neighbors w∈N(v)w \in N(v):

{{(p(S))vw:w∈N(v)}}\{\{(p(S))_{vw} : w \in N(v)\}\}

in expectation, where pp is a polynomial filter of degree at most K−1K - 1.

The proof is in Appendix § 9.

Combined with closed-walk counts from Theorem 5.2, the off-diagonal estimation from Theorem 5.4 can be used to express counts of simple cycles:

Theorem 5.5. A DIAL-augmented message-passing model can compute the number of simple cycles of lengths 3, 4 and 5 at each node.

The proof of Theorem 5.5 is given in Section B.

Experiments

We present empirical results in three main settings: molecular property prediction on ZINC [24, 25], synthetic node-level cycle counting [26], and directed structural pattern detection on synthetic multigraphs [27]. These experiments test the usefulness of DIAL as a lightweight structural encoding, and its ability to recover explicitly structural information in controlled settings.

Our comparisons include standard message-passing GNNs, hand-crafted cycle features, spectral positional encodings, PEARL and other random-probe baselines, as well as subgraph and higher-order architectures for cycle counting. Random Feature Propagation (RFP) [18] is a closely related baseline, but we omit it from the experiments because no public implementation was available.3

Setup

We use the PEARL codebase [17] as the starting point, modifying the positional-encoding module for DIAL. In the DIAL variants reported here, Hutchinson correlations are applied at two levels inside the structural encoding module: first after explicit graph-shift propagation of the random probes, and then again after a number of learned GIN layers. The outputs of each layer are concatenated and projected to the final node encoding. Full experimental details can be found in Appendix § 13.

Results

Table 1 reports a PE-focused comparison on ZINC, with logP prediction evaluated by test MAE. The non-DIAL entries follow the baseline set reported by Kanatsoulis et al. [17]. Hence, the table should be read as a comparison to positional-encoding methods rather than as a comprehensive ZINC leaderboard. DIAL performs comparably to strong spectral and random-probe positional encoding methods.

Table 1: Test MAE for logP prediction on ZINC; lower is better. For SignNet, BasisNet, and SPE, “8 smallest” uses the eigenvectors corresponding to the eight smallest eigenvalues of the normalized Laplacian, whereas “full” uses the complete eigenbasis. Best within each block is bolded.

MethodTest MAE
GCN [23]0.469 ± 0.002
GIN [1]0.209 ± 0.018
GSN with cycles [3]0.115 ± 0.012
GIN + random ID [1]0.279 ± 0.023
SignNet (8 smallest) [5]0.1034 ± 0.0056
SignNet (full) [5]0.0853 ± 0.0026
BasisNet (8 smallest) [5]0.1554 ± 0.0048
BasisNet (full) [5]0.1555 ± 0.0124
SPE (8 smallest) [28]0.0736 ± 0.0007
SPE (full) [28]0.0693 ± 0.0040
R-PEARL [17]0.0699 ± 0.002
B-PEARL [17]0.0644 ± 0.001
DIAL (K=1K = 1)0.0703 ± 0.0012
DIAL (K=4K = 4)0.0658 ± 0.0020
DIAL (K=8K = 8)0.0733 ± 0.0026
DIAL (K=12K = 12)0.0752 ± 0.0074

Table 1.

Table 2 compares DIAL with several baselines on node-level cycle counting. Methods designed specifically to expose cycle information, such as subgraph and higher-order architectures, achieve the lowest errors, but require substantially higher space or time complexity. Among random-probe methods, DIAL improves over R-PEARL across all cycle lengths while retaining linear scaling in NN, d~\tilde{d}, and rr.

Table 2: Normalized MAE for node-level cycle counting. Complexities assume fixed hidden width; NN is the number of nodes, dˉ\bar{d} the average degree, ss the maximum extracted subgraph size, rr the number of probes, LL the number of learned layers or blocks, and KK the propagation depth. Inference space excludes graph storage. The lower block contains the random-probe methods; best results are bolded separately in the final two blocks. R-PEARL and DIAL are reported as mean ± standard deviation.

MethodComplexitySynthetic (norm. MAE)
SpaceTime3-Cycle4-Cycle5-Cycle6-Cycle
Base GNNO(N)O(N)O(LNdˉ)O(LN\bar{d})0.35150.27420.20880.1555
ID-GNN [29]O(Ns)O(Ns)O(LNsdˉ)O(LNs\bar{d})0.00060.00220.04900.0495
NGNN [30]O(Ns)O(Ns)O(LNsdˉ)O(LNs\bar{d})0.00030.00130.04020.0439
GNN-AK+ [31]O(Ns)O(Ns)O(LNsdˉ)O(LNs\bar{d})0.00040.00410.01330.0238
PPGN [8]O(N2)O(N^2)O(LN3)O(LN^3)0.00030.00090.00360.0071
I²-GNN [26]O(Nsdˉ)O(Ns\bar{d})O(LNsdˉ2)O(LNs\bar{d}^2)0.00030.00160.00280.0082
2-DRFWL(2) [32]O(Ndˉ2)O(N\bar{d}^2)O(LNdˉ4)O(LN\bar{d}^4)0.00040.00150.00340.0087
R-PEARL [17]O(rN)O(rN)O((K+L)rNdˉ)O((K + L)rN\bar{d}).0118±.0037.0360±.0054.0561±.0035.0622±.0025
DIAL (Ours)O(KrN)O(KrN)O((K+L)rNdˉ)O((K + L)rN\bar{d}).0041±.0001.0185±.0027.0271±.0005.0348±.0030

Table 2.

We further evaluate DIAL on a directed synthetic pattern-detection task introduced by Egressy et al. [27]. See Table 3 for the results. The task is node-level multi-label classification: nodes are labeled by whether they participate in directed cycles of length 2–6, scatter-gather motifs (S-G), or bicliques (B-C), following Altman et al. [33]. DIAL outperforms R-PEARL on every directed pattern. The improvement is especially large for short directed cycles. Overall, DIAL raises macro F1 from 52.24 to 77.84. This suggests that correlating propagated representations with the original probes provides a substantially stronger signal for directed structural patterns.

Table 3: Pattern detection on synthetic directed graphs. We report minority-class F1 scores in percent for node-level binary labels; higher is better. The detected patterns include directed cycles of length 2–6, scatter-gather motifs (S-G), and bicliques (B-C). Both methods use K=4K = 4 and six learned probe-aggregation layers. Best in each column is bolded.

Method2-Cycle3-Cycle4-Cycle5-Cycle6-CycleS-GB-CMacro F1
R-PEARL [17]15.48 ± 7.5941.21 ± 5.4266.05 ± 0.5255.13 ± 0.8054.74 ± 0.6070.54 ± 1.0962.56 ± 2.4952.24
DIAL (Ours)91.07 ± 3.3382.44 ± 4.4879.72 ± 1.5072.10 ± 2.2174.83 ± 2.9578.68 ± 2.7966.07 ± 1.4877.84

Table 3.

Conclusions

We introduce DIAL, a message-passing layer that uses randomized probing to give nodes access to structural self-interactions expressed as the diagonals of graph-derived operators. We showed that DIAL can express or approximate closed-walk and short-cycle counts, graph angles, subgraph centrality, and heat kernel signatures. In our experiments, DIAL is competitive with strong positional-encoding methods on ZINC. It also outperforms comparable random-probe methods on undirected cycle counting and directed pattern detection. Overall, DIAL provides a simple way to improve structural expressivity without using higher-order architectures or a fixed set of motifs.

Acknowledgements

The support of the Swiss National Science Foundation (project number: 212158) for this work is gratefully acknowledged.

Proofs for Section 5

Theorem 5.1. DIAL can compute node-wise statistics of the form

v↦(p(S))vvv \mapsto(p(S))_{vv}

in expectation, where pp is a polynomial filter of degree at most K−1K-1. Equivalently, DIAL can compute expressions of the form

v↦∑i=1ng(λi)(ϕi(v))2v \mapsto\sum_{i=1}^{n} g(\lambda_i)(\phi_i(v))^2

where λi\lambda_i and ϕi\phi_i are the eigenvalues and eigenvectors of the GSO, and gg is any polynomial function of degree at most K−1K-1. Moreover, multiple polynomial filters can be expressed in parallel by increasing the (output) feature dimension.

Proof. Let p(S)=∑k=0K−1akSkp(S)=\sum_{k=0}^{K-1}a_kS^k be the target polynomial filter. Since the linear propagation part of Equation (1) represents polynomial graph filters of degree K−1K-1, the DIAL probe-propagation weights can learn the coefficients of pp. Thus, for a Rademacher probe zz, the learned probe propagation can produce

p=p(S)z.\mathbf{p}=p(S)\mathbf{z}.

The DIAL readout then forms the node-wise correlation

z⊙p=z⊙p(S)z.\mathbf{z}\odot\mathbf{p}=\mathbf{z}\odot p(S)\mathbf{z}.

Applying Lemma 4.1 with M=p(S)M=p(S) gives

E[z⊙p(S)z]=diag⁡(p(S)).\mathbb{E}[\mathbf{z}\odot p(S)\mathbf{z}]=\operatorname{diag}(p(S)).

Hence node vv obtains (p(S))vv(p(S))_{vv} in expectation. For the equivalent spectral expression, write S=ΦΛΦTS = \Phi\Lambda\Phi^{T}. Then p(S)=Φp(Λ)ΦTp(S) = \Phi p(\Lambda)\Phi^{T}, and therefore

(p(S))vv=∑i=1np(λi)(ϕi(v))2.(p(S))_{vv} = \sum_{i=1}^{n} p(\lambda_i)(\phi_i(v))^2.

Since pp is an arbitrary polynomial of degree at most K−1K - 1, this gives the stated expression for any polynomial response gg of that degree. Multiple polynomial filters can be handled in parallel by using separate output channels for p1,…,pdp_1,\ldots,p_d and applying the same argument channel-wise.

Theorem 5.4. For each node vv, DIAL can compute the multiset of off-diagonal elements of p(S)p(S) over neighbors w∈N(v)w \in N(v):

{{(p(S))vw:w∈N(v)}}\{\{(p(S))_{vw}: w \in N(v)\}\}

in expectation, where pp is a polynomial filter of degree at most K−1K - 1.

Proof. Let M=p(S)M = p(S). Since the linear propagation part of Equation (1) represents polynomial graph filters of degree K−1K - 1, the DIAL probe-propagation weights can learn the coefficients of pp. Thus, after the corresponding probe-propagation layer, the probe feature is

p(ℓ)=Mz.\mathbf{p}^{(\ell)} = M\mathbf{z}.

For the readout, each node keeps its original probe value z\mathbf{z} alongside the propagated state p(ℓ)=Mz\mathbf{p}^{(\ell)} = M\mathbf{z}. A subsequent GIN layer allows node vv to receive the multiset of probe values zwz_w of its neighbors while retaining pv(ℓ)p_v^{(\ell)}. Node vv can therefore form zwpv(ℓ)z_w p_v^{(\ell)} for every w∈N(v)w \in N(v), and permutation-invariant aggregation encodes the resulting unordered collection

Rv(ℓ)={{zwpv(ℓ):w∈N(v)}}.R_v^{(\ell)} = \{\{z_w p_v^{(\ell)}: w \in N(v)\}\}.

To analyze this, temporarily retain the identity of the sending neighbor and write rvw(ℓ)=zwpv(ℓ)r_{vw}^{(\ell)} = z_w p_v^{(\ell)}. Since

pv(ℓ)=∑jMvjzj,p_v^{(\ell)} = \sum_j M_{vj}z_j,

we have

E[rvw(ℓ)]=E[∑jMvjzwzj]=∑jMvjE[zwzj]=Mvw,\mathbb{E}[r_{vw}^{(\ell)}] = \mathbb{E}\left[\sum_j M_{vj}z_wz_j\right] = \sum_j M_{vj}\mathbb{E}[z_wz_j] = M_{vw},

because E[zwzj]=0\mathbb{E}[z_wz_j] = 0 for j≠wj \ne w and E[zw2]=1\mathbb{E}[z_w^2] = 1. Therefore Rv(ℓ)R_v^{(\ell)} estimates the multiset {{Mvw:w∈N(v)}}\{\{M_{vw}: w \in N(v)\}\} in expectation. Substituting M=p(S)M = p(S) gives the claim.

Estimator Variance and Concentration

Lemma 4.1 establishes unbiasedness for diagonal entries, and Theorem 5.4 extends this to neighbor off-diagonal entries. Here, we compute the variance of these estimators in terms of the number of probes.

Lemma A.1. Let M∈Rn×nM \in\mathbb{R}^{n \times n} be fixed, and let z(1),…,z(r)\mathbf{z}^{(1)},\ldots,\mathbf{z}^{(r)} be independent Rademacher probes. For fixed nodes v,wv,w, define

M^vw=1r∑s=1rzw(s)(Mz(s))v.\widehat{M}_{vw} = \frac{1}{r}\sum_{s=1}^{r} z_w^{(s)}(M\mathbf{z}^{(s)})_v.

The variance of this estimator is

Var⁡(M^vw)=1r∑j≠wMvj2=∥Mv,:∥22−Mvw2r.(3)\operatorname{Var}(\widehat{M}_{vw}) = \frac{1}{r}\sum_{j\ne w}M_{vj}^{2} = \frac{\lVert M_{v,:}\rVert_{2}^{2}-M_{vw}^{2}}{r}. \tag*{(3)}

If MM is symmetric, the diagonal case simplifies to

Var⁡(M^vv)=(M2)vv−Mvv2r.\operatorname{Var}(\widehat{M}_{vv}) = \frac{(M^{2})_{vv}-M_{vv}^{2}}{r}.

Proof. For one probe, write Xvw=zw(Mz)vX_{vw}=z_w(Mz)_v and separate the desired entry from the remaining terms:

Xvw=zw∑jMvjzj=Mvwzw2+∑j≠wMvjzwzj=Mvw+∑j≠wMvjzwzj.\begin{aligned} X_{vw}=z_w\sum_j M_{vj}z_j \\ &= M_{vw}z_w^2+\sum_{j\ne w}M_{vj}z_wz_j \\ &= M_{vw}+\sum_{j\ne w}M_{vj}z_wz_j. \end{aligned}

Thus, the desired entry MvwM_{vw} is recovered as a deterministic term and does not contribute to the variance. Every other entry in row vv contributes a zero-mean random term. Expanding the square of these remaining terms gives

Var⁡(Xvw)=E[(∑j≠wMvjzwzj)(∑k≠wMvkzwzk)]=∑j,k≠wMvjMvkE[zjzk]=∑j≠wMvj2,\begin{aligned} \operatorname{Var}(X_{vw})=\mathbb{E}\left[\left(\sum_{j\ne w}M_{vj}z_wz_j\right)\left(\sum_{k\ne w}M_{vk}z_wz_k\right)\right] \\ &=\sum_{j,k\ne w}M_{vj}M_{vk}\mathbb{E}[z_jz_k]=\sum_{j\ne w}M_{vj}^2, \end{aligned}

since the cross terms vanish. Finally, independence across probes gives

Var⁡(M^vw)=1r2∑s=1rVar⁡(Xvw(s))=1r∑j≠wMvj2.\operatorname{Var}(\widehat{M}_{vw})=\frac{1}{r^2}\sum_{s=1}^{r}\operatorname{Var}(X_{vw}^{(s)})=\frac{1}{r}\sum_{j\ne w}M_{vj}^2.

The row-norm expression follows directly. If MM is symmetric, then ∥Mv,:∥22=(M2)vv\|M_{v,:}\|_2^2=(M^2)_{vv}.

Corollary A.2. For rr independent probes, the random-probe estimators satisfy the following:

  • Closed walks and triangles. On an undirected graph,

Var⁡((Ak)^vv)=(A2k)vv−(Ak)vv2r.\operatorname{Var}\left(\widehat{(A^k)}_{vv}\right)=\frac{(A^{2k})_{vv}-(A^k)_{vv}^2}{r}.

In particular, for a simple graph without self-loops, C3(v)=(A3)vv/2C_3(v)=(A^3)_{vv}/2, so

Var⁡(C3(v)^)=(A6)vv−(A3)vv24r.\operatorname{Var}\left(\widehat{C_3(v)}\right)=\frac{(A^6)_{vv}-(A^3)_{vv}^2}{4r}.
  • Graph angles. Let PμP_\mu be the orthogonal projector onto the eigenspace associated with μ\mu, and assume it is represented by a polynomial filter available to DIAL, as in Theorem 5.2. Then

Var⁡((Pμ)^vv)=∠μ(v)(1−∠μ(v))r≤14r.\operatorname{Var}\left(\widehat{(P_\mu)}_{vv}\right)=\frac{\angle_\mu(v)(1-\angle_\mu(v))}{r}\le\frac{1}{4r}.
  • Subgraph centrality and heat kernel signature. Define the polynomial filters

pK−1(A)=∑ℓ=0K−1Aℓℓ!,ht,K−1(L)=∑ℓ=0K−1(−tL)ℓℓ!.p_{K-1}(A)=\sum_{\ell=0}^{K-1}\frac{A^\ell}{\ell!},\qquad h_{t,K-1}(L)=\sum_{\ell=0}^{K-1}\frac{(-tL)^\ell}{\ell!}.

Their estimator variances are

Var⁡(SCK(v)^)=(pK−1(A2))vv−(pK−1(A)vv)2r,\operatorname{Var}\left(\widehat{\mathrm{SC}_K(v)}\right)=\frac{\left(p_{K-1}(A^2)\right)_{vv}-\left(p_{K-1}(A)_{vv}\right)^2}{r},
Var⁡(HKSt,K(v)^)=(ht,K−1(L2))vv−(ht,K−1(L)vv)2r.\operatorname{Var}\left(\widehat{\mathrm{HKS}_{t,K}(v)}\right)=\frac{\left(h_{t,K-1}(L^2)\right)_{vv}-\left(h_{t,K-1}(L)_{vv}\right)^2}{r}.

Proof. For closed walks, set M=AkM=A^k in Lemma A.1 and use (Ak)2=A2k(A^k)^2=A^{2k}. Scaling the resulting estimate by 1/21/2 gives the triangle-count variance. For graph angles, set M=PμM=P_\mu and use Pμ2=PμP_\mu^2=P_\mu. Finally, substituting M=pK−1(A)M=p_{K-1}(A) and M=ht,K−1(L)M=h_{t,K-1}(L) gives the subgraph-centrality and heat-kernel formulas.

Combining estimates. Lemma A.1 also gives the variance of each randomized matrix-entry estimate used in the longer-cycle constructions. When several estimates formed from the same probes are combined (as in Theorem 5.5), the variance of the final quantity additionally depends on their covariance.

Concentration. Let σvw2=∑j≠wMvj2\sigma_{vw}^{2} = \sum_{j\ne w} M_{vj}^{2}. The products {zwzj:j≠w}\{z_w z_j : j \ne w\} are jointly independent Rademacher variables, so for every ϵ>0\epsilon> 0,

P(∣M^vw−Mvw∣≥ϵ)≤2exp⁡(−rϵ22σvw2).\mathbb{P}\left(\left|\widehat{M}_{vw}-M_{vw}\right|\ge\epsilon\right)\le2\exp\left(-\frac{r\epsilon^{2}}{2\sigma_{vw}^{2}}\right).

Structural Quantities

The next proofs use a Lagrange polynomial, which is a construction for polynomials of minimal degree interpolating a given set of points:

Lemma A.3 (Lagrange interpolation polynomials). Given a set of k+1k+1 points {(x1,y1),…,(xk+1,yk+1)}\{(x_1,y_1),\ldots,(x_{k+1},y_{k+1})\}, where xi≠xjx_i\ne x_j, there is a polynomial L(x)L(x) of degree ≤k\le k such that L(xi)=yiL(x_i)=y_i for all 1≤i≤k+11\le i\le k+1.

Proof. For each ii, construct a polynomial ℓi(x)\ell_i(x) such that ℓi(xi)=1\ell_i(x_i)=1 and ℓi(xj)=0\ell_i(x_j)=0 for all j≠ij\ne i. Such a polynomial is given by

ℓi(x)=∏j≠i1≤j≤k+1x−xjxi−xj.\ell_i(x)=\prod_{\substack{j\ne i\\1\le j\le k+1}}\frac{x-x_j}{x_i-x_j}.

since all factors are equal to one for x=xix=x_i, and for x=xjx=x_j, j≠ij\ne i, (x−xj)/(xi−xj)=0(x-x_j)/(x_i-x_j)=0. Note that the degree of ℓi(x)\ell_i(x) is kk. The polynomial L(x)L(x) is given by ∑i=1k+1yiℓi(x)\sum_{i=1}^{k+1}y_i\ell_i(x).

Theorem 5.2. DIAL can compute the following node-level structural quantities in expectation:

  • Closed-walk counts. For every 1≤k≤K−11\le k\le K-1,

v↦(Ak)vv,v\mapsto(A^{k})_{vv},

gives the number of closed walks of length kk starting and ending at vv.

  • Graph angles. For a Laplacian eigenspace EμE_\mu with projector PμP_\mu,

v↦∠μ(v)=(Pμ)vv,v\mapsto\angle_\mu(v)=(P_\mu)_{vv},

can be computed, provided the eigenspace projector PμP_\mu is represented by a polynomial in LL of degree at most K−1K-1. In particular, this holds if LL has at most KK distinct eigenvalues.

Proof. Closed walks: With the adjacency matrix AA as the GSO, (Ak)vv(A^k)_{vv} gives the number of closed walks of length kk starting and ending at $v (Lemma B.1). This is the diagonal of the polynomial filter p(A)=Akp(A)=A^k, which has degree kk. Theorem 5.1 gives access to (Ak)vv(A^k)_{vv} in expectation.

Graph angles: Use the Laplacian LL as the GSO, and let η1,…,ηm\eta_1,\ldots,\eta_m be the distinct eigenvalues of LL. Fix an eigenvalue μ∈{η1,…,ηm}\mu\in\{\eta_1,\ldots,\eta_m\}. Let Pμ=ΦμΦμTP_\mu=\Phi_\mu\Phi_\mu^{T} be the projector onto the eigenspace EμE_\mu, so that the graph angle is ∠μ(v)=(Pμ)vv\angle_\mu(v)=(P_\mu)_{vv}. By Lemma A.3, there is a polynomial pμp_\mu of degree at most m−1m-1 such that

pμ(η)={1η=μ0η∈{η1,…,ηm}∖{μ}.p_\mu(\eta)= \begin{cases} 1 & \eta=\mu\\ 0 & \eta\in\{\eta_1,\ldots,\eta_m\}\setminus\{\mu\}. \end{cases}

With this choice of polynomial,

pμ(L)=Φpμ(Λ)ΦT=∑i∈IμϕiϕiT=Pμ.p_\mu(L)=\Phi p_\mu(\Lambda)\Phi^{T}=\sum_{i\in I_\mu}\phi_i\phi_i^{T}=P_\mu.

If the Laplacian has at most KK distinct eigenvalues, then deg⁡(pμ)≤m−1≤K−1\deg(p_\mu)\le m-1\le K-1. Theorem 5.1 then gives access to diag⁡(Pμ)\operatorname{diag}(P_\mu) in expectation, which is exactly the vector of graph angles for $E_\mu.

Note that for graph angles, this theorem is an exact-recovery result. Since an nn-node graph may have up to nn distinct Laplacian eigenvalues, the interpolation construction may require a large KK.

Subgraph centrality and heat kernel signature. For completeness, the subgraph centrality of node vv is

SC⁡(v)=(eA)vv=∑k=0∞(Ak)vvk!.\operatorname{SC}(v) = (e^{A})_{vv} = \sum_{k=0}^{\infty} \frac{(A^k)_{vv}}{k!}.

and thus measures participation in closed walks of all lengths, with longer walks receiving smaller weights. Similarly, if L=ΦΛΦTL = \Phi\Lambda\Phi^{\mathsf{T}}, the heat kernel signature is

HKS⁡t(v)=(e−tL)vv=∑k=0∞(−t)kk!(Lk)vv=∑ie−tλi(ϕi(v))2.\operatorname{HKS}_{t}(v) = (e^{-tL})_{vv} = \sum_{k=0}^{\infty} \frac{(-t)^k}{k!}(L^k)_{vv} = \sum_i e^{-t\lambda_i}(\phi_i(v))^2.

It gives the heat at vv at time tt when one unit of heat is initially placed at vv.

Theorem 5.3. DIAL can approximate the following node-level structural quantities in expectation:

  • Subgraph centrality. For SC⁡(v)=(eA)vv\operatorname{SC}(v) = (e^{A})_{vv}, if AA is symmetric and ∥A∥2≤α\lVert A\rVert_2 \le\alpha, the degree-(K−1)(K-1) Taylor approximation yields an estimate SC⁡^K(v)\widehat{\operatorname{SC}}_K(v) satisfying

∣E[SC⁡^K(v)]−SC⁡(v)∣≤eααKK!.\left|\mathbb{E}[\widehat{\operatorname{SC}}_K(v)]-\operatorname{SC}(v)\right| \le\frac{e^{\alpha}\alpha^K}{K!}.
  • Heat kernel signature. For HKS⁡t(v)=(e−tL)vv\operatorname{HKS}_t(v) = (e^{-tL})_{vv}, if LL is symmetric and ∥L∥2≤β\lVert L\rVert_2 \le\beta, the degree-(K−1)(K-1) Taylor approximation yields an estimate HKS⁡^t,K(v)\widehat{\operatorname{HKS}}_{t,K}(v) satisfying

∣E[HKS⁡^t,K(v)]−HKS⁡t(v)∣≤(tβ)KK!.\left|\mathbb{E}[\widehat{\operatorname{HKS}}_{t,K}(v)]-\operatorname{HKS}_t(v)\right| \le\frac{(t\beta)^K}{K!}.

Proof. For subgraph centrality, use the degree-(K−1)(K-1) Taylor polynomial

pK−1(x)=∑r=0K−1xrr!.p_{K-1}(x) = \sum_{r=0}^{K-1}\frac{x^r}{r!}.

By Theorem 5.1, DIAL can compute an estimate SC⁡^K(v)\widehat{\operatorname{SC}}_K(v) such that

E[SC⁡^K(v)]=(pK−1(A))vv.\mathbb{E}[\widehat{\operatorname{SC}}_K(v)] = (p_{K-1}(A))_{vv}.

Since AA is symmetric, write A=ΦΛΦTA = \Phi\Lambda\Phi^{\mathsf{T}}. Then

∥eA−pK−1(A)∥2=max⁡i∣eλi−pK−1(λi)∣.\lVert e^A-p_{K-1}(A)\rVert_2 = \max_i\left|e^{\lambda_i}-p_{K-1}(\lambda_i)\right|.

Taylor’s theorem gives

∣eλ−pK−1(λ)∣≤eααKK!for all ∣λ∣≤α.\left|e^\lambda-p_{K-1}(\lambda)\right| \le\frac{e^\alpha\alpha^K}{K!} \qquad\text{for all }|\lambda|\le\alpha.

Therefore

∣E[SC⁡^K(v)]−SC⁡(v)∣=∣(pK−1(A)−eA)vv∣≤∥pK−1(A)−eA∥2≤eααKK!.\left|\mathbb{E}[\widehat{\operatorname{SC}}_K(v)]-\operatorname{SC}(v)\right| = \left|(p_{K-1}(A)-e^A)_{vv}\right| \le\lVert p_{K-1}(A)-e^A\rVert_2 \le\frac{e^\alpha\alpha^K}{K!}.

For the heat kernel signature at time tt, use

ht,K−1(x)=∑r=0K−1(−tx)rr!.h_{t,K-1}(x) = \sum_{r=0}^{K-1}\frac{(-tx)^r}{r!}.

Theorem 5.1 gives an estimate HKS⁡^t,K(v)\widehat{\operatorname{HKS}}_{t,K}(v) satisfying

E[HKS⁡^t,K(v)]=(ht,K−1(L))vv.\mathbb{E}[\widehat{\operatorname{HKS}}_{t,K}(v)] = (h_{t,K-1}(L))_{vv}.

Since LL is symmetric positive semidefinite, its eigenvalues satisfy 0≤λi≤β0\le\lambda_i\le\beta. Taylor’s theorem applied to exe^x on x∈[−tβ,0]x\in[-t\beta,0] gives

∣e−tλ−ht,K−1(λ)∣≤(tβ)KK!for all 0≤λ≤β.\left|e^{-t\lambda}-h_{t,K-1}(\lambda)\right| \le\frac{(t\beta)^K}{K!} \qquad\text{for all }0\le\lambda\le\beta.

As above,

∣E[HKS⁡^t,K(v)]−HKS⁡t(v)∣≤∥ht,K−1(L)−e−tL∥2≤(tβ)KK!.\left|\mathbb{E}[\widehat{\operatorname{HKS}}_{t,K}(v)]-\operatorname{HKS}_t(v)\right| \le\lVert h_{t,K-1}(L)-e^{-tL}\rVert_2 \le\frac{(t\beta)^K}{K!}.

Simulating BasisNet

BasisNet [5] computes functions of the projection matrices Pμi=ΦμiΦμiTP_{\mu_i} = \Phi_{\mu_i}\Phi_{\mu_i}^{T}. Permutation equivariance requires that any such function φ\varphi satisfy

φ(ΠΦΦTΠT)=Πφ(ΦΦT)\varphi(\Pi\Phi\Phi^{T}\Pi^{T}) = \Pi\varphi(\Phi\Phi^{T})

for any permutation matrix Π\Pi, since a permutation of the nodes permutes both the rows and columns of the projection matrix. The class of functions with this property is characterized in [34], and BasisNet instantiates φ\varphi using the Invariant Graph Network (IGN) [35].

IGNs are a family of GNNs that operate on tensors of order kk representing kk-tuples of nodes. Maron et al. [35] characterize all linear equivariant layers between such tensors. In the setting of BasisNet, only a mixed-order equivariant layer is needed, mapping a matrix X∈Rn×nX \in\mathbb{R}^{n \times n} to node features Y∈Rn×dY \in\mathbb{R}^{n \times d}. The following operations can be shown to span the space of all linear layers of this type.

  • The diagonal operation: Yi=XiiY_i = X_{ii}

  • Row-wise sum: Yi=∑j=1nXijY_i = \sum_{j=1}^{n} X_{ij}

  • Column-wise sum: Yi=∑j=1nXjiY_i = \sum_{j=1}^{n} X_{ji}

  • Sum of all entries: Yi=∑j=1n∑k=1nXjkY_i = \sum_{j=1}^{n}\sum_{k=1}^{n} X_{jk}

  • Sum of diagonal entries: Yi=∑j=1nXjjY_i = \sum_{j=1}^{n} X_{jj}

Lemma A.4. DIAL with a virtual node can simulate BasisNet.

Proof. From Theorem 5.1, DIAL can compute diag⁡(Pμi)\operatorname{diag}(P_{\mu_i}) for each eigenspace. This gives the diagonal operation. For a symmetric graph shift operator, the row-wise and column-wise sums can be computed with z=1z = 1 as the initial features. The sum of all entries and sum of diagonal entries can be computed with the help of a virtual node, by summing over the node features obtained from the previous operations.

The diagonal estimate is key to obtaining the diagonal operation, which is not possible with standard message passing GNNs. The diagonal operation is the most important one, as it is the only one not constant across nodes:

Lemma A.5. Let LL be the Laplacian matrix and Pλ=ΦλΦλTP_{\lambda} = \Phi_{\lambda}\Phi_{\lambda}^{T} be the projection matrix to the eigenspace of eigenvalue λ\lambda. Then, the diagonal operation is the only non-constant operation among the five operations above when applied to PλP_{\lambda}.

Proof. The vector 11 is an eigenvector with eigenvalue 00, since L1=0L1 = 0. The row-wise sums are zero for λ≠0\lambda\ne0: Pλ1=0P_{\lambda}1 = 0 since 11 is orthogonal to these eigenspaces for any λ≠0\lambda\ne0. The same holds for the column sums by symmetry. For the case λ=0\lambda= 0, P01=1P_0 1 = 1 since 11 is an eigenvector. Thus, the row-wise and column-wise sums are constant across nodes in all cases.

The diagonal sum and total sum are constant across nodes by definition. Note that the diagonal sum ∑i(Pλ)ii\sum_i (P_{\lambda})_{ii} is equal to the multiplicity of λ\lambda, since trace⁡(Pλ)=trace⁡(PλT)=trace⁡(ΦλTΦλ)=rank⁡(Φλ)\operatorname{trace}(P_{\lambda}) = \operatorname{trace}(P_{\lambda}^{T}) = \operatorname{trace}(\Phi_{\lambda}^{T}\Phi_{\lambda}) = \operatorname{rank}(\Phi_{\lambda}).

Cycle Counting Proofs

The following lemma is a basic result in graph theory, which we include for completeness.

Lemma B.1. Let AA be the adjacency matrix. (Ak)vw(A^k)_{vw} gives the number of walks of length exactly kk from vv to ww.

Proof. By induction on kk. The base case k=1k = 1 is true by definition of the adjacency matrix. Assume the claim holds for kk. The number of walks of length k+1k + 1 from vv to ww can be partitioned according to the node uu visited at step kk, where uu must be a neighbor of ww. This is given by AkAA^k A:

(Ak+1)vw=∑u(Ak)vuAuw(A^{k+1})_{vw} = \sum_u (A^k)_{vu} A_{uw}

This completes the induction.

Let Ck(v)C_k(v) denote the number of distinct simple undirected kk-cycles containing vertex vv. Ck(v)=0C_k(v)=0 for k≤2k\le2. Let Ck→(v)C_k^{\to}(v) denote the number of distinct simple directed kk-cycles containing vertex vv. Note that Ck→(v)=2Ck(v)C_k^{\to}(v)=2C_k(v) since each undirected cycle can be traversed in two directions.

Lemma B.2 (Triangles). For any vertex vv, C3→(v)=(A3)vvC_3^{\to}(v)=(A^3)_{vv}

Proof. Since there are no self-loops, any closed walk of length 3 is a simple directed 3-cycle.

Lemma B.3 (4-cycles). C4→(v)=(A4)vv−d(v)2+d(v)−∑w∈N(v)d(w)C_4^{\to}(v)=(A^4)_{vv}-d(v)^2+d(v)-\sum_{w\in N(v)}d(w)

Proof. We count the number of closed walks of length 4 that are not simple cycles, starting from vv. Closed walks of length 4 which are not simple cycles must revisit some node. This node can be vv, meaning the walk must be of the form v−x−v−y−vv-x-v-y-v, which can be formed in d(v)2=((A2)vv)2d(v)^2=((A^2)_{vv})^2 ways. If the revisited node is not vv, the walk must be of the form v−x−y−x−vv-x-y-x-v, which can be formed in ∑w∈N(v)d(w)\sum_{w\in N(v)}d(w) ways. These cases overlap for paths of the form v−x−v−x−vv-x-v-x-v, of which there are d(v)=(A2)vvd(v)=(A^2)_{vv} in total.

Lemma B.4 (5-cycles).

C5→(v)=(A5)vv−(2d(v)(A3)vv+2∑u∈N(v)d(u)(A2)uv+∑u∈N(v)(A3)uu−5(A3)vv)C_5^{\to}(v)=(A^5)_{vv}-\left(2d(v)(A^3)_{vv}+2\sum_{u\in N(v)}d(u)(A^2)_{uv}+\sum_{u\in N(v)}(A^3)_{uu}-5(A^3)_{vv}\right)

Proof. The entry (A5)vv(A^5)_{vv} counts all closed walks of length 5 starting and ending at vv. We subtract those that are not simple 5-cycles.

Every non-simple closed walk of length 5 in a simple graph consists of a directed triangle together with a backtracking walk of the form x−y−xx-y-x. We count such 5-walks in two cases.

First suppose that the triangle contains vv. Let TvT_v be the set of undirected triangles containing vv,

Tv={{v,a,b}:{v,a},{a,b},{b,v}∈E}T_v=\{\{v,a,b\}:\{v,a\},\{a,b\},\{b,v\}\in E\}

Fix an undirected triangle {v,a,b}\{v,a,b\}. There are two orientations. For one orientation, say

v→a→b→v,v\to a\to b\to v,

the backtracking walk can be inserted at one of the four positions vv, aa, bb, vv. Here, the two occurrences of vv are distinct, since the 5-walk is rooted at vv. Thus, before correcting overcounting, this gives

2(2d(v)+d(a)+d(b))2(2d(v)+d(a)+d(b))

walks for the triangle {v,a,b}\{v,a,b\}.

However, if the edge on the backtracking walk is one of the triangle edges, the same walk is counted twice: once as a backtrack inserted at one endpoint of the edge and once as a backtrack inserted at the other endpoint. For each orientation there are three such choices. Therefore the number of non-simple closed 5-walks whose underlying triangle contains vv is

∑{v,a,b}∈Tv(4d(v)+2d(a)+2d(b)−6),\sum_{\{v,a,b\}\in T_v}(4d(v)+2d(a)+2d(b)-6),

We now rewrite this expression in matrix form. First, since d(v)d(v) is independent of the triangle,

∑{v,a,b}∈Tv4d(v)=4d(v)∣Tv∣=2d(v)(A3)vv\sum_{\{v,a,b\}\in T_v}4d(v)=4d(v)|T_v|=2d(v)(A^3)_{vv}

Second, consider the term involving the degrees of the two non-vv vertices:

∑{v,a,b}∈Tv(2d(a)+2d(b)).\sum_{\{v,a,b\}\in T_v}(2d(a)+2d(b)).

We rewrite this by summing over neighbors u∈N(v)u\in N(v). A neighbor uu appears as one of the two non-vv vertices in exactly as many triangles as there are common neighbors of uu and vv. This number is (A2)uv(A^2)_{uv}. Thus

∑{v,a,b}∈Tv(2d(a)+2d(b))=2∑u∈N(v)d(u)(A2)uv.\sum_{\{v,a,b\}\in T_v}(2d(a)+2d(b))=2\sum_{u\in N(v)}d(u)(A^2)_{uv}.

Finally,

∑{v,a,b}∈Tv6=6∣Tv∣=3(A3)vv.\sum_{\{v,a,b\}\in T_v} 6 = 6|T_v| = 3(A^3)_{vv}.

Combining the three identities gives

∑{v,a,b}∈Tv(4d(v)+2d(a)+2d(b)−6)=2d(v)(A3)vv+2∑u∈N(v)d(u)(A2)uv−3(A3)vv.\sum_{\{v,a,b\}\in T_v} (4d(v) + 2d(a) + 2d(b) - 6) = 2d(v)(A^3)_{vv} + 2\sum_{u\in N(v)} d(u)(A^2)_{uv} - 3(A^3)_{vv}.

It remains to count the non-simple closed 5-walks whose triangle does not contain vv. Such a walk must have the form

v→u→(a directed triangle walk based at u)→vv \to u \to\text{(a directed triangle walk based at }u\text{)} \to v

for some u∈N(v)u \in N(v). The number of directed triangles through uu is (A3)uu(A^3)_{uu}. Among these, the directed triangles that also contain vv are exactly those using the edge {u,v}\{u,v\}, and there are 2(A2)uv2(A^2)_{uv} of them. Therefore this case contributes

∑u∈N(v)((A3)uu−2(A2)uv).\sum_{u\in N(v)}\left((A^3)_{uu} - 2(A^2)_{uv}\right).

The expression can be simplified using the fact that ∑u∈N(v)(A2)uv=(A3)vv\sum_{u\in N(v)}(A^2)_{uv} = (A^3)_{vv}. Hence, the second case contributes

−2(A3)vv+∑u∈N(v)(A3)uu.-2(A^3)_{vv} + \sum_{u\in N(v)}(A^3)_{uu}.

Adding the two cases, the number of non-simple closed 5-walks from vv to itself is

2d(v)(A3)vv+2∑u∈N(v)d(u)(A2)uv+∑u∈N(v)(A3)uu−5(A3)vv.2d(v)(A^3)_{vv} + 2\sum_{u\in N(v)}d(u)(A^2)_{uv} + \sum_{u\in N(v)}(A^3)_{uu} - 5(A^3)_{vv}.

Subtracting these walks from all closed 5-walks gives the claimed formula.

Cycle Counting in kanatsoulis2024counting and kanatsoulis2025learning

Kanatsoulis and Ribeiro [16] study the substructure-counting power of GNNs under random inputs. However, a key assumption in their analysis does not appear to be satisfiable, which undermines the validity of the resulting guarantees. We highlight this issue because the same assumption is directly reused in PEARL [17], which is closely related to our method.

In more detail, the analysis in [16] uses higher-order moments of random variables. A core assumption is access to random variables with all moments equal to 1:

We assume that they (x1,…,xN)(x_1,\ldots,x_N) are identically distributed and satisfy E[xi]=0\mathbb{E}[x_i] = 0, E[xip]=1\mathbb{E}[x_i^p] = 1 for i=1,…,Ni = 1,\ldots,N and p≥2∈Zp \ge2 \in\mathbb{Z}

While this assumption can hold for even moments (for example by taking Pr⁡(xi=±1)=1/2\Pr(x_i = \pm1) = 1/2), it cannot hold simultaneously for odd moments:

Lemma C.1. There does not exist a random variable XX such that

E[X]=0,E[X2]=1,E[X3]=1,E[X4]=1\mathbb{E}[X] = 0, \mathbb{E}[X^2] = 1, \mathbb{E}[X^3] = 1, \mathbb{E}[X^4] = 1

hold simultaneously.

Proof. Applying the Cauchy–Schwarz inequality (Theorem C.2) to XX and X2X^2 gives

1=∣E[X3]∣2≤E[X2]E[X4]=1.1 = \lvert\mathbb{E}[X^3]\rvert^2 \le\mathbb{E}[X^2]\mathbb{E}[X^4] = 1.

Thus equality holds. Equality in Cauchy–Schwarz implies that X2=cXX^2 = cX almost surely for some constant cc. Taking expectations gives

1=E[X2]=cE[X]=0,1 = \mathbb{E}[X^2] = c\mathbb{E}[X] = 0,

which is a contradiction.

The Cauchy-Schwarz inequality is included below for convenience:

Theorem C.2 (Cauchy-Schwarz inequality). For any two random variables AA, BB, we have

∣E[AB]∣2≤E[A2]E[B2]\lvert\mathbb{E}[AB]\rvert^2 \le\mathbb{E}[A^2]\mathbb{E}[B^2]

where equality holds iff A=cBA = cB, for some constant $c.

Dataset Details

ZINC. We use the 12,000-molecule subset of ZINC and its 10,000/1,000/1,000 train/validation/test split [24, 25]. Molecules are represented by graphs with categorical atom types as node features and categorical bond types as edge features. The task is graph-level regression with the standard normalized penalized-logP as target, evaluated by mean absolute error.

Cycle counting. We use the synthetic benchmark of Huang et al. [26], containing 5,000 undirected graphs divided into 1,500/1,000/2,500 training, validation, and test graphs. The node-level targets are the numbers of 3-, 4-, 5-, and 6-cycles containing each node. The graphs have no input node or edge attributes, so every node receives the same constant feature. We report mean absolute error normalized by the target standard deviation.

Directed pattern detection. We use the synthetic directed-multigraph benchmark of Egressy et al. [27]. The dataset has a separate 8,192-node graph for training, validation, and testing. The task is node-level multi-label classification of participation in directed cycles of lengths 2–6, scatter-gather motifs, and bicliques [33]. Node features are constant and there are no edge attributes. Performance is measured by minority-class F1 for each pattern.

DrugOOD. We use the LBAP-core IC50 task from DrugOOD [36], under distribution shifts defined by assay, molecular scaffold, and molecule size. Molecules are represented using 39-dimensional atom features, including atom type, hybridization, hydrogen count, and chirality, and 10-dimensional bond features, including bond type, conjugation, ring membership, and stereochemistry. Each setting provides an in-distribution training split and both in- and out-of-distribution validation and test splits. The split sizes depend on the chosen shift.

CIFAR10 superpixels. We use the CIFAR10 superpixel benchmark of Dwivedi et al. [25], with 45,000/5,000/10,000 train/validation/test graphs. Each image is represented by an 8-nearest-neighbor graph containing 85–150 superpixels. Node features contain continuous RGB values and two-dimensional coordinates, while each edge has a scalar feature derived from spatial distance. The task is graph classification with 10 classes, evaluated by accuracy.

Dataset#Graphs (train/val/test)Avg. nodesAvg. edgesNode inputsEdge inputs
ZINC10,000 / 1,000 / 1,00023.1649.83Atom type (28 cat.)Bond type (3 cat.)
Cycle counting1,500 / 1,000 / 2,50018.8062.68ConstantNone
Directed pattern detection1 / 1 / 18,192.0023,630.67ConstantNone
CIFAR10 superpixels45,000 / 5,000 / 10,000117.63941.07RGB + coordinates (5D)Spatial distance (1D)

Table 4. Statistics and input features for the datasets with fixed train/validation/test splits. Average node and edge counts are computed over the full dataset. DrugOOD uses shift-dependent five-way splits and is described in the text.

Experimental Details

For ZINC, the structural encoder uses r=120r = 120 Rademacher probes, a 37-dimensional output encoding, and an eight-layer GIN with hidden dimension 40. The resulting encoding is added to the initial node embeddings and passed to the task GNN: four GINE layers with hidden dimension 128, additive graph pooling, and a three-layer prediction MLP.

For the cycle counting task, we use the same DIAL structural encoder and no additional base GNN. DIAL uses r=120r = 120 Rademacher probes, a 37-dimensional output encoding, and a six-layer GIN with hidden dimension 40. This encoding is added to 64-dimensional node embeddings, and node-level predictions are made directly with a two-layer MLP.

For directed pattern detection, both R-PEARL and DIAL are trained as node-level multi-label classifiers using r=120r = 120 random probes, K=4K = 4, a 37-dimensional structural encoding, six learned GIN layers with hidden dimension 40, and no additional downstream base GNN. Predictions are made from the resulting node embeddings with a two-layer MLP.

In all experiments, the DIAL structural encoder and the downstream task GNN are trained jointly in an end-to-end fashion. We use the Adam [37] optimizer with a base learning rate of 0.001. For directed pattern detection and ZINC, we train for 150 and 2000 epochs, respectively, using a cosine learning-rate schedule with warmup. For the cycle counting task, we train for 2000 epochs and use a ReduceLROnPlateau learning-rate scheduler. Results are averaged over five random seeds for pattern detection and ZINC, and over three random seeds for node-level cycle counting, following the evaluation protocol of the compared methods.

Runtime Results

Table 5 reports the per-epoch training and inference times for DIAL on each benchmark used in the paper. Experiments were run on a single machine with an NVIDIA RTX 4090 (24 GB) GPU and an AMD Ryzen 9 7950X CPU using PyTorch 2.2.2 and CUDA 11.8. Training and inference times are reported as per-epoch means over 22 measured epochs, excluding 3 warmup epochs, and averaged across 3 independent runs.

DatasetEpochsTrain (s/epoch)Inference (s)Total train (h)Peak mem. (GiB)
ZINC200015.15±0.0315.15 \pm0.030.91±0.010.91 \pm0.018.429.94
Directed pattern detection1500.171±0.0000.171 \pm0.0000.078±0.0000.078 \pm0.0000.0110.67
Cycle counting20001.191±0.0091.191 \pm0.0090.952±0.0110.952 \pm0.0110.665.11

Table 5. Per-epoch training and inference time for DIAL on each main benchmark used in the paper. Total training time is a projection, computed as the mean per-epoch training time multiplied by the reported number of training epochs.

Additional Experimental Results

GraphGPS Backbone

To test whether DIAL is also useful with a hybrid message-passing/Transformer architecture, we combine it with a GraphGPS backbone [38]. We use the same dataset, fixed train/validation/test splits, target normalization, evaluation metric, three seeds, and 2,000-epoch training budget as in the original cycle-counting experiment. The GraphGPS and DIAL+GraphGPS variants use identical four-layer GraphGPS backbones with GIN as the local model and four attention heads, and differ only in whether DIAL is included. The original DIAL results are included as a reference.

Method3-Cycle4-Cycle5-Cycle6-Cycle
GraphGPS0.2557±0.00330.2557 \pm0.00330.2027±0.00290.2027 \pm0.00290.1680±0.00310.1680 \pm0.00310.1268±0.00190.1268 \pm0.0019
DIAL (original)0.0041±0.0001\mathbf{0.0041 \pm0.0001}0.0185±0.00270.0185 \pm0.00270.0271±0.0005\mathbf{0.0271 \pm0.0005}0.0348±0.00300.0348 \pm0.0030
DIAL + GraphGPS0.0080±0.00110.0080 \pm0.00110.0177±0.0006\mathbf{0.0177 \pm0.0006}0.0274±0.00120.0274 \pm0.00120.0292±0.0009\mathbf{0.0292 \pm0.0009}

Table 6. Node-level cycle-counting results with a GraphGPS backbone. We report normalized MAE as mean ±\pm standard deviation over three seeds; lower is better. Best results are bolded.

Adding DIAL substantially reduces the error of GraphGPS across all four targets. Relative to the original DIAL architecture, DIAL+GraphGPS has lower mean error on 4- and 6-cycles, similar error on 5-cycles, and higher error on 3-cycles.

Ablation of the Post-GIN Correlation

DIAL correlates the original random probes with their propagated representations at two points in the structural encoder: after linear graph-shift propagation and after the learned GIN layers. The first correlation is the mechanism analyzed theoretically. Since the GIN layers contain nonlinearities, the same analysis does not directly apply to the second correlation. We therefore ablate only the post-GIN correlation, leaving the GIN layers and all other architectural and training choices unchanged.

Method3-Cycle4-Cycle5-Cycle6-Cycle
DIAL.0041 ± .0001.0185 ± .0027.0271 ± .0005.0348 ± .0030
DIAL (no post-GIN corr.).0046 ± .0007.0203 ± .0020.0260 ± .0006.0371 ± .0042

Table 7. Effect of removing the post-GIN probe correlation on node-level cycle counting. We report normalized MAE as mean ± standard deviation over three seeds; lower is better. Best results are bolded.

Method2-Cycle3-Cycle4-Cycle5-Cycle6-CycleS-GB-CMacro F1
DIAL91.07 ± 3.3382.44 ± 4.4879.72 ± 1.5072.10 ± 2.2174.83 ± 2.9578.68 ± 2.7966.07 ± 1.4877.84
DIAL (no post-GIN corr.)70.56 ± 17.0371.42 ± 5.0675.36 ± 2.5069.21 ± 2.5773.52 ± 4.6475.81 ± 4.2665.45 ± 0.7871.62

Table 8. Effect of removing the post-GIN probe correlation on directed pattern detection. Per-pattern entries are minority-class F1 scores in percent, reported as mean ± standard deviation over five seeds. Macro F1 is the unweighted mean of the per-pattern means; higher is better. Best results are bolded.

Removing the post-GIN correlation has a small and mixed effect on cycle counting: it increases the error for 3-, 4-, and 6-cycles, but slightly reduces it for 5-cycles. On directed pattern detection, the ablation performs worse on every target and reduces macro F1 from 77.84 to 71.62, with the largest drops on 2 and 3-cycles. Thus, the post-GIN correlation is empirically useful, particularly for directed pattern detection, even though our estimator analysis applies only to the correlation after linear propagation.

We do not include a variant without either probe correlation because it would closely overlap with the R-PEARL random-feature architecture already evaluated in Table 2 and Table 3.

CIFAR10 Superpixels

We additionally evaluate DIAL on CIFAR10 superpixels, where the input node features contain continuous color and coordinate information. Both methods use 120 probes and concatenate the resulting representation with the task features. All variants use the same four-layer downstream GINE classifier. Table 9 shows that both methods improve over the task-only GINE backbone, while R-PEARL performs better than DIAL on this benchmark.

MethodTest accuracy
GINE (task only)57.55 ± 0.78
R-PEARL61.00 ± 0.34
DIAL59.35 ± 0.53

Table 9. CIFAR10 superpixel graph-classification accuracy (%) at the checkpoint with the highest validation accuracy. We report mean ± standard deviation over three seeds; higher is better.

DrugOOD

Table 10 reports in-distribution (ID) and out-of-distribution (OOD) AUROC for DIAL (K=4K = 4) alongside previously reported baselines. DIAL is close to the strongest baseline on the assay split, but performs slightly worse on the scaffold and size splits.

DomainMethodID ValID TestOOD ValOOD Test
AssayNo PE92.92±0.1492.92 \pm0.1492.89±0.1492.89 \pm0.1471.02±0.7971.02 \pm0.7971.68±1.1071.68 \pm1.10
AssayPEG92.51±0.1792.51 \pm0.1792.57±0.2292.57 \pm0.2270.86±0.4470.86 \pm0.4471.98±0.6571.98 \pm0.65
AssaySignNet92.26±0.2192.26 \pm0.2192.43±0.2792.43 \pm0.2770.16±0.5670.16 \pm0.5672.27±0.9772.27 \pm0.97
AssayBasisNet88.96±1.3588.96 \pm1.3589.42±1.1889.42 \pm1.1871.19±0.7271.19 \pm0.7271.66±0.0571.66 \pm0.05
AssaySPE92.84±0.2092.84 \pm0.2092.94±0.1592.94 \pm0.1571.26±0.6271.26 \pm0.6272.53±0.6672.53 \pm0.66
AssaySPE-8S92.36±0.1892.36 \pm0.1892.62±0.1092.62 \pm0.1070.71±0.4770.71 \pm0.4771.72±0.7171.72 \pm0.71
AssayR-PEARL92.71±0.1092.71 \pm0.1092.92±0.1292.92 \pm0.1270.57±0.7270.57 \pm0.7272.24±0.3072.24 \pm0.30
AssayB-PEARL90.54±0.8990.54 \pm0.8990.81±0.7990.81 \pm0.7970.53±0.6770.53 \pm0.6771.22±0.4271.22 \pm0.42
AssayDIAL (K=4K = 4)92.54±0.0992.54 \pm0.0992.64±0.1592.64 \pm0.1571.33±0.6471.33 \pm0.6472.03±0.4972.03 \pm0.49
ScaffoldNo PE96.56±0.1096.56 \pm0.1087.95±0.2087.95 \pm0.2079.07±0.9779.07 \pm0.9768.00±0.6068.00 \pm0.60
ScaffoldPEG95.65±0.2995.65 \pm0.2986.20±0.1486.20 \pm0.1479.17±0.9779.17 \pm0.9769.15±0.7569.15 \pm0.75
ScaffoldSignNet95.48±0.3495.48 \pm0.3486.73±0.5686.73 \pm0.5677.81±0.7077.81 \pm0.7066.43±1.0666.43 \pm1.06
ScaffoldBasisNet85.80±3.7585.80 \pm3.7578.44±2.4578.44 \pm2.4573.36±1.4473.36 \pm1.4466.32±5.6866.32 \pm5.68
ScaffoldSPE96.32±0.2896.32 \pm0.2888.12±0.4188.12 \pm0.4180.03±0.5880.03 \pm0.5869.64±0.4969.64 \pm0.49
ScaffoldSPE-8S96.44±0.07996.44 \pm0.07987.88±0.4587.88 \pm0.4579.34±0.5079.34 \pm0.5068.72±0.6368.72 \pm0.63
ScaffoldR-PEARL96.09±0.3296.09 \pm0.3288.01±0.4388.01 \pm0.4378.72±0.0278.72 \pm0.0269.20±1.0069.20 \pm1.00
ScaffoldB-PEARL96.06±0.2996.06 \pm0.2987.56±0.8187.56 \pm0.8179.86±0.5879.86 \pm0.5869.51±0.6269.51 \pm0.62
ScaffoldDIAL (K=4K = 4)95.84±0.5495.84 \pm0.5486.99±1.0386.99 \pm1.0378.69±0.4278.69 \pm0.4267.89±0.7967.89 \pm0.79
SizeNo PE93.78±0.1293.78 \pm0.1293.60±0.2793.60 \pm0.2782.76±0.0482.76 \pm0.0466.04±0.7066.04 \pm0.70
SizePEG92.46±0.3592.46 \pm0.3592.67±0.2392.67 \pm0.2382.12±0.4982.12 \pm0.4966.01±0.1066.01 \pm0.10
SizeSignNet93.30±0.4393.30 \pm0.4393.20±0.3993.20 \pm0.3980.67±0.5080.67 \pm0.5064.03±0.7064.03 \pm0.70
SizeBasisNet86.04±4.0186.04 \pm4.0185.51±4.0485.51 \pm4.0475.97±1.7175.97 \pm1.7160.79±3.1960.79 \pm3.19
SizeSPE92.46±0.3592.46 \pm0.3592.67±0.2392.67 \pm0.2382.12±0.4982.12 \pm0.4966.02±0.4966.02 \pm0.49
SizeSPE-8S93.68±0.2093.68 \pm0.2093.86±0.1293.86 \pm0.1283.04±0.6383.04 \pm0.6365.74±2.2065.74 \pm2.20
SizeR-PEARL93.32±0.3493.32 \pm0.3493.92±0.2093.92 \pm0.2082.09±0.4482.09 \pm0.4465.89±1.3065.89 \pm1.30
SizeB-PEARL93.18±0.4593.18 \pm0.4593.29±0.4693.29 \pm0.4683.14±0.3783.14 \pm0.3766.58±0.6766.58 \pm0.67
SizeDIAL (K=4K = 4)93.46±0.1793.46 \pm0.1793.72±0.2593.72 \pm0.2582.07±0.3482.07 \pm0.3465.71±0.2365.71 \pm0.23

Table 10. DrugOOD binding-affinity prediction results (AUROC, %). Baseline results are taken from Kanatsoulis et al. [17] and reported as mean ±\pm standard deviation over five seeds. Best point estimates for each domain are bolded.

References

  1. [1]Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=ryGs6iA5Km. 1, 3, 9arxiv.org/abs/1810.00826
  2. [2]Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 4602–4609, 2019. 1, 3arxiv.org/abs/1810.02244
  3. [3]Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, and Michael M. Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(1):657–668, 2023. doi: 10.1109/TPAMI.2022.3154319. 1, 3, 9DOI
  4. [4]M.F. Hutchinson. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics - Simulation and Computation, 19(2):433–450, 1990. doi: 10.1080/03610919008812866. URL https://doi.org/10.1080/03610919008812866. 1, 4
  5. [5]Derek Lim, Joshua Robinson, Lingxiao Zhao, Tess Smidt, Suvrit Sra, Haggai Maron, and Stefanie Jegelka. Sign and basis invariant networks for spectral graph representation learning. In International Conference on Learning Representations, 2023. 3, 9, 17arxiv.org/abs/2202.13013
  6. [6]Zhengdao Chen, Lei Chen, Soledad Villar, and Joan Bruna. Can graph neural networks count substructures? Advances in neural information processing systems, 33:10383–10395, 2020. 3arxiv.org/abs/2002.04025
  7. [7]Tom Wollschläger, Niklas Kemper, Leon Hetzel, Johanna Sommer, and Stephan G üṅnemann. Expressivity and generalization: Fragment-biases for molecular GNNs. In Ruslan Salakhutdinov, Zico Kolter, Katherine Heller, Adrian Weller, Nuria Oliver, Johann Christoph Scarlett, and Felix Berkenkamp, editors, Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 53113–53139. PMLR, 21–27 Jul 2024. URL https://proceedings.mlr.press/v235/wollschlager24a.html. 3arxiv.org/abs/2406.08210
  8. [8]Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. Advances in neural information processing systems, 2019. 3, 9arxiv.org/abs/1905.11136
  9. [9]Pál András Papp, Karolis Martinkus, Lukas Faber, and Roger Wattenhofer. DropGNN: Random dropouts increase the expressiveness of graph neural networks. Advances in Neural Information Processing Systems, 34:21997–22009, 2021.arxiv.org/abs/2111.06283
  10. [10]Clement Vignac, Andreas Loukas, and Pascal Frossard. Building powerful and equivariant graph neural networks with structural message-passing. Advances in neural information processing systems, 33:14143–14155, 2020. 3
  11. [11]Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding: Design probably more powerful neural networks for graph representation learning. Advances in Neural Information Processing Systems, 33:4465–4478, 2020. 3
  12. [12]George Dasoulas, Ludovic Dos Santos, Kevin Scaman, and Aladin Virmaux. Coloring graph neural networks for node disambiguation. In Christian Bessiere, editor, Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pages 2126–2132. International Joint Conferences on Artificial Intelligence Organization, 2020. doi: 10.24963/ijcai.2020/294. URL https://doi.org/10.24963/ijcai.2020/294.
  13. [13]Ralph Abboud, Ismail Ilkan Ceylan, Martin Grohe, and Thomas Lukasiewicz. The surprising power of graph neural networks with random node initialization. In Zhi-Hua Zhou, editor, Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 2112–2118. International Joint Conferences on Artificial Intelligence Organization, 2021. doi: 10.24963/ijcai.2021/291. URL https://doi.org/10.24963/ijcai.2021/291.
  14. [14]Pál András Papp and Roger Wattenhofer. A theoretical consideration of graph neural network extensions. In International Conference on Machine Learning, pages 17323–17345. PMLR, 2022.arxiv.org/abs/2201.12884
  15. [15]Omri Puny, Heli Ben-Hamu, and Yaron Lipman. Global attention improves graph networks generalization, 2020. URL https://arxiv.org/abs/2006.07846.
  16. [16]Charilaos Kanatsoulis and Alejandro Ribeiro. Counting graph substructures with graph neural networks. In The twelfth international conference on learning representations, 2024.
  17. [17]Charilaos Kanatsoulis, Evelyn Choi, Stefanie Jegelka, Jure Leskovec, and Alejandro Ribeiro. Learning efficient positional encodings with graph neural networks. In International Conference on Learning Representations, 2025.arxiv.org/abs/2502.01122
  18. [18]Moshe Eliasof, Fabrizio Frasca, Beatrice Bevilacqua, Eran Treister, Gal Chechik, and Haggai Maron. Graph positional encoding via random feature propagation. In International conference on machine learning, pages 9202–9223. PMLR, 2023.arxiv.org/abs/2303.02918
  19. [19]Fan RK Chung. Spectral graph theory, volume 92. American Mathematical Soc., 1997.
  20. [20]David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE signal processing magazine, 30(3):83–98, 2013.DOI
  21. [21]Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In International Conference on Learning Representations, 2014.arxiv.org/abs/1312.6203
  22. [22]Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. Advances in neural information processing systems, 29, 2016.arxiv.org/abs/1606.09375
  23. [23]Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.arxiv.org/abs/1609.02907
  24. [24]John J Irwin, Teague Sterling, Michael M Mysinger, Erin S Bolstad, and Ryan G Coleman. Zinc: a free tool to discover chemistry for biology. Journal of chemical information and modeling, 52(7):1757–1768, 2012.DOI
  25. [25]Vijay Prakash Dwivedi, Chaitanya K Joshi, Anh Tuan Luu, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. Journal of Machine Learning Research, 24(43):1–48, 2023.
  26. [26]Yinan Huang, Xingang Peng, Jianzhu Ma, and Muhan Zhang. Boosting the cycle counting power of graph neural networks with L²-GNNs. In International Conference on Learning Representations, 2023.arxiv.org/abs/2210.13978
  27. [27]Béni Egressy, Luc Von Niederhäusern, Jovan Blanuša, Erik Altman, Roger Wattenhofer, and Kubilay Atasu. Provably powerful graph neural networks for directed multigraphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 11838–11846, 2024.arxiv.org/abs/2306.11586
  28. [28]Yinan Huang, William Lu, Joshua Robinson, Yu Yang, Muhan Zhang, Stefanie Jegelka, and Pan Li. On the stability of expressive positional encodings for graphs. In International Conference on Learning Representations, 2024.arxiv.org/abs/2310.02579
  29. [29]Jiaxuan You, Jonathan M Gomes-Selman, Rex Ying, and Jure Leskovec. Identity-aware graph neural networks. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pages 10737–10745, 2021.
  30. [30]Zhang, Muhan and Pan Li. Nested graph neural networks. Advances in Neural Information Processing Systems, 34:15734–15747, 2021. 9arxiv.org/abs/2110.13197
  31. [31]Lingxiao Zhao, Wei Jin, Leman Akoglu, and Neil Shah. From stars to subgraphs: Uplifting any GNN with local structure awareness. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=Mspk_WYKoEH. 9arxiv.org/abs/2110.03753
  32. [32]Junru Zhou, Jiarui Feng, Xiyuan Wang, and Muhan Zhang. Distance-restricted folklore weisfeiler-leman GNNs with provable cycle counting power. Advances in Neural Information Processing Systems, 36:14293–14327, 2023. 9arxiv.org/abs/2309.04941
  33. [33]Erik Altman, Jovan Blanuša, Luc Von Niederhäusern, Béni Egressy, Andreea Anghel, and Kubilay Atasu. Realistic synthetic financial transactions for anti-money laundering models. Advances in Neural Information Processing Systems, 36:29851–29874, 2023. 8, 20arxiv.org/abs/2306.16424
  34. [34]Haggai Maron, Ethan Fetaya, Nimrod Segol, and Yaron Lipman. On the universality of invariant networks. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 4363–4371. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.press/v97/maron19a.html. 17arxiv.org/abs/1901.09342
  35. [35]Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. In International Conference on Learning Representations, 2019. 17arxiv.org/abs/1812.09902
  36. [36]Yuanfeng Ji, Lu Zhang, Jiaxiang Wu, Bingzhe Wu, Lanqing Li, Long-Kai Huang, Tingyang Xu, Yu Rong, Jie Ren, Ding Xue, et al. Drugood: Out-of-distribution dataset curator and benchmark for ai-aided drug discovery—a focus on affinity prediction problems with noise annotations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 8023–8031, 2023. 20
  37. [37]Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015. 20arxiv.org/abs/1412.6980
  38. [38]Ladislav Rampášek, Mikhail Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu, Guy Wolf, and Dominique Beaini. Recipe for a general, powerful, scalable graph transformer. In Advances in Neural Information Processing Systems, volume 35, pages 14501–14515, 2022. 21arxiv.org/abs/2205.12454

Paper details

vlnc:W_masa9afz
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents