SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Assumption 2 requires that the projections of  $e_1, e_2, \ldots, e_n$  on  $V$  have at least  $d$  distinct lengths, while Assumption 3 requires that each  $x_i$  is not perpendicular to  $\langle u_1, \ldots, u_{i-1} \rangle^\perp$ , which is a subspace of  $V$ . We illustrate two examples of these assumptions being violated when  $n = 3$  and  $d = 2$  in Figure 6. In the left figure, the projections of  $e_1, e_2, e_3$  on  $V$  all have the same lengths, thus  $k = 1 < d$ , violating Assumption 2. In the right figure,  $x_2$  is perpendicular to the orthogonal complementary space of  $\operatorname{span}(u_1)$  in  $V$ , violating Assumption 3. We observe that the eigenspace  $V$  needs to obey certain kinds of symmetries in order to violate either assumptions. For random orthonormal matrices and random weighted graphs, these assumptions have 0 possibility of being violated; and in real-world datasets, the ratio of violation tends to become smaller as the graph size becomes larger.
The number of multiple eigenvalues violating these assumptions in real-world datasets are listed in Table 15. Indeed there is still around  $20\%$  of violation on large datasets, but since multiple
Figure 6: Examples of Assumption 2 and Assumption 3 being violated when  $n = 3$  and  $d = 2$ . Left: the projections of  $e_1, e_2, e_3$  are of the same length, thus  $k = 1 < d$ , violating Assumption 2. Right:  $x_2$  is perpendicular to the orthogonal complementary space of  $\operatorname{span}(u_1)$  in  $V$ , violating Assumption 3.
eigenvalues only make up a small portion of all eigenvalues (Table 9), the ratio of violation is relatively small and has negligible influence on the model performance.
Table 15: The number of eigenvalues violating Assumption 2 or Assumption 3 in real-world datasets.  $n_1$ : the number of eigenvalues violating Assumption 2.  $n_2$ : the number of eigenvalues not violating Assumption 2 but violating Assumption 3.  $N_1$ : the total number of multiple eigenvalues.  $p_1$ : the ratio of multiple eigenvalues violating Assumption 2.  $p_2$ : the ratio of multiple eigenvalues violating Assumption 3.  $N_2$ : the total number of eigenvalues.  $p_3$ : the ratio of all eigenvalues violating Assumption 2.  $p_4$ : the ratio of all eigenvalues violating Assumption 3. We ignore small graphs with no more than 5 nodes.
Dataset	ogbg-molesol	ogbg-molfreesolv	ogbg-molhiv	ogbg-mollipo	ogbg-moltox21	ogbg-moltoxcast	ogbg-molpcba
n1	39	30	5315	440	646	873	30844
n2	126	45	6329	599	1073	1450	61318
N1	738	286	52367	5391	8772	10556	491247
p1	5.28 %	10.49 %	10.15 %	8.16 %	7.36 %	8.27 %	6.28 %
p2	17.07 %	15.73 %	12.09 %	11.11 %	12.23 %	13.74 %	12.48 %
N2	13420	4654	952055	104669	129730	141042	10627757
p3	0.29 %	0.64 %	0.56 %	0.42 %	0.50 %	0.62 %	0.29 %
p4	0.94 %	0.97 %	0.66 %	0.57 %	0.83 %	1.03 %	0.58 %
H Discussions on random graphs
In this section we summarize some existing results on random graphs and more generally random matrices. These discussions help us to have a better understanding of how eigenvalues and eigenvectors of random graphs distribute, and the probability that they are uncanonizable by our MAP algorithm. Due to the theoretical complexity, we do make some simplifications in our discussions.
We first give some basic definitions about random matrices and random graphs.
Definition 3 (Wigner matrix). Let  $\xi, \zeta$  be real random variables with mean zero. We say  $W$  is a Wigner matrix of size  $n$  with atom variables  $\xi, \zeta$  if  $W = (w_{ij})_{i,j=1}^{n}$  is a random real symmetric  $n \times n$  matrix that satisfies the following conditions.
- (independence)  $\{w_{ij} \colon 1 \leq i \leq j \leq n\}$  is a collection of independent random variables.
- (off-diagonal entries)  $\{w_{ij} \colon 1 \leq i < j \leq n\}$  is a collection of independent and identically distributed (iid) copies of  $\xi$ .
- (diagonal entries)  $\{w_{ii} : 1 \leq i \leq n\}$  is a collection of iid copies of  $\zeta$ .
If  $\xi$  and  $\zeta$  have the same distribution, we say  $W$  is a Wigner matrix with atom variable  $\xi$ . We always assume that  $\xi$  is non-degenerate, namely that there is no value  $c$  such that  $\mathbb{P}(\xi = c) = 1$ .
Definition 4 (symmetric Bernoulli matrix). Let  $0 < p < 1$ , and take  $\xi$  to be the random variable
$$
\xi := \left\{ \begin{array}{l l} 1 - p, & \text {w i t h p r o b a b i l i t y} p, \\ - p, & \text {w i t h p r o b a b i l i t y} 1 - p. \end{array} \right.
$$
Then  $\xi$  has zero mean. Let  $B_{n}(p)$  denote the  $n \times n$  Wigner matrix with atom variable  $\xi$ . We refer to  $B_{n}(p)$  as a symmetric Bernoulli matrix (with parameter  $p$ ).
Definition 5 (sub-exponential). A random variable  $\xi$  is called sub-exponential with exponent  $\alpha >0$  if there exists a constant  $\beta >0$  such that
$$
\mathbb {P} (| \xi | > t) \leq \beta \exp (- t ^ {\alpha} / \beta) \quad f o r a l l t > 0.
$$
Definition 6 (Erdős-Rényi random graph). Let  $G(n,p)$  denote the Erdős-Rényi random graph on  $n$  vertices with edge density  $p$ . That is,  $G(n,p)$  is a simple graph on  $n$  vertices such that each edge  $\{i,j\}$  is in  $G(n,p)$  with probability  $p$ , independent of other edges.
Let  $A_{n}(p)$  be the zero-one adjacency matrix of  $G(n,p)$ .  $A_{n}(p)$  is not a Wigner matrix since its entries do not have mean zero. Let  $\tilde{G}(n,p)$  denote the Erdős-Rényi random graph with loops on  $n$  vertices with edge density  $p$ . Let  $\tilde{A}_{n}(p)$  denote the zero-one adjacency matrix of  $\tilde{G}(n,p)$ . Technically,  $\tilde{A}_{n}(p)$  is not a Wigner random matrix because its entries do not have mean zero. However, we can view  $\tilde{A}_{n}(p)$  as a low rank deterministic perturbation of a Wigner matrix. That is, we can write  $\tilde{A}_{n}(p)$  as
$$
\tilde {A} _ {n} (p) = p \pmb {J} _ {n} + B _ {n} (p),
$$
where  $J_{n}$  is the all-ones matrix.
Simplification in our discussions. The adjacency matrix of Erdős-Rényi random graphs can be viewed as a rank-one perturbation of a zero-mean symmetric random matrix, which has no effect on the distribution of eigenvalues in the limit  $n \to \infty$  [8]. In the finite case, the difference between eigenvalues and eigenvectors of the perturbed and unperturbed random matrices can be bounded as well, as stated in the following theorems.
Theorem 9 (O'Rourke et al. [38]). Let  $E$  be an  $n \times n$  Bernoulli random matrix, and let  $A$  be an  $n \times n$  matrix with rank  $r$ . Let  $\sigma_1 \geq \sigma_2 \geq \dots \geq \sigma_{\min \{m,n\}} \geq 0$  be singular values of  $A$ ,  $v_1, v_2, \ldots, v_{\min \{m,n\}}$  be corresponding singular vectors of  $A$ ,  $\sigma_1' \geq \dots \geq \sigma_{\min \{m,n\}}' \geq 0$  be singular values of  $A + E$ ,  $v_1', \ldots, v_{\min \{m,n\}}'$  be corresponding singular vectors of  $A + E$ . For every  $\varepsilon > 0$  there exists constants  $C_0, \delta_0 > 0$  (depending only on  $\varepsilon$ ) such that if  $\delta > \delta_0$  and  $\sigma_1 \geq \max \{n, \sqrt{n}\delta\}$ , then, with probability at least  $1 - \varepsilon$ ,
$$
\sin \angle (v _ {1}, v _ {1} ^ {\prime}) \leq C \frac {\sqrt {r}}{\delta}.
$$
Theorem 10 (O'Rourke et al. [38]). Let  $E$  be an  $n \times n$  Bernoulli random matrix, and let  $A$  be an  $n \times n$  matrix with rank  $r$  satisfying  $\sigma_1 \geq n$ . For every  $\varepsilon > 0$ , there exists a constant  $C_0 > 0$  (depending only on  $\varepsilon$ ) such that, with probability at least  $1 - \varepsilon$ ,
$$
\sigma_ {1} - C \leq \sigma_ {1} ^ {\prime} \leq \sigma_ {1} + C \sqrt {r}.
$$
In particular, when the rank  $r$  is significantly smaller than  $n$ , the bounds in the above theorems are significantly better. Thus the rank-one perturbation has little or no effect on the spectral distribution of the adjacency matrix. In the following discussions we will ignore the rank-one perturbation and assume that the adjacency matrix of random graphs have zero mean.
We will study two cases: (1) the adjacency matrix of the random graph is continuously distributed (random weighted graph); (2) the adjacency matrix of the random graph is discretely distributed (random unweighted graph).
It is easy to see that for a Wigner matrix with atom variables  $\xi, \zeta$ , if the distribution of  $\xi$  is continuous, then with probability 1 it has simple spectrum (i.e., all eigenvalues have multiplicity one), thus no basis ambiguity exists. For its single eigenvectors, we also expect these eigenvectors to be continuously distributed on the unit sphere, thus the probability that they are uncanonizable is equal to 1. In fact, we can even give a explicit formula for the distribution of some simple random matrices, as follows.
Definition 7 (GOE). The Gaussian orthogonal ensemble (GOE) is defined as a Wigner random matrix with atom variables  $\xi, \zeta$ , where  $\xi$  is a standard normal random variable and  $\zeta$  is a normal random variable with mean zero and variance 2.
Theorem 11 (Anderson et al. [4], Section 2.5.1). Let  $M$  be a  $n \times n$  real symmetric matrix drawn from the GOE, with eigenvalues  $\lambda_1 \leq \dots \leq \lambda_n$  and corresponding eigenvectors  $v_1, \ldots, v_n$ . Then the eigenvectors  $v_1, \ldots, v_n$  are uniformly distributed on
$$
S _ {+} ^ {n - 1} := \left\{x = \left(x _ {1}, \dots , x _ {n}\right) \in S ^ {n - 1} \colon x _ {1} > 0 \right\},
$$
and the eigenvalues  $\lambda_1, \ldots, \lambda_n$  have joint density
$$
p_{n}(\lambda_{1},\ldots ,\lambda_{n}):= \left\{ \begin{array}{ll}\frac{1}{Z_{n}}\prod_{1\leq i <   j\leq n}\left|\lambda_{i} - \lambda_{j}\right|\prod_{i = 1}^{n}\mathrm{e}^{-\lambda_{i}^{2} / 4}, & if  \lambda_{1}\leq \dots \leq \lambda_{n},\\ 0, & otherwise, \end{array} \right.
$$
where  $Z_{n}$  is a normalization constant.
Thus the eigenvectors of such Gaussian random matrices are uniformly distributed on the unit sphere, meaning they are canonizable with probability 1.
The discrete case is trickier, because when  $n$  is finite, the probability that the eigenvectors are uncanonizable is no longer 0. We wish that this probability can be upper bounded and asymptotically converges to zero. The first fact is that for a large class of random matrices, perturbed or not, they have simple spectrum with probability  $1 - o(1)$ .
Theorem 12 (Tao and Vu [50]). Consider real symmetric random matrices  $M_{n} = (\xi_{ij})_{1\leq i,j\leq n}$  where the entries  $\xi_{ij}$  for  $i\leq j$  are jointly independent with  $\xi_{ji} = \xi_{ij}$ , the upper-triangular entries  $\xi_{ij}, i < j$  have non-trivial distribution  $\xi$  for some fixed  $\mu >0$  such that  $\mathbb{P}(\xi = x)\leq 1 - \mu$  for all  $x\in \mathbb{R}$ . The diagonal entries  $\xi_{ii}, 1\leq i\leq n$  can have an arbitrary real distribution (and can be correlated with each other), but are required to be independent of the upper diagonal entries  $\xi_{ij}, 1\leq i < j\leq n$ . Then for every fixed  $A > 0$  and  $n$  sufficiently large (depending on  $A,\mu$ ), the spectrum of  $M_{n}$  is simple with probability at least  $1 - n^{-A}$ .
Thus with probability  $1 - o(1)$  no basis ambiguity exists.
For sign ambiguity, we expect that the probability that the single eigenvectors are canonizable asymptotically converges to 1 as  $n \to \infty$ . Denote  $j = (1,1,\dots,1) \in \mathbb{R}^n$  the all-one vector,  $\hat{j} = \left(\frac{1}{\sqrt{n}}, \frac{1}{\sqrt{n}}, \dots, \frac{1}{\sqrt{n}}\right) \in \mathbb{R}^n$  the normalized all-one vector. One obvious fact is that for an eigenvector  $\boldsymbol{u} \in \mathbb{R}^n$ , if it is non-canonical, then  $\boldsymbol{u} \cdot \boldsymbol{j} = 0$ . Thus it suffices to show that the probability of the inner product between  $\boldsymbol{u}$  and  $j$  being zero converges to 0 as  $n \to \infty$ . This can be derived from the following theorem.
Theorem 13 (Tao and Vu [49]). Let  $\xi, \zeta$  be random variables such that
-  $\xi$  and  $\zeta$  are sub-exponential random variables,
$\mathbb{E}(\xi) = \mathbb{E}(\zeta) = \mathbb{E}(\xi^3) = 0,$
-  $\mathbb{E}(\xi^2) = 1, \mathbb{E}(\xi^4) = 3, \mathbb{E}(\zeta^2) = 2,$
and assume  $\xi$  is a symmetric random variable. For each  $n\geq 1$ , let  $W_{n}$  be an  $n\times n$  Wigner matrix with atom variables  $\xi ,\zeta$ . Let  $\{a_n\}$  be a sequence of unit vectors with  $a_{n}\in S^{n - 1}$  such that  $\lim_{n\to \infty}\| a_n\|_{\ell \infty} = 0$ , and let  $\{i_n\}$  be a sequence of indices with  $i_n\in [n]$ . Then
$$
\sqrt {n} v _ {i _ {n}} (W _ {n}) \cdot a _ {n} \rightarrow N (0, 1)
$$
in distribution as  $n\to \infty$
Thus in the limit as  $n\to \infty$  , by taking  $a_{n} = \dot{j}$  , we have the inner product between the eigenvector and  $\pmb{j}$  following a normal distribution. The probability that they have zero inner product is 0, indicating these eigenvectors are almost always canonizable.
Related readings. We refer the readers to Anderson et al. [4] for a introduction of random matrices, Benaych-Georges and Nadakuditi [8] for a survey about the singular values and vectors of low rank perturbations of large random matrices, O'Rourke et al. [37] for a comprehensive survey about eigenvectors of random matrices.
I Further weakening the assumptions
I.1 Further weakening Assumption 1
In Section 3.2, we mentioned that some eigenvectors are intrinsically uncanonicalizable, meaning that it is impossible to canonize them based on themselves. However, in graph-level tasks, the input is a whole graph with  $n$  eigenvectors, not a single eigenvector. When the input graph is permuted by a permutation  $\sigma$ , all the eigenvectors are also permuted in the same way. This raises the question of whether we can canonize one eigenvector based on other eigenvectors in the same graph.
Thus we propose to further weaken Assumption 1 in the following steps. For a given input graph, we first divide its eigenvectors into two sets:  $S_{1}$ , containing all uncanonizable eigenvectors; and  $S_{2}$ , containing all canonizable eigenvectors. Suppose  $|S_{1}| = d_{1}$ ,  $|S_{2}| = d_{2}$ , where  $d_{1} + d_{2} = n$ . Define the matrix of canonizable eigenvectors
$$
\boldsymbol {U} _ {\text {c a n}} = \left[ \boldsymbol {u} _ {1}, \dots , \boldsymbol {u} _ {d _ {2}} \right], \text {w h e r e} \boldsymbol {u} _ {1}, \dots , \boldsymbol {u} _ {d _ {2}} \text {a r e a l l t h e e i g e n v e c t o r s i n} S _ {2}.
$$
We first canonize all the eigenvectors in  $S_{2}$ , using our MAP-sign algorithm. This gives us a matrix of canonized eigenvectors  $\mathbf{U}_{\mathrm{can}}^{*} \in \mathbb{R}^{n \times d_{2}}$ . Using a hash function, we can compress the matrix  $\mathbf{U}_{\mathrm{can}}^{*}$  into a vector  $\mathbf{u}_{\mathrm{can}}$  that preserves all the information of  $S_{2}$ :
$$
\boldsymbol {u} _ {\text {c a n}} \in \mathbb {R} ^ {n}, \text {w h e r e} (u _ {\text {c a n}}) _ {i} = \operatorname {h a s h} \left\{\left(\boldsymbol {U} _ {\text {c a n}} ^ {*}\right) _ {i:} \right\}, 1 \leq i \leq n.
$$
Then we can define the summary vectors  $\pmb{x}_i$  of  $\pmb{u}_{\mathrm{can}}$  in the same way as in Section 3.3, and use them to canonize the eigenvectors in  $S_{1}$ . Denote the projection matrix  $P = \pmb{u}_{\mathrm{can}}\pmb{u}_{\mathrm{can}}^{\top}$  and the projected angles  $\alpha_{i} = |Pe_{i}|, 1 \leq i \leq n$ . Assume that there are  $k$  distinct values in  $\{\alpha_i, i = 1,\dots ,n\}$ , according to which we can divide all basis vectors  $\{e_i\}$  into  $k$  disjoint groups  $\mathcal{B}_i$  (arranged in descending order of the distinct angles). Each  $\mathcal{B}_i$  represents an equivalent class of axis that  $\pmb{u}_{\mathrm{can}}$  has the same projection on. Then we define a summary vector  $\pmb{x}_i$  of  $\pmb{u}_{\mathrm{can}}$  for the axes in each group  $\mathcal{B}_i$  as their total sum  $\pmb{x}_i = \sum_{e_j\in \mathrm{B}_i}\pmb {e}_j + c$ , where  $c$  is a tunable constant.
For each  $\pmb{u} \in S_1$ , we can try to canonize it using the MAP-sign algorithm as in Section 3.3.1, with the summary vectors of  $\pmb{u}$  replaced by the summary vectors of  $\pmb{u}_{\mathrm{can}}$ . We find the first non-orthogonal summary vector with  $\pmb{u}$ , denoted by  $x_{h}$ , and choose the sign that maximizes  $\pmb{u}^{\top} \pmb{x}_{h}$ . In this way, we are able to canonize some eigenvectors in  $S_1$  that are originally uncanonizable, thus further weakening Assumption 1. The complete workflow is shown in Algorithm 6.
Algorithm 6 A stronger algorithm for eliminating sign ambiguity
Require: Input graph  $\mathcal{G} = (\mathbb{V},\mathbb{E},\boldsymbol {X})$    
Ensure: Spectral embedding of  $\mathcal{G}$    
Calculate the eigendecomposition  $\hat{\pmb{A}} = \pmb {U}\pmb {\Lambda}\pmb{U}^{\top}$ $S_{1}\gets$  the set of all uncanonizable eigenvectors of  $\mathcal{G}$ $S_{2}\gets$  the set of all canonizable eigenvectors of  $\mathcal{G}$    
Canonize all eigenvectors in  $S_{2}$  , using Algorithm 1   
 $\pmb{U}_{\mathrm{can}}^{*}\gets [\pmb{u}_{1}^{*},\dots,\pmb{u}_{d_{2}}^{*}]$  , where  $\pmb{u}_{1}^{*},\dots,\pmb{u}_{d_{2}}^{*}$  are all the canonized eigenvectors,  $d_2 = |S_2|$ $\pmb{u}_{\mathrm{can}}\gets \left(\mathrm{hash}\{(U_{\mathrm{can}}^{*})_{1,:}\} ,\ldots ,\mathrm{hash}\{(U_{\mathrm{can}}^{*})_{n,:}\}\right)^{\top}$ $\pmb {P}\gets \pmb{u}_{\mathrm{can}}\pmb{u}_{\mathrm{can}}^{\top}$ $\alpha_{i}\gets |\pmb{Pe}_{i}|,1\leq i\leq n$ $k\gets$  the number of distinct values in  $\{\alpha_i\}$    
Divide all basis vectors  $\{e_i\}$  into  $k$  disjoint groups  $\mathcal{B}_i$  according to the values of  $\{\alpha_i\}$ $\pmb{x}_i\gets \sum_{e_j\in \mathcal{B}_i}\pmb {e}_j + c\pmb {j},i = 1,\dots,k$    
for each eigenvector  $\pmb {u}\in S_1$  do  
 $\pmb{x}_h\gets$  non-orthogonal summary vector with smallest  $h$ $\pmb {u}\gets -\pmb {u}$  if  $\pmb{u}^{\top}\pmb{x}_h <   0$    
end for   
return the canonized eigenvectors
I.2 Further weakening Assumption 2 and Assumption 3
When reading Algorithm 2, some may find it not as strong as Algorithm 1. In Algorithm 1, we search over the summary vectors  $\pmb{x}_i$  one by one, until we find a summary vector  $\pmb{x}_h$  that is not
orthogonal to  $\pmb{u}$ . However, in Algorithm 2, we just assumed that  $\pmb{x}_1$  is not orthogonal to  $V$ ,  $\pmb{x}_2$  is not orthogonal to  $\langle \pmb{u}_1 \rangle^\perp$ ,  $\pmb{x}_3$  is not orthogonal to  $\langle \pmb{u}_1, \pmb{u}_2 \rangle^\perp$ , etc. We did not search for non-orthogonal summary vectors; we just assumed that they are. This observation is more obvious when we look at the special case of Algorithm 2 when  $d = 1$ . In this case, Assumption 2 is always satisfied, and Assumption 3 requires that  $\pmb{x}_1$  is not orthogonal to  $\pmb{u}$ , which is stricter than Assumption 1 in our MAP-sign algorithm. This raises the question of whether we can strengthen Algorithm 2 such that it is as powerful as Algorithm 1 when taking  $d = 1$ .
This can be achieved by searching for non-orthogonal summary vectors at each step just as in Algorithm 1. Suppose we have obtained the summary vectors  $\boldsymbol{x}_i, i = 1, \dots, k$ . First we search  $\{\boldsymbol{x}_i\}$  for the first summary vector  $\boldsymbol{x}_1^*$  that is not orthogonal to  $V$ , and choose  $\boldsymbol{u}_1 \in V$  that maximizes  $\boldsymbol{u}_1^\top \boldsymbol{x}_1^*$ . Next we search  $\{\boldsymbol{x}_i\}$  for the first summary vector  $\boldsymbol{x}_2^*$  that is not orthogonal to  $\langle \boldsymbol{u}_1 \rangle^\perp$ , and choose  $\boldsymbol{u}_2 \in \langle \boldsymbol{u}_1 \rangle^\perp$  that maximizes  $\boldsymbol{u}_2^\top \boldsymbol{x}_2^*$ . Then we search  $\{\boldsymbol{x}_i\}$  for the first summary vector  $\boldsymbol{x}_3^*$  that is not orthogonal to  $\langle \boldsymbol{u}_1, \boldsymbol{u}_2 \rangle^\perp$ , and choose  $\boldsymbol{u}_3 \in \langle \boldsymbol{u}_1, \boldsymbol{u}_2 \rangle^\perp$  that maximizes  $\boldsymbol{u}_3^\top \boldsymbol{x}_3^*$ , and so on. The complete workflow is shown in Algorithm 7.
Algorithm 7 A stronger algorithm for eliminating basis ambiguity
Require: Eigenvalue  $\lambda$  with multiplicity  $d > 1$   
Ensure: Spectral embedding corresponding to  $\lambda$   
Calculate the eigenvectors  $\mathbf{U} \in \mathbb{R}^{n \times d}$  of  $\lambda$  through eigendecomposition  
 $\mathbf{P} \leftarrow \mathbf{U} \mathbf{U}^{\top}$ $\alpha_{i} \leftarrow |\mathbf{Pe}_{i}|, 1 \leq i \leq n$ $k \leftarrow$  the number of distinct values in  $\{\alpha_{i}\}$   
Divide all basis vectors  $\{\pmb{e}_i\}$  into  $k$  disjoint groups  $\mathcal{B}_i$  according to the values of  $\{\alpha_{i}\}$ $\pmb{x}_i \leftarrow \sum_{\pmb{e}_j \in \mathcal{B}_i} \pmb{e}_j + c\pmb{j}, i = 1, \dots, k$   
for  $i = 1, 2, \dots, d$  do  
 $\pmb{x}_i^* \leftarrow$  the first summary vector in  $\{\pmb{x}_i\}$  not perpendicular to  $\langle \pmb{u}_1, \dots, \pmb{u}_{i-1} \rangle^\perp$   
Choose  $\pmb{u}_i \in \langle \pmb{u}_1, \dots, \pmb{u}_{i-1} \rangle^\perp$ ,  $|\pmb{u}_i| = 1$ , s.t.  $f(\pmb{u}_i) = \pmb{u}_i^\top \pmb{x}_i^*$  is maximized  
end for  
return  $U_0 := [\pmb{u}_1, \dots, \pmb{u}_d]$
In order for Algorithm 7 to succeed, we require that such non-orthogonal summary vector  $\boldsymbol{x}_i^*$  exists at each step, which is less restrictive than Assumption 2 and Assumption 3. Thus we obtain a stronger algorithm for eliminating basis ambiguity.
J An alternative approach to dealing with sign ambiguity
In our design for algorithms that eliminate sign ambiguity, we find one type of eigenvectors especially difficult to deal with. That is, uncanonizable eigenvectors  $\mathbf{u} \in \mathbb{R}^n$  such that there exists a permutation matrix  $P \in \mathbb{R}^{n \times n}$  satisfying  $\mathbf{u} = -P\mathbf{u}$ . This means that  $\mathbf{u}$  and  $-\mathbf{u}$  only differ by a permutation. Since they are uncanonizable by Corollary 1, none of the solutions mentioned in Appendix G.1 can handle such eigenvectors. However, depending on the model architecture, such eigenvectors may not cause ambiguities at all. For example, consider the DeepSets-like architecture  $\rho(\sum \phi(\mathbf{u}_i))$ , where  $\phi$  is permutation-invariant. Then since  $\mathbf{u}$  and  $-\mathbf{u}$  only differ by a permutation, they produce the same output when fed to a permutation-invariant network, thus no ambiguities exist. This shows we can delay the handling of uncanonical eigenvectors to the training stage, though it may result in loss of expressive power.
On the other hand, for eigenvectors that are canonizable, we already know that Algorithm 1 canonizes them. Here we give an equivalent algorithm for removing sign ambiguity, shown in Algorithm 8.
Theorem 14. Algorithm 8 uniquely decides the signs of canonizable eigenvectors and is permutation-equivariant.
Theorem 14 is proved in Appendix K.9.
Algorithm 8 is well-motivated and better to understand than Algorithm 1 in some sense. Consider a naive canonization of  $\mathbf{u}$  where we choose the sign such that  $\mathbf{u}$  has positive sum. This canonization algorithm is quite simple, but it cannot canonize all canonizable eigenvectors, such as the ones with
Algorithm 8 An alternative approach to dealing with sign ambiguity
Require: Input graph  $\mathcal{G} = (\mathbb{V},\mathbb{E},\boldsymbol {X})$    
Ensure: Spectral embedding of  $\mathcal{G}$    
Calculate the eigendecomposition  $\hat{\pmb{A}} = \pmb {U}\pmb {\Lambda}\pmb{U}^{\top}$    
for each eigenvector  $\pmb {u}\in \mathbb{R}^n$  do  $h\gets$  the smallest positive odd integer such that  $\sum_{i = 1}^{n}u_{i}^{h}\neq 0$  Substitute  $\pmb{u}$  with  $-\pmb{u}$  if  $\sum_{i = 1}^{n}u_{i}^{h} <   0$    
end for   
return  $U$
zero sum. What Algorithm 8 does is to go on to look at the sum of the 3rd power of  $u$  and, if it is non-zero, choose the sign such that it is positive. If unfortunately it is zero, we go on to look at the sum of the 5th power and so on. It can be proved that there must exist a positive odd integer  $h \leq n$  such that the sum of the  $h$ -th power of  $u$  is non-zero. Thus Algorithm 8 terminates within  $\frac{n + 1}{2}$  steps, successfully canonizing all canonizable eigenvectors.