SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Thus, it is straightforward that the systems of equations are the same for all  $n$  nodes belonging to class  $c = 1$ , as the procedure of row and column multiplication remains the same. Thus, the  $C$  unknowns in these linear systems have the same solution for all  $n$  nodes belonging to class  $c = 1$ . It is straightforward to extend this to any class  $c \in [C]$  and obtain:
$$
\left(s _ {c 1, 1}, \dots , s _ {c C, 1}\right) = \dots = \left(s _ {c 1, n}, \dots , s _ {c C, n}\right), \quad \forall c \in [ C ], \tag {73}
$$
which exactly represents the condition  $\mathbf{C}$  as per the theorem.
E Proof of Theorem 3.2
In this appendix, we derive the upper bound on the probability of sampling the desired neighborhood for condition C.
Recall that to satisfy condition  $\mathbf{C}$ , the requirement w.r.t  $\widehat{\mathbf{A}}$  is for  $\left(\frac{|\mathcal{N}_1(v_{c,i})|}{|\mathcal{N}(v_{c,i})|},\dots ,\frac{|\mathcal{N}_C(v_{c,i})|}{|\mathcal{N}(v_{c,i})|}\right)$ ,  $\forall i\in [n]$  to be the same for a given  $c\in [C]$ . To this end, we are primarily concerned with the probabilities of edges between nodes  $v_{i},v_{j},1\leq i\leq j\leq N$ . Thus, as per preliminaries, the probability matrix  $\mathbf{P}$  can be given in block form as:
$$
\mathbf {P} = \left[ \begin{array}{c c c c} p \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} & q \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} & \dots & q \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} \\ \vdots & p \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} & \dots & q \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} \\ \vdots & \ddots & \ddots & \vdots \\ \vdots & \dots & \dots & p \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} \end{array} \right] _ {N \times N}
$$
Where we are only concerned with the diagonal and upper triangular values<sup>11</sup>. Now, for a pair of classes  $c, c' \in [C]$ , we are concerned with the block probability matrix  $p\mathbf{1}_n\mathbf{1}_n^\top$  when  $c = c'$  and  $q\mathbf{1}_n\mathbf{1}_n^\top$  when  $c \neq c'$  for sampling edges between nodes. Observe that sampling edges within a community based on diagonal block matrix  $p\mathbf{1}_n\mathbf{1}_n^\top$  is the same as sampling an Erdos-Renyi graph with edge probability  $p$ . Similarly, sampling edges between communities based on off-diagonal block matrix  $q\mathbf{1}_n\mathbf{1}_n^\top$  is the same as sampling a bipartite graph with edge probability  $q$ .
Concentration of pairwise neighbor ratios: To begin with, consider the set of nodes belonging to class  $c \in [C]$  as  $\Omega_c = \{v_{c,1}, \dots, v_{c,n}\}$ . Now, to satisfy condition  $\mathbf{C}$ , the fraction of neighbors of nodes  $v_{c,i}, v_{c,j}, i \neq j \in [n]$  that belong to class  $c' \in [C]$  should be equal, i.e.  $s_{cc',i} = s_{cc',j}$ . Formally, this leads to:
$$
\frac {| \mathcal {N} _ {c ^ {\prime}} (v _ {c , i}) |}{| \mathcal {N} (v _ {c , i}) |} = \frac {| \mathcal {N} _ {c ^ {\prime}} (v _ {c , j}) |}{| \mathcal {N} (v _ {c , j}) |} \Rightarrow \frac {| \mathcal {N} _ {c ^ {\prime}} (v _ {c , i}) |}{| \mathcal {N} _ {c ^ {\prime}} (v _ {c , j}) |} = \frac {| \mathcal {N} (v _ {c , i}) |}{| \mathcal {N} (v _ {c , j}) |}
$$
Without loss of generality, observe that  $|\mathcal{N}_{c'}(v_{c,i})|$  is the sum of  $n$  independent Bernoulli random variables  $\gamma_{c,i}^{c',l}$ ,  $\forall l\in [n]$  with  $\mathbb{P}(\gamma_{c,i}^{c',l} = 1) = q$ . This implies that  $\mathbb{E}|\mathcal{N}_{c'}(v_{c,i})| = nq$ . Now, we apply the Chernoff bound to obtain:
$$
\mathbb {P} \left(\left| \left| \mathcal {N} _ {c ^ {\prime}} (v _ {c, i}) \right| - n q \right| \geq \delta n q\right) \leq 2 e ^ {- t n q \delta^ {2}}
$$
Where  $\delta \in [0,1]$  and  $t > 0$  is a constant. By choosing  $\delta = \sqrt{\frac{(r + 1)\ln n}{tnq}}$  for sufficiently large  $r > 0$ ,  $N >> C$ , we get  $\delta = O(1)$  as  $q = \frac{b\ln N}{N}$ . Now, by taking a union bound over all the nodes in the class, we get:
$$
\mathbb {P} \left(\forall i \in [ n ], | \mathcal {N} _ {c ^ {\prime}} \left(v _ {c, i}\right) | - n q | \geq \delta n q\right) \leq 2 n e ^ {- (r + 1) \ln n}
$$
Thus, with a probability at-least  $1 - 2n^{-r}$  , we get:
$$
\left| \mathcal {N} _ {c ^ {\prime}} \left(v _ {c, i}\right) \right| = n q (1 \pm O (1))
$$
By applying the same line of argument to  $|\mathcal{N}_{c'}(v_{c,j})|$  and assuming a sufficiently large value of  $n$ , we get with a probability at-least  $1 - 4n^{-r}$  that:
$$
\frac {| \mathcal {N} _ {c ^ {\prime}} (v _ {c , i}) |}{| \mathcal {N} _ {c ^ {\prime}} (v _ {c , j}) |} \to 1
$$
To this end, we assume that  $|\mathcal{N}_{c'}(v_{c,i})| = |\mathcal{N}_{c'}(v_{c,j})|, \forall c \in [C], i \neq j \in [n]$  with a high probability for the rest of the analysis. The consequence of this assumption is that all the nodes belonging to the same class have the same degree. However, it is not necessary that the graph itself is regular.
Off-diagonal blocks: Without loss of generality, consider the set of nodes belonging to a pair of classes  $c \neq c' \in [C]$  as  $\Omega_c = \{v_{c,1}, \dots, v_{c,n}\}$ ,  $\Omega_{c'} = \{v_{c',1}, \dots, v_{c',n}\}$  respectively. Now, we need
<sup>11</sup>Due to symmetry, one can equivalently consider the lower triangular values and proceed with sums of columns instead of sums of rows.
to ensure that every node  $v_{c,i} \in \Omega_c$  is connected to (say) exactly  $t_{cc'} \in \mathbb{R}, 0 \leq t_{cc'} \leq n$ , nodes in  $\Omega_{c'}$ . If  $E_{c,i}^{c'}(t_{cc'})$  indicates that such an event occurs for node  $v_{c,i} \in \Omega_c$  with respect to  $\Omega_{c'}$ , we can formally represent it as the sum of  $n$  independent Bernoulli random variables  $\gamma_{c,i}^{c',j}, i \in [n], \forall j \in \{1, \dots, n\}$  with  $\mathbb{P}(\gamma_{c,i}^{c',j} = 1) = q$  sum to  $t_{cc'}$  as follows:
$$
\mathbb {P} (E _ {c, i} ^ {c ^ {\prime}} (t _ {c c ^ {\prime}})) = \left( \begin{array}{c} n \\ t _ {c c ^ {\prime}} \end{array} \right) q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}}.
$$
Now, we are concerned with an intersection of events pertaining to all nodes in  $\Omega_c$ , which ensures that each node has exactly  $t_{cc'}$  neighbors in  $\Omega_{c'}$ . By considering the event  $E_c^{c'}(t_{cc'}) = \bigcap_{i=1}^n E_{c,i}^{c'}(t_{cc'})$  and leveraging the fact that edges are sampled independently, we obtain:
$$
\mathbb {P} \left(E _ {c} ^ {c ^ {\prime}} (t _ {c c ^ {\prime}})\right) = \mathbb {P} \left(\bigcap_ {i = 1} ^ {n} E _ {c, i} ^ {c ^ {\prime}} (t _ {c c ^ {\prime}})\right) = \left[ \binom {n} {t _ {c c ^ {\prime}}} q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}} \right] ^ {n}.
$$
Now, to account for all possible values of  $0 \leq t_{cc'} \leq n$ , we compute the probability of the union of events  $\widetilde{E}_c^{c'} = \bigcup_{t_{cc'} = 0}^n E_c^{c'}(t_{cc'})$  as:
$$
\mathbb {P} \left(\widetilde {E} _ {c} ^ {c ^ {\prime}}\right) \leq \sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} \left[ \binom {n} {t _ {c c ^ {\prime}}} q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}} \right] ^ {n}.
$$
Note that this result can be applied to any distinct pair of classes  $c \neq c' \in [C]$  based on the characteristics of the SSBM. Since we have  $\binom{C}{2} = \frac{C(C-1)}{2}$  combinations of distinct communities, the probability of occurrence of all the corresponding events is given by:
$$
\mathbb {P} \left(\bigcap_ {c = 1} ^ {C - 1} \bigcap_ {c ^ {\prime} = c + 1} ^ {C} \widetilde {E} _ {c} ^ {c ^ {\prime}}\right) \leq \prod_ {c = 1} ^ {C - 1} \prod_ {c ^ {\prime} = c + 1} ^ {C} \sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} \left[ \binom {n} {t _ {c c ^ {\prime}}} q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}} \right] ^ {n}. \tag {74}
$$
Observe that the binomial expansion of  $(q + 1 - q)^n$  is given by:
$$
1 = (q + 1 - q) ^ {n} = \sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} \binom {n} {t _ {c c ^ {\prime}}} q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}}, \tag {75}
$$
where each term, say  $f(t_{cc'}) = \binom{n}{t_{cc'}} q^{t_{cc'}} (1 - q)^{n - t_{cc'}}$  in the sum is strictly less than 1. Additionally,
$$
\begin{array}{l} 1 ^ {n} = \left(\sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right)\right) ^ {n} = \sum_ {k _ {0} + \dots + k _ {n} = n, k _ {0}, \dots , k _ {n} \geq 0} \binom {n} {k _ {0}, \dots , k _ {n}} \prod_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right) ^ {k _ {t _ {c c ^ {\prime}}}} (76) \\ = \sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right) ^ {n} + \sum_ {k _ {0} + \dots + k _ {n} = n, 0 \leq k _ {0}, \dots , k _ {n} <   n} \binom {n} {k _ {0}, \dots , k _ {n}} \prod_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right) ^ {k _ {t _ {c c ^ {\prime}}}}. (77) \\ \end{array}
$$
This gives us:
$$
\sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right) ^ {n} = 1 - \sum_ {k _ {0} + \dots + k _ {n} = n, 0 \leq k _ {0}, \dots , k _ {n} <   n} \binom {n} {k _ {0}, \dots , k _ {n}} \prod_ {t _ {c c ^ {\prime}} = 0} ^ {n} f \left(t _ {c c ^ {\prime}}\right) ^ {k _ {t _ {c c ^ {\prime}}}}. \tag {78}
$$
Observe that there are  $n + 1$  terms in  $\sum_{t_{cc'} = 0}^{n} f(t_{cc'}) = 1$  and the maximum value that  $f(t_{cc'})$  can take is  $< 1$ . Thus, each of the  $f(t_{cc'})$  terms tend to zero after taking the  $n^{th}$  power, as  $n \to \infty$ , leading to  $\sum_{t_{cc'} = 0}^{n} f(t_{cc'})^{n} \to 0$ .
Diagonal blocks: Handling the exact event probabilities when  $c = c' \in [C]$  is not so straightforward due to symmetry constraints. To begin with, observe that the sum of  $n$  independent Bernoulli random variables  $\gamma_{c,i}^{c,j}, i \in [n], \forall j \in \{1, \dots, n\}$  with  $\mathbb{P}(\gamma_{c,i}^{c,j} = 1) = p$  sum to  $t_{cc}$  is given by:
$$
\mathbb {P} \left(E _ {c, i} ^ {c} (t _ {c c})\right) = \mathbb {P} \left(\sum_ {j = 1} ^ {n} \gamma_ {c, i} ^ {c, j} = t _ {c c}\right) = \binom {n} {t _ {c c}} p ^ {t _ {c c}} (1 - p) ^ {n - t _ {c c}}
$$
Since  $\mathbb{P}(E_{c,j}^c (t_{cc}))$  for  $j > i\in [n]$  is conditional on  $\mathbb{P}(E_{c,i}^c (t_{cc}))$ , the desired probability for the event  $E_{c}^{c}(t_{cc}) = \bigcap_{i = 1}^{n}E_{c,i}^{c}(t_{cc})$  can be formulated as:
$$
\begin{array}{l} \mathbb {P} \left(E _ {c} ^ {c} (t _ {c c})\right) = \mathbb {P} \left(\bigcap_ {i = 1} ^ {n} E _ {c, i} ^ {c} (t _ {c c})\right) \\ = \mathbb {P} \left(E _ {c, 1} ^ {c} (t _ {c c})\right) \cdot \mathbb {P} \left(E _ {c, 2} ^ {c} (t _ {c c}) \mid E _ {c, 1} ^ {c} (t _ {c c})\right) \dots \mathbb {P} \left(E _ {c, n} ^ {c} (t _ {c c}) \middle | \bigcap_ {i = 1} ^ {n - 1} E _ {c, i} ^ {c} (t _ {c c})\right) \\ \end{array}
$$
Obtaining a clean expression for the diagonal case is complicated by the fact that the events  $E_{c,1}^{c}(t_{cc}), E_{c,2}^{c}(t_{cc}), \dots, E_{c,n}^{c}(t_{cc})$  are not independent. Since we have already shown in the off-diagonal case that the  $\mathbb{P}\left(\bigcap_{c=1}^{C-1} \bigcap_{c'=c+1}^{C} \widetilde{E}_{c}^{c'}\right) \to 0$  as  $n \to \infty$ , we proceed with the simpler inequality  $\mathbb{P}\left(E_{c}^{c}(t_{cc})\right) < 1$  to convey the message of this theorem. Thus, we estimate the probability of the intersection of all events pertaining to  $c, c' \in [C]$  as:
$$
\begin{array}{l} \mathbb {P} \left(\bigcap_ {c = 1} ^ {C} \bigcap_ {c ^ {\prime} = c} ^ {C} \widetilde {E} _ {c} ^ {c ^ {\prime}}\right) <   \left(\prod_ {c = 1} ^ {C - 1} \prod_ {c ^ {\prime} = c + 1} ^ {C} \sum_ {t _ {c c ^ {\prime}} = 0} ^ {n} \left[ \binom {n} {t _ {c c ^ {\prime}}} q ^ {t _ {c c ^ {\prime}}} (1 - q) ^ {n - t _ {c c ^ {\prime}}} \right] ^ {n}\right) \\ \Rightarrow \mathbb {P} \left(\bigcap_ {c = 1} ^ {C} \bigcap_ {c ^ {\prime} = c} ^ {C} \widetilde {E} _ {c} ^ {c ^ {\prime}}\right) <   \left(\sum_ {t = 0} ^ {n} \left[ \binom {n} {t} q ^ {t} (1 - q) ^ {n - t} \right] ^ {n}\right) ^ {\frac {C (C - 1)}{2}} \tag {79} \\ \end{array}
$$
E.1 Illustration with exhaustive combinations for a small graph
A key assumption in our theoretical analysis has been  $N >> C$ , which allowed us to assume that nodes belonging to the same class have the same degree. However, for an intuitive understanding of condition  $\mathbf{C}$ , let us consider an extremely simple graph with  $N = 4$ ,  $C = 2$ . This leads to the following adjacency matrix formulation:
$$
\mathbf {A} = \left[ \begin{array}{l l l l} \gamma_ {1 1} & \gamma_ {1 2} & \gamma_ {1 3} & \gamma_ {1 4} \\ \gamma_ {1 2} & \gamma_ {2 2} & \gamma_ {2 3} & \gamma_ {2 4} \\ \gamma_ {1 3} & \gamma_ {2 3} & \gamma_ {3 3} & \gamma_ {3 4} \\ \gamma_ {1 4} & \gamma_ {2 4} & \gamma_ {3 4} & \gamma_ {4 4} \end{array} \right] \tag {80}
$$
Where  $\gamma_{ij}$  represents a Bernoulli random variable depending on  $p, q$ . We defer assigning values to  $p, q$  until the end as we are interested in the 'realizations' of  $\mathbf{A}$  that satisfy condition  $\mathbf{C}$ . Observe that there are only 10 random variables in  $\mathbf{A}$  due to symmetry (4 on the diagonal and 6 on the upper-triangular part). Since each can either take a value of 0, 1, there are 1024 unique realizations of  $\mathbf{A}$ . To this end, condition  $\mathbf{C}$  can be represented as:
$$
\frac {\gamma_ {1 1} + \gamma_ {1 2}}{\gamma_ {1 1} + \gamma_ {1 2} + \gamma_ {1 3} + \gamma_ {1 4}} = \frac {\gamma_ {1 2} + \gamma_ {2 2}}{\gamma_ {1 2} + \gamma_ {2 2} + \gamma_ {2 3} + \gamma_ {2 4}} \quad a n d
$$
$$
\frac {\gamma_ {1 3} + \gamma_ {1 4}}{\gamma_ {1 1} + \gamma_ {1 2} + \gamma_ {1 3} + \gamma_ {1 4}} = \frac {\gamma_ {2 3} + \gamma_ {2 4}}{\gamma_ {1 2} + \gamma_ {2 2} + \gamma_ {2 3} + \gamma_ {2 4}} \quad a n d
$$
$$
\frac {\gamma_ {1 3} + \gamma_ {2 3}}{\gamma_ {1 3} + \gamma_ {2 3} + \gamma_ {3 3} + \gamma_ {3 4}} = \frac {\gamma_ {1 4} + \gamma_ {2 4}}{\gamma_ {1 4} + \gamma_ {2 4} + \gamma_ {3 4} + \gamma_ {4 4}} \quad a n d
$$
$$
\frac {\gamma_ {3 3} + \gamma_ {3 4}}{\gamma_ {1 3} + \gamma_ {2 3} + \gamma_ {3 3} + \gamma_ {3 4}} = \frac {\gamma_ {3 4} + \gamma_ {4 4}}{\gamma_ {1 4} + \gamma_ {2 4} + \gamma_ {3 4} + \gamma_ {4 4}}
$$
Based on our simulations for graphs with self-edges, less than 1/10 of the 1024 realizations satisfy this property. A few are illustrated below:
$$
\mathbf {A} = \left[ \begin{array}{c c c c} 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & 1 \end{array} \right], \qquad \mathbf {A} = \left[ \begin{array}{c c c c} 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \end{array} \right]
$$
$$
\mathbf {A} = \left[ \begin{array}{c c c c} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \end{array} \right], \qquad \mathbf {A} = \left[ \begin{array}{c c c c} 1 & 0 & 0 & 1 \\ 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \end{array} \right]
$$
By considering  $p = 0.2, q = 0.05$ , the probability of sampling such A is  $\approx 0.046$ . Interestingly, when  $p = 0.05, q = 0.2$ , the probability increases to  $\approx 0.06$ . Now, by increasing the density of edges in the graph, i.e., when  $p = 0.4, q = 0.1$  and  $p = 0.1, q = 0.4$ , we get probability values  $\approx 0.166, 0.178$  respectively. Now, let us consider the case where  $N = 8, C = 2$ . In this case, we have 36 Bernoulli random variables  $\gamma_{ij}, i \leq j \in \{1, \dots, 8\}$ . The number of possible values for A turns out to be  $2^{36} = 68, 719, 476, 736$ , for which the brute force approach to validate condition C is not efficient. To this end, we follow a simple Monte-Carlo approach and draw 1,000,000 random graphs from SSBM  $(N = 8, C = 2, p = 0.5, q = 0.2)$ . We observed that only  $\approx 800$  graphs out of 1,000,000 satisfied condition C, i.e., a probability of  $\approx 0.0008$ . A few are illustrated below:
$$
\begin{array}{l} \mathbf {A} = \left[ \begin{array}{c c c c c c c c} 0 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \end{array} \right], \quad \mathbf {A} = \left[ \begin{array}{c c c c c c c c} 1 & 1 & 1 & 1 & 0 & 1 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 1 & 0 \\ 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 & 0 & 1 & 1 & 1 \\ 1 & 0 & 0 & 0 & 1 & 1 & 0 & 1 \\ 0 & 1 & 0 & 0 & 1 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 \end{array} \right] \\ \mathbf {A} = \left[ \begin{array}{c c c c c c c c} 0 & 1 & 1 & 0 & 0 & 1 & 0 & 1 \\ 1 & 1 & 0 & 1 & 0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 & 1 & 1 & 1 & 0 \\ 0 & 1 & 1 & 1 & 1 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 & 0 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0 & 1 & 0 & 1 & 1 \\ 0 & 1 & 1 & 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 1 & 1 & 0 \end{array} \right], \quad \mathbf {A} = \left[ \begin{array}{c c c c c c c c} 1 & 1 & 1 & 0 & 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 & 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 & 0 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 & 0 & 0 & 1 & 1 \\ 1 & 1 & 0 & 0 & 1 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 & 1 & 0 & 1 & 1 \\ 0 & 1 & 0 & 1 & 1 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 & 0 & 1 & 1 & 1 \end{array} \right] \\ \end{array}
$$
Thus, the takeaway is that, even for small-medium scale homophilic and heterophilic SSBM graphs, random graphs that satisfy condition  $\mathbf{C}$  are rarely sampled.
F Proof of Theorem 3.3
In this appendix, we analyse the gradient flow stated in (14) and establish the results stated in Theorem 3.3. Our analysis is inspired by the one in [56], but significantly differs from it, as we need to overcome the complexity introduced by the graph structure matrix.
Based on the setup of gUFM for GNN  $\psi^{\mathcal{F}'}$ , we analyze the risk  $\widehat{\mathcal{R}}^{\mathcal{F}'}$  given as follows:
$$
\widehat {\mathcal {R}} ^ {\mathcal {F} ^ {\prime}} (\mathbf {W} _ {2}, \{\mathbf {H} _ {k} \} _ {k = 1} ^ {K}) := \frac {1}{K} \sum_ {k = 1} ^ {K} \left(\frac {1}{2 N} \left\| \mathbf {W} _ {2} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} - \mathbf {Y} \right\| _ {F} ^ {2} + \frac {\lambda_ {H _ {k}}}{2} \left\| \mathbf {H} _ {k} \right\| _ {2} ^ {2}\right) + \frac {\lambda_ {W _ {2}}}{2} \left\| \mathbf {W} _ {2} \right\| _ {2} ^ {2}
$$
By taking the derivatives of  $\widehat{\mathcal{R}}^{\mathcal{F}'}$  with respect to  $(\mathbf{W}_2,\mathbf{H}_k)$ , we get:
$$
\frac {\partial \widehat {\mathbf {R}} ^ {\mathcal {F} ^ {\prime}}}{\partial \mathbf {W} _ {2}} = \frac {1}{K N} \sum_ {k = 1} ^ {K} \left(\mathbf {W} _ {2} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} - \mathbf {Y}\right) \left(\mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k}\right) ^ {\top} + \lambda_ {W _ {2}} \mathbf {W} _ {2}
$$
$$
\frac {\partial \widehat {\mathcal {R}} ^ {\mathcal {F} ^ {\prime}}}{\partial \mathbf {H} _ {k}} = \frac {1}{K N} \left[ \mathbf {W} _ {2} ^ {\top} \left(\mathbf {W} _ {2} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} - \mathbf {Y}\right) \widehat {\mathbf {A}} _ {k} ^ {\top} \right] + \frac {1}{K} \lambda_ {H _ {k}} \mathbf {H} _ {k}
$$
Now, by setting  $\frac{\partial\widehat{\mathcal{R}}^{\mathcal{F}^{\prime}}}{\partial\mathbf{W}_{2}} = 0$  we get the closed form representation of  $\mathbf{W}_2$  in terms of  $\mathbf{H}$ .
$$
\begin{array}{l} \frac {\partial \widehat {\mathcal {R}} ^ {\mathcal {F} ^ {\prime}}}{\partial \mathbf {W} _ {2}} = \frac {1}{K N} \sum_ {k = 1} ^ {K} (\mathbf {W} _ {2} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} - \mathbf {Y}) (\mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k}) ^ {\top} + \lambda_ {W _ {2}} \mathbf {W} _ {2} = 0 \\ \Rightarrow \frac {1}{K} \sum_ {k = 1} ^ {K} \left(\mathbf {W} _ {2} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top} - \mathbf {Y} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top}\right) + \lambda_ {W _ {2}} N \mathbf {W} _ {2} = 0 \\ \Rightarrow \mathbf {W} _ {2} \left[ \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top} + \lambda_ {W _ {2}} N \mathbf {I} \right] = \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbf {Y} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top} \\ \end{array}
$$
Thus, the ideal value of  $\mathbf{W}_2^*$  is given by:
$$
\mathbf {W} _ {2} ^ {*} = \left[ \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbf {Y} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top} \right] \left[ \frac {1}{K} \sum_ {k = 1} ^ {K} \mathbf {H} _ {k} \widehat {\mathbf {A}} _ {k} \widehat {\mathbf {A}} _ {k} ^ {\top} \mathbf {H} _ {k} ^ {\top} + \lambda_ {W _ {2}} N \mathbf {I} \right] ^ {- 1}
$$
Now, under the assumption that  $K = 1, C = 2$ , we drop the subscript for  $\mathbf{H}_k$ ,  $\hat{\mathbf{A}}_k$  to get:
$$
\mathbf {W} _ {2} ^ {*} = \left(\mathbf {Y} \hat {\mathbf {A}} ^ {\top} \mathbf {H} ^ {\top}\right) \left(\mathbf {H} \hat {\mathbf {A}} \hat {\mathbf {A}} ^ {\top} \mathbf {H} ^ {\top} + \lambda_ {W _ {2}} N \mathbf {I}\right) ^ {- 1} \tag {82}
$$
To this end, we return to our risk minimization formulation for a single graph with these optimal values as follows:
$$
\widehat {\mathcal {R}} ^ {\mathcal {F} ^ {\prime}} (\mathbf {H}) = \frac {1}{2 N} \left\| \mathbf {W} _ {2} ^ {*} \mathbf {H} \widehat {\mathbf {A}} - \mathbf {Y} \right\| _ {F} ^ {2} + \frac {\lambda_ {W _ {2}}}{2} \| \mathbf {W} _ {2} ^ {*} \| _ {2} ^ {2} + \frac {\lambda_ {H}}{2} \| \mathbf {H} \| _ {2} ^ {2} \tag {83}
$$
F.1  $\widehat{\mathbf{A}}$  as a perturbation of  $\mathbb{E}\widehat{\mathbf{A}}$
Since we are dealing with SSBM graphs, we can formulate  $\widehat{\mathbf{A}}$  as the perturbed version of its expected value. Formally,  $\widehat{\mathbf{A}} = \mathbb{E}\widehat{\mathbf{A}} +\mathbf{E}$  where  $\mathbb{E}\widehat{\mathbf{A}}\in \mathbb{R}^{N\times N}$  is the expected normalized adjacency matrix and  $\mathbf{E}\in \mathbb{R}^{N\times N}$  is the perturbation matrix.  $\mathbb{E}\widehat{\mathbf{A}}$  can be written in block matrix form as:
$$
\mathbb {E} \widehat {\mathbf {A}} = \frac {1}{n p + n q} \left[ \begin{array}{l l} p \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} & q \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} \\ q \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} & p \mathbf {1} _ {n} \mathbf {1} _ {n} ^ {\top} \end{array} \right] _ {N \times N} \tag {84}
$$
Where the  $\mathbb{E}\widehat{\mathbf{A}}$  has eigenvalues  $1, \frac{p - q}{p + q}$  associated with eigenvectors  $\frac{1}{\sqrt{N}}\mathbf{1}$  and  $\mathbf{c} = \frac{1}{\sqrt{N}}\left[ \begin{array}{c}\mathbf{1}_n\\ -\mathbf{1}_n \end{array} \right]_N$  respectively. Thus, we can represent  $\mathbb{E}\widehat{\mathbf{A}}$  using its spectral information as follows:
$$
\begin{array}{l} \mathbb {E} \widehat {\mathbf {A}} = \frac {2}{N (p + q)} \left(\frac {p + q}{2} \mathbf {1} _ {N} \mathbf {1} _ {N} ^ {\top} + \frac {p - q}{2} \mathbf {c c} ^ {\top}\right) \\ = \left[ \begin{array}{l l} \mathbf {1} _ {N} & \mathbf {c c} \end{array} \right] \left[ \begin{array}{c c} \alpha_ {1} & 0 \\ 0 & \alpha_ {2} \end{array} \right] \left[ \begin{array}{l l} \mathbf {1} _ {N} & \mathbf {c c} \end{array} \right] ^ {\top} \tag {85} \\ = \left[ \begin{array}{c c} \mathbf {1} _ {N} & \mathbf {c c} \end{array} \right] \left[ \begin{array}{c c} \sqrt {\alpha_ {1}} & 0 \\ 0 & \sqrt {\alpha_ {2}} \end{array} \right] \left[ \begin{array}{c c} \sqrt {\alpha_ {1}} & 0 \\ 0 & \sqrt {\alpha_ {2}} \end{array} \right] ^ {\top} \left[ \begin{array}{c c} \mathbf {1} _ {N} & \mathbf {c c} \end{array} \right] ^ {\top} \\ = \mathbf {Q} \mathbf {Q} ^ {\top} \\ \end{array}
$$
Where  $\alpha_{1} = \frac{1}{N},\alpha_{2} = \frac{p - q}{(p + q)N}$ , and  $\mathbf{Q} = [\mathbf{1}_N\quad \mathbf{c}]\left[ \begin{array}{cc}\sqrt{\alpha_1} & 0\\ 0 & \sqrt{\alpha_2} \end{array} \right]\in \mathbb{R}^{N\times 2}$  is the factor matrix.
F.2 Preliminary results
Let us recall the definitions of the within- and between-class covariance matrices,  $\Sigma_W(\mathbf{H})$  and  $\Sigma_B(\mathbf{H})$ , for computing the preliminary results:
$$
\boldsymbol {\Sigma} _ {W} (\mathbf {H}) := \frac {1}{C n} \sum_ {c = 1} ^ {C} \sum_ {i = 1} ^ {n} \left(\mathbf {h} _ {c, i} - \overline {{\mathbf {h}}} _ {c}\right) \left(\mathbf {h} _ {c, i} - \overline {{\mathbf {h}}} _ {c}\right) ^ {\top},
$$