SlowGuess/NeurIPS_2023_OCR huggingface dataset:
[46] Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. Molecularnet: a benchmark for molecular machine learning. Chemical science, 9(2):513-530, 2018.
[47] Cristian Bodnar, Fabrizio Frasca, Nina Otter, Yu Guang Wang, Pietro Lio, Guido Montufar, and Michael M. Bronstein. Weisfeiler and lehman go cellular: CW networks. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=uVPZCMVtsSG.
[48] Ladislav Rampášek, Mikhail Galkin, Vijay Prakash Dwivedi, Anh Tuan Luu, Guy Wolf, and Dominique Beaini. Recipe for a General, Powerful, Scalable Graph Transformer. Advances in Neural Information Processing Systems, 35, 2022.
[49] Deyu Bo, Chuan Shi, Lele Wang, and Renjie Liao. Specformer: Spectral graph neural networks meet transformers. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=OpdSt3oyJa1.
[50] Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1-7, 2014.
[51] Vijay Prakash Dwivedi, Chaitanya K Joshi, Anh Tuan Luu, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020.
[52] Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
A Additional preliminaries 16
A.1 Additional definitions 16
A.2 More on Weisfeiler-Lehman test and Folklore Weisfeiler-Lehman test 16
B Additional discussion on  $(k,t)$  -FWL 17
B.1 Detailed proofs for  $(k,t)$  -FWL 17
B.2 Complexity analysis 22
B.3 Limitations 22
C Additional discussion on  $(k,t)$  -FWL+ 22
C.1 Detailed proofs for  $(k,t)$  -FWL+ 22
C.2 Discussion on the complexity 28
C.3 Limitations 28
D Additional discussion on  $\mathbf{N}^2$  -FWL and  $\mathbf{N}^2$  -GNN 29
D.1 Detailed proofs for  $\mathbf{N}^2$  -FWL 29
D.2 Complexity analysis 30
D.3 Model implementation details 30
D.4 Limitations 31
E Experimental details 32
E.1 Dataset statistics 32
E.2 Experimental details 32
F Additional experimental results 34
F.1 Ablation studies for  $(k,t)$  -FWL+ 34
F.2 Practical complexity of  $\mathbf{N}^2$  -GNN 34
F.3 Additional discussion on BREC experiment 35
F.4 Ablation studies for  $\mathbf{N}^2$  -GNN 35
A Additional preliminaries
In this section, we provide additional preliminaries.
A.1 Additional definitions
Definition A.1. When we say we select a  $t$ -tuple  $\mathbf{w}' = (w_1', w_2', \dots, w_t')$  from a  $p$ -tuple  $\mathbf{v} = (v_1, v_2, \dots, v_p) (p \geq t)$ , it means that we select  $t$  unique indices  $(i_1, i_2, \dots, i_t)$  from  $[p]$  such that  $i_1 < i_2 < \dots < i_t$ . Next, to construct  $\mathbf{w}'$ , we let  $w_1' = v_{i_1}, \ldots, w_t' = v_{i_t}$ . When we say we select all possible  $t$ -tuple  $\mathbf{w}'$  from a  $p$ -tuple  $\mathbf{v}$ , we enumerate all possible  $t$  indices and construct  $t$ -tuples correspondingly. There are  $\binom{p}{t}$  different selection results and we denote  $\tilde{P}_t(\mathbf{v})$  as the set of all possible selections. Finally, when we say select all possible  $t$ -tuple  $\mathbf{w}'$  from a  $p$ -tuple  $\mathbf{v}$  with order, we further assume that the selection process is taken with a predefined order such that the sequence of selected  $t$  indices will be the same if we repeat the selection. For example, we can always assume we start from indices  $(1, 2, \dots, t)$ . Next, fix other indices and enumerate all possible  $i_t$  in ascending order. Then, increase  $i_{t-1}$  by 1 and repeat the procedure. If we select all possible 2-tuple from  $(v_1, v_2, v_3)$ , the result is  $((v_1, v_2), (v_1, v_3), (v_2, v_3))$ . We denote  $P_t(\mathbf{v})$  as the tuple of the selection result.
Definition A.2. Neighborhood tuple  $Q_{\mathbf{w}}^{F}(\mathbf{v})$  is a generalization of neighbor set  $Q_{w}^{F}(\mathbf{v})$  in  $k$ -FWL. Briefly speaking, the neighborhood tuple enumerates all possible combinations of elements in  $\mathbf{v}$  and  $\mathbf{w}$  follows a pre-defined order. Suppose the length of the tuple is  $k$  and  $t$  for  $\mathbf{v}$  and  $\mathbf{w}$ , respectively. To construct the neighborhood tuple  $Q_{\mathbf{w}}^{F}(\mathbf{v})$ , we enumerate  $m$  from 0 to  $\min(k, t)$ . For each  $m$ , we construct a sub-tuple, and the final neighborhood tuple  $Q_{\mathbf{w}}^{F}(\mathbf{v})$  is the concatenation of all sub-tuples. Given a particular  $m$ , the sub-tuple is constructed by selecting all possible  $m$ -tuple  $\mathbf{w}' = (w_1', \dots, w_m')$  from  $t$ -tuple  $\mathbf{w}$  with order to construct a tuple  $P_m(\mathbf{w})$ . At the same time, we select all possible  $m$  indices  $\mathbf{i}' = (i_1', \dots, i_m')$  from  $\mathbf{i} = (1, 2, \dots, k)$  with order to construct another tuple  $P_m(\mathbf{i})$ . Finally, for each  $(\mathbf{w}', \mathbf{i}') \in P_m(\mathbf{w}) \times P_m(\mathbf{i})$ , we add a tuple to the resulted sub-tuple by replacing  $v_{i_o}'$  with  $w_o'$  for  $o = 1, 2, \dots, m$ . The neighborhood tuple is constructed by concatenating all sub-tuples. The length of the neighborhood tuple is  $\sum_{m=0}^{min(k, t)} \binom{k}{m} \times \binom{t}{m}$ .
Definition A.3. Let  $F_{1}$  and  $F_{2}$  be two color refinement algorithms, and denote  $\mathcal{C}_i(G), i \in \{1, 2\}$  as the color histogram computed by  $F_{i}$  for graph  $G$  after convergence. We say:
-  $F_{1}$  is more powerful than  $F_{2}$ , denoted as  $F_{2} \preceq F_{1}$ , if for any pair of graph  $G$  and  $H$ ,  $\mathcal{C}_1(G) = \mathcal{C}_1(H)$  also implies  $\mathcal{C}_2(G) = \mathcal{C}_2(H)$ .
-  $F_{1}$  is as powerful as  $F_{2}$ , denoted as  $F_{1} \simeq F_{2}$ , if we have  $F_{1} \preceq F_{2}$  and  $F_{2} \preceq F_{1}$ .
-  $F_{1}$  is strictly more powerful than  $F_{2}$ , denoted as  $F_{2} \prec F_{1}$ , if we have  $F_{2} \preceq F_{1}$  and there exist graphs  $G$  and  $H$  such that  $\mathcal{C}_1(G) \neq \mathcal{C}_1(H)$  and  $\mathcal{C}_2(G) = \mathcal{C}_2(H)$ .
-  $F_{1}$  and  $F_{2}$  are incomparable, denoted as  $F_{1} \nsim F_{2}$ , if neither  $F_{1} \preceq F_{2}$  nor  $F_{2} \preceq F_{1}$  holds.
Remark A.4. To prove that  $F_{1}$  is more powerful than  $F_{2}$ , one way is to show that the color of node/tuple cannot be further refined by  $F_{2}$  if the color output from  $F_{1}$  is already stable (convergence). This was also indicated in Remark B.2 in [12]. Note that the initial color of  $F_{1}$  should be at least as powerful as the initial color of  $F_{2}$ . Namely, if we use the initial color to compute the color histogram, we have  $F_{2} \preceq F_{1}$ .
A.2 More on Weisfeiler-Lehman test and Folklore Weisfeiler-Lehman test
First, we restate the color update equation of both  $k$ -WL and  $k$ -FWL.
$$
\mathbf {W L}: \quad \mathcal {C} _ {k w l} ^ {l} (\mathbf {v}) = \operatorname {H A S H} \left(\mathcal {C} _ {k w l} ^ {l - 1} (\mathbf {v}), \left(\{\{\mathcal {C} _ {k w l} ^ {l - 1} (\mathbf {u}) | \mathbf {u} \in Q _ {j} (\mathbf {v}) \} \} \mid j \in [ k ]\right)\right),
$$
$$
\mathbf {F W L}: \quad \mathcal {C} _ {k f w l} ^ {l} (\mathbf {v}) = \operatorname {H A S H} \left(\mathcal {C} _ {k f w l} ^ {l - 1} (\mathbf {v}), \{\{\left(\mathcal {C} _ {k f w l} ^ {l - 1} (\mathbf {u}) | \mathbf {u} \in Q _ {w} ^ {F} (\mathbf {v})\right) | w \in V (G) \} \}\right).
$$
The first step of both  $k$ -WL and  $k$ -FWL is to encoder the isomorphic type of tuple  $\mathbf{v} = (v_{1}, v_{2}, \ldots, v_{k})$  as initial color such that for any two tuples  $\mathbf{u}, \mathbf{v} \in v^{k}(G)$ ,  $\mathcal{C}_{kfwl}^{0}(\mathbf{v}) = \mathcal{C}_{kfwl}^{0}(\mathbf{u})$  and  $\mathcal{C}_{kwl}^{0}(\mathbf{v}) =$
$\mathcal{C}_{kwl}^{0}(\mathbf{u})$  if and only if the ordered subgraphs induced by two tuples have the same isomorphism type. Namely,  $\forall i,j\in [k](1)l_{G}(v_{i}) = l_{G}(u_{i})$  and (2)  $(v_{i},v_{j})\in E(G)\iff (u_{i},u_{j})\in E(G)$ . Another thing is that the HSAH here is an injective function. As long as the input is different, the output of HASH is different. This will serve as a basic concept in the later proof. The algorithm converge means that  $\forall \mathbf{v}\in V^{k}(G)$ , we have  $\mathcal{C}_{kwl}^{l + 1}(\mathbf{v}) = \mathcal{C}_{kwl}^{l}(\mathbf{v})$  or  $\mathcal{C}_{kfwl}^{l + 1}(\mathbf{v}) = \mathcal{C}_{kfwl}^{l}(\mathbf{v})$ . Denote the convergent iteration as  $\infty$ . After the algorithm convergence, the color histogram can be computed by another injective function:
$$
\mathcal {C} _ {k f w l} (G) = \operatorname {H A S H} \left(\{\{\mathcal {C} _ {k f w l} ^ {\infty} (\mathbf {v}) | \mathbf {v} \in V ^ {k} (G) \}\}\right). \tag {12}
$$
Here we use  $k$ -FWL as an example, but the procedure for other color refinement algorithms is the same.
B Additional discussion on  $(k,t)$ -FWL
B.1 Detailed proofs for  $(k,t)$ -FWL
In this section, we provide all detailed proofs related to  $(k,t)$ -FWL. Let  $\mathbf{p} = (\mathbf{v},\mathbf{w})$  be a new tuple that is the concatenation of a  $k$ -tuple  $\mathbf{v}$  and a  $t$ -tuple  $\mathbf{w}$ . Let  $\mathcal{C}_{(k + t)wl}^{0}(\mathbf{p})$  be the isomorphic type of tuple  $\mathbf{p}$ . We start to prove the expressive power of  $(k,t)$ -FWL with the first lemma:
Lemma B.1. Suppose  $k \geq 2$  and  $t \geq 1$ . Given two graphs  $G, H$ , two tuples  $\mathbf{v}_1 \in V^k(G), \mathbf{v}_2 \in V^k(H)$ , and another two tuples  $\mathbf{w}_1 \in V^t(G), \mathbf{w}_2 \in V^t(H)$ . Let  $\mathbf{p}_1 = (\mathbf{v}_1, \mathbf{w}_1)$ ,  $\mathbf{p}_2 = (\mathbf{v}_2, \mathbf{w}_2)$ . We have  $\mathcal{C}_{(k + t)wl}^0(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^0(\mathbf{p}_2) \iff \left( \mathcal{C}_{ktfwl}^0(\mathbf{u}_1) | \mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1) \right) = \left( \mathcal{C}_{ktfwl}^0(\mathbf{u}_2) | \mathbf{u}_2 \in Q_{\mathbf{w}_2}^F(\mathbf{v}_2) \right)$ .
Proof. First, we prove the forward direction. That is, if  $\mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_2)$ , we have  $\left(\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_1)|\mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)\right) = \left(\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_2)|\mathbf{u}_2 \in Q_{\mathbf{w}_2}^F(\mathbf{v}_2)\right)$ . Recall the definition of the initial color, if  $\mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_2)$ , we must have the ordered subgraph induced by  $\mathbf{p}_1$  is isomorphic to the ordered subgraph induced by  $\mathbf{p}_2$ . Namely,  $\forall i,j \in [k + t]$ ,  $(p_{1i}, p_{1j}) \in E(G) \iff (p_{2i}, p_{2j}) \in E(H)$  and  $l_G(p_{1i}) = l_G(p_{2i})$ . Next, given Definition A.2, we know that for any neighborhood tuple, there exists a single indices mapping function  $O$  that given  $\mathbf{p} = (\mathbf{v}, \mathbf{w})$ , for any  $\mathbf{u} \in Q_{\mathbf{w}}^{F}(\mathbf{v})$ , we have  $O(\mathbf{u}, Q_{\mathbf{w}}^{F}(\mathbf{v})) = (o_1, \ldots, o_k)$  such that  $(u_1, \ldots, u_k) = (p_{o_1}, \ldots, p_{o_k})$ . Further, the construction of the neighborhood tuple follows the same ordering rule no matter the input. This means that, for both  $\mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)$  and  $\mathbf{u}_2 \in Q_{\mathbf{w}_2}^F(\mathbf{v}_2)$ , as long as  $\mathbf{u}_1$  and  $\mathbf{u}_2$  are in the same position of neighborhood tuple  $Q_{\mathbf{w}_1}^F(\mathbf{v}_1)$  and  $Q_{\mathbf{w}_2}^F(\mathbf{v}_2)$ , we must have  $O(\mathbf{u}_1, Q_{\mathbf{w}_1}^F(\mathbf{v}_1)) = O(\mathbf{u}_2, Q_{\mathbf{w}_2}^F(\mathbf{v}_2)) = (o_1, \ldots, o_k)$ . Finally, as for any  $o_i$  and  $o_j$ , we have  $(p_{1o_i}, p_{1o_j}) \in E(G) \iff (p_{2o_i}, p_{2o_j}) \in E(H)$ ,  $l_G(p_{1o_i}) = l_G(p_{2o_i})$ , and  $l_G(p_{1o_j}) = l_G(p_{2o_j})$ , we conclude that  $\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_1) = \mathcal{C}_{ktfwl}^{0}(\mathbf{u}_2)$ . As it is the same for any  $\mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)$  and  $\mathbf{u}_2 \in Q_{\mathbf{w}_2}^F(\mathbf{v}_2)$ , it must holds that  $\left(\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_1)|\mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)\right) = \left(\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_2)|\mathbf{u}_2 \in Q_{\mathbf{w}_2}^ F(\mathbf{v}_2)\right)$ . The proof of the backward direction is similar to the forward direction. As for any  $i,j \in [k + t]$ , we can find  $p_{1i}, p_{1j}$  exist in some  $\mathbf{u}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)$  and  $p_{2i}, p_{2j}$  in the corresponding  $\mathbf{u}_2 \in Q_{\mathbf{w}_2}^F(\mathbf{v}_2)$ . Since we have  $\mathcal{C}_{ktfwl}^{0}(\mathbf{u}_1) = \mathcal{C}_{ktfwl}^{0}(\mathbf{u}_2)$ , we can easily conclude that  $(p_{1i}, p_{1j}) \in E(G) \iff (p_{2i}, p_{2j}) \in E(G)$ ,  $l_G(p_{1i}) = l_G(p_{2i})$ , and  $l_G(p_{1j}) = l_G(p_{2j})$ . This concludes the proof.
Lemma B.1 indicates that  $(k, t)$ -FWL can recover the isomorphism type of high-order tuple, which is impossible in the original  $k$ -FWL. Therefore, as long as  $t$  is large enough, we can recover the isomorphism type of the whole graph. Further, Lemma B.1 also implies that we can resort to high-order tuples to prove the expressive power of  $(k, t)$ -FWL. Define the  $H_{t}(\mathbf{v}) = \{(\mathbf{v}, \mathbf{w}) | \mathbf{w} \in V^{t}(G)\}$ , we slightly rewrite Equation (6):
$$
\left. \mathcal {C} _ {k t f w l} ^ {l} (\mathbf {p}) = \operatorname {H A S H} \left(\left(\mathcal {C} _ {k t f w l} ^ {l - 1} (\mathbf {u}) \mid \mathbf {u} \in Q _ {\mathbf {w}} ^ {F} (\mathbf {v})\right)\right), \right. \tag {13}
$$
$$
\mathcal {C} _ {k t f w l} ^ {l} (\mathbf {v}) = \operatorname {H A S H} \left(\mathcal {C} _ {k t f w l} ^ {l - 1} (\mathbf {v}), \{\{\mathcal {C} _ {k t f w l} ^ {l} (\mathbf {p}) | \mathbf {p} \in H _ {t} (\mathbf {v}) \} \} _ {t}\right). \tag {14}
$$
It is easy to verify the rewritten will not affect the expressive power of  $(k,t)$ -FWL. Now, we are ready to prove the Proposition 3.1 in the main paper. We restate it here:
Proposition B.2. For  $k \geq 2$  and  $t \geq 1$ , if  $t \geq n - k$ ,  $(k, t)$ -FWL can solve the graph isomorphism problems with the size of the graph less than or equal to  $n$ .
Proof. Here we show that with only 1 iteration,  $(k,t)$ -FWL can solve the graph isomorphism problem with the size of graph  $n \leq t + k$ . Given Lemma B.1, for any  $\mathbf{v} \in V^k(G)$ , we have  $\mathcal{C}_{ktfwl}^1(\mathbf{p}_1) = \mathcal{C}_{ktfwl}^1(\mathbf{p}_2) \iff \mathcal{C}_{(k+t)wl}^0(\mathbf{p}_1) = \mathcal{C}_{(k+t)wl}^0(\mathbf{p}_2)$  for any  $\mathbf{p}_1, \mathbf{p}_2 \in H_t(\mathbf{v})$ . Therefore  $\{\mathcal{C}_{ktfwl}^1(\mathbf{p}) | \mathbf{p} \in H_t(\mathbf{v})\}$  is equivalent to  $\{\mathcal{C}_{(k+t)wl}^0(\mathbf{p}) | \mathbf{p} \in H_t(\mathbf{v})\}$ , which is essentially the multiset of isomorphism type of  $\mathbf{p} \in H_t(\mathbf{v})$ . According to Equation (14),  $\mathcal{C}_{ktfwl}^1(\mathbf{v})$  can injectively encode this information. Next, the color histogram of a graph is computed by  $\mathcal{C}_{ktfwl}(G) = \mathrm{HASH}(\{\mathcal{C}_{ktfwl}^1(\mathbf{v}) | \mathbf{v} \in V^k(G)\})$ . It is easy to verify that  $\mathcal{C}_{ktfwl}(G)$  can encode the isomorphism type of all  $(k+t)$ -tuple  $\mathbf{p} \in V^{k+t}(G)$ . Then, if the graph has size  $n \leq k+t$ ,  $\mathcal{C}_{ktfwl}(G)$  can give different color histograms for any non-isomorphic graph pairs. This concludes the proof.
Before we prove the relationship between  $(k,t)$ -FWL and  $(k + t)$ -WL, we first show some properties of  $(k + t)$ -WL. Let  $\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{p})$  be the stable color of tuple  $\mathbf{p} \in V^{k + t}(G)$  output from  $(k + t)$ -WL. We first show that:
Lemma B.3. Suppose  $k \geq 2, t \geq 1$ . Given a graph  $G$ , for any  $\mathbf{v}_1, \mathbf{v}_2 \in V^k(G)$ ,  $\mathbf{w}_1, \mathbf{w}_2 \in V^t(G)$ ,  $\mathbf{p}_1 = (\mathbf{v}_1, \mathbf{w}_1)$ ,  $\mathbf{p}_2 = (\mathbf{v}_2, \mathbf{w}_2)$ ,  $\mathcal{C}_{(k + t)wl}^\infty(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^\infty(\mathbf{p}_2)$  implies that  $\{\mathcal{C}_{(k + t)wl}^\infty(\mathbf{q}_1) | \mathbf{q}_1 \in H_t(\mathbf{v}_1)\} \rangle_t = \{\{\mathcal{C}_{(k + t)wl}^\infty(\mathbf{q}_2) | \mathbf{q}_2 \in H_t(\mathbf{v}_2)\} \rangle_t$ .
Proof. Let  $\mathbf{p}_1 = (p_{11},\ldots ,p_{1(k + t)}),\mathbf{p}_2 = (p_{21},\ldots ,p_{2(k + t)})$  As we have  $\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{p}_2)$  given it is the stable color, we must have  $\{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{11},\dots,p_{1k},w,p_{1(k + 2)},\dots,p_{1(k + t)}))|w\in V(G)\}\} = \{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{21},\dots,p_{2k},w,p_{2(k + 2)},\dots,p_{2(k + t)}))|w\in V(G)\}\}$ . Otherwise, by doing one more iteration, we will have  $\mathcal{C}_{(k + t)wl}^{\infty +1}(\mathbf{p}_1)\neq \mathcal{C}_{(k + t)wl}^{\infty +1}(\mathbf{p}_2)$ , which is a contradiction. Further, we can do another unrolling to have  $\{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{11},\dots,p_{1k},w_1,w_2,\dots,p_{1(k + t)}))|w_2\in V(G)\}\}|w_1\in V(G)\}\} = \{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{21},\dots,p_{2k},w_1,w_2,\dots,p_{2(k + t)}))|w_2\in V(G)\}\}|w_1\in V(G)\}\}$ . This implies that  $\{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{11},\dots,p_{1k},w_1,w_2,\dots,p_{1(k + t)}))|(w_1,w_2)\in V^2 (G)\}\}_{2} = \{\{\mathcal{C}_{(k + t)wl}^{\infty}((p_{21},\dots,p_{2k},w_1,w_2,\dots,p_{2(k + t)}))|(w_1,\dots,w_t)\} |(w_1,\dots,w_t)\in V^t (G)\}\}_{t} = \{\mathcal{C}_{(k + t)wl}^{\infty}((p_{21},\dots,p_{2k},w_1,\dots,w_t))|(w_1,\dots,w_t)\in V^t (G)\}\}_{t}$ , which is exactly  $\{\{\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{q}_1)|\mathbf{q}_1\in H_t(\mathbf{v}_1)\} _t = \{\{\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{q}_2)|\mathbf{q}_2\in H_t(\mathbf{v}_2)\} _t.\}$ . This concludes the proof.
Lemma B.3 indicates that if the  $(k,t)$ -WL converges, the hierarchical set will not increase the expressive power of  $(k + t)$ -WL. Based on this observation, we can slightly rewrite the equation for computing the graph color histogram of  $(k + t)$ -WL:
$$
\mathcal {C} _ {(k + t) w l} ^ {\infty} (\mathbf {v}) = \operatorname {H A S H} \left(\left\{\left\{\mathcal {C} _ {(k + t) w l} ^ {\infty} (\mathbf {p}) \right| \mathbf {p} \in H _ {t} (\mathbf {v}) \right\} _ {t}\right), \tag {15}
$$
$$
\mathcal {C} _ {(k + t) w l} ^ {\infty} (G) = \operatorname {H A S H} \left(\left\{\left\{\mathcal {C} _ {(k + t) w l} ^ {\infty} (\mathbf {v}) \right| \mathbf {v} \in V ^ {k} (G) \right\}\right), \tag {16}
$$
where  $\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{v})$  is the stable color of  $k$ -tuple  $v$ . Here we change the computation of graph color histogram by first hierarchically pooling all tuples in  $H_{t}(\mathbf{v})$  to get a color for  $\mathbf{v}$  and then pooling all tuples  $\mathbf{v} \in V^{k}(G)$ . It is straightforward that the rewritten will not change the expressive power of  $(k + t)$ -WL given Lemma B.3. Equation (15) and Equation (16) will be used in the latter proofs. Not surprisingly, we have similar result for  $(k, t)$ -FWL:
Lemma B.4. Suppose  $k \geq 2, t \geq 1$ . Given a graph  $G$ , for any  $\mathbf{v}_1, \mathbf{v}_2 \in V^k(G)$ ,  $\mathbf{w}_1, \mathbf{w}_2 \in V^t(G)$ ,  $\mathbf{p}_1 = (\mathbf{v}_1, \mathbf{w}_1)$ ,  $\mathbf{p}_2 = (\mathbf{v}_2, \mathbf{w}_2)$ ,  $\mathcal{C}_{ktfwl}^\infty(\mathbf{p}_1) = \mathcal{C}_{ktfwl}^\infty(\mathbf{p}_2)$  implies that  $\{\mathcal{C}_{ktfwl}^\infty(\mathbf{q}_1) | \mathbf{q}_1 \in H_t(\mathbf{v}_1)\} \}_t = \{\mathcal{C}_{ktfwl}^\infty(\mathbf{q}_2) | \mathbf{q}_2 \in H_t(\mathbf{v}_2)\} \}_t$ .
Proof. Given the definition of the neighborhood tuple, we must have  $\mathbf{v}_1 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_1)$  and  $\mathbf{v}_2 \in Q_{\mathbf{w}_1}^F(\mathbf{v}_2)$ . This means we also have  $\mathcal{C}_{k t f w l}^\infty(\mathbf{v}_1) = \mathcal{C}_{k t f w l}^\infty(\mathbf{v}_2)$ . Otherwise, by doing one more iteration of  $(k, t)$ -FWL, we will get different colors for  $\mathbf{p}_1$  and  $\mathbf{p}_2$ , which is a contradiction.  $\mathcal{C}_{k t f w l}^\infty(\mathbf{v}_1) = \mathcal{C}_{k t f w l}^\infty(\mathbf{v}_2)$  directly implies that  $\{\{\mathcal{C}_{k t f w l}^\infty(\mathbf{q}_1) | \mathbf{q}_1 \in H_t(\mathbf{v}_1)\}\}_{t} = \{\{\mathcal{C}_{k t f w l}^\infty(\mathbf{q}_2) | \mathbf{q}_2 \in H_t(\mathbf{v}_2)\}\}_{t}$  given Equation (14) and thus conclude the proof.
Next, we show another property of  $(k + t)$ -WL. Denote  $I_{k + t}$  as a permutation group operates on the indices of a  $k + t$ -tuple. For  $\sigma \in I_{k + t}$ , we denote it operates on a  $k + t$ -tuple  $\mathbf{p} = (p_1, \ldots, p_{k + t})$  as  $\sigma \cdot \mathbf{p} = (p_{\sigma(1)}, \ldots, p_{\sigma(k + t)})$ . For example, for a  $\sigma \in I_3$  with  $\sigma(1) = 2$ ,  $\sigma(2) = 1$ ,  $\sigma(3) = 3$ , we have  $\sigma \cdot (p_1, p_2, p_3) = (p_2, p_1, p_3)$ .
Lemma B.5. Given two graphs  $G$  and  $H$ , for any  $\mathbf{p}_1 = (p_{11},\ldots ,p_{1(k + t)})\in V^{k + t}(G)$ ,  $\mathbf{p}_2 = (p_{21},\dots ,p_{2(k + t)})\in V^{k + t}(H)$  and a permutation  $\sigma \in I_{k + t}$  operates on the indices of tuples,  $\mathcal{C}_{(k + t)wl}^l (\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^l (\mathbf{p}_2)$  implies that  $\mathcal{C}_{(k + t)wl}^l (\boldsymbol {\sigma}\cdot \mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^l (\boldsymbol {\sigma}\cdot \mathbf{p}_2)$ .
Proof. We prove it by induction on  $l$ . At iteration 0,  $\mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_{1}) = \mathcal{C}_{(k + t)wl}^{0}(\mathbf{p}_{2})$  means the ordered subgraph induced by  $\mathbf{p}_{1}$  is isomorphic to the ordered subgraph induced by  $\mathbf{p}_{2}$ . As the permutation is operating on the indices, it will not change the nodes in the tuple but only change the order of the tuple. As we use the same permutation  $\sigma$  for both  $\mathbf{p}_{1}$  and  $\mathbf{p}_{2}$ , it is easy to verify  $\mathcal{C}_{(k + t)wl}^{0}(\sigma \cdot \mathbf{p}_{1}) = \mathcal{C}_{(k + t)wl}^{0}(\sigma \cdot \mathbf{p}_{2})$ . Suppose it follows for  $1, \ldots, l - 1$ . At iteration  $l$ , if  $\mathcal{C}_{(k + t)wl}^{l}(\mathbf{p}_{1}) = \mathcal{C}_{(k + t)wl}^{l}(\mathbf{p}_{2})$ , we have:
$$
\{\{\mathcal {C} _ {(k + t) w l} ^ {l - 1} (\mathbf {p} _ {1, w / j}) | w \in V (G) \} \} = \{\{\mathcal {C} _ {(k + t) w l} ^ {l - 1} (\mathbf {p} _ {2, w / j}) | w \in V (H) \} \}, \quad \forall j \in [ k + t ].
$$
Then, since the statement follows at iteration  $l - 1$ , we must have
$$
\{\{\mathcal {C} _ {(k + t) w l} ^ {l - 1} ((\sigma \cdot \mathbf {p} _ {1}) _ {w / j}) | w \in V (G) \} \} = \{\{\mathcal {C} _ {(k + t) w l} ^ {l - 1} ((\sigma \cdot \mathbf {p} _ {2}) _ {w / j}) | w \in V (H) \}, \quad \forall j \in [ k + t ].
$$
The above equation directly implies that  $\mathcal{C}_{(k + t)wl}^{l}(\sigma \cdot \mathbf{p}_{1}) = \mathcal{C}_{(k + t)wl}^{l}(\sigma \cdot \mathbf{p}_{2})$ . This concludes the proof.
With all conclusions at hand, we can start to prove the main proposition in this section.
Proposition B.6. Suppose  $k \geq 2, t \geq 1$ . Given any two graphs  $G$  and  $H$ . If  $\mathcal{C}_{(k + t)wl}^{\infty}(G) = \mathcal{C}_{(k + t)wl}^{\infty}(H)$ , then for any  $\mathbf{v}_1 \in V^k(G)$ ,  $\mathbf{v}_2 \in V^k(H)$ ,  $\mathbf{w}_1 \in V^t(G)$ ,  $\mathbf{w}_2 \in V^t(H)$ ,  $\mathbf{p}_1 = (\mathbf{v}_1, \mathbf{w}_1)$ ,  $\mathbf{p}_2 = (\mathbf{v}_2, \mathbf{w}_2)$  with  $\mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{p}_1) = \mathcal{C}_{(k + t)wl}^{\infty}(\mathbf{p}_2)$ , we also have  $\mathcal{C}_{ktfwl}^{\infty}(\mathbf{p}_1) = \mathcal{C}_{ktfwl}^{\infty}(\mathbf{p}_2)$ .
Proof. As indicated in Remark A.4, this can be proved by doing one iteration of  $(k,t)$ -FWL using the stable color computed by the  $k + t$ -WL as the initial color. If the color is not refined anymore, we can conclude it. However, since there is no stable color of low dimensional tuples in original  $(k + t)$ -WL, we resort to Equation (15) for help: