SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} (1 - t) \mathrm {D} _ {t} \left(P _ {z ^ {\prime}} \| P _ {z}\right) \geq n \left(1 - \frac {m}{n \min  _ {c} \hat {\pi} _ {c} (z)}\right) \sum_ {a \neq b} N _ {a b} (1 - t) \left(\sum_ {c} \hat {\pi} _ {c} (z) \mathrm {D} _ {t} \left(f _ {a c} \| f _ {b c}\right) + \frac {1}{n} \mathrm {D} _ {t} \left(h _ {a} \| h _ {b}\right)\right) \\ = n \left(1 - \frac {m}{n \min _ {c} \hat {\pi} _ {c} (z)}\right) \sum_ {a \neq b} N _ {a b} \mathrm {C H} _ {t} (a, b, \hat {\pi} (z)). \\ \end{array}
$$
Using the concentration of  $\hat{z}$ , we have  $\hat{\pi}_c(z) = (1 + o(1))\pi_c$  for all  $c$ , and hence
$$
\sup  _ {t \in (0, 1)} \left(1 - t\right) \mathrm {D} _ {t} \left(P _ {z ^ {\prime}} \| P _ {z}\right) \geq (1 + o (1)) \left(1 - \frac {m}{n \pi_ {\min }}\right) m n I,
$$
where we used  $\sum_{a\neq b}N_{ab} = m$  and  $I\leq \mathrm{CH}(a,b,\hat{\pi} (\hat{z}))$ . The first upper bound on  $\mathbb{P}_z(L(z'))\geq L(z))$  follows by taking  $\epsilon = 0$  and the supremum over  $t\in (0,1)$  in (A.2).
Finally, let  $d = \sup_{t\in (0,1)}\min_{\substack{a\neq b\in [K]\\ c\in [K]}}(1 - t)\mathrm{D}_t(f_{ac}\| f_{bc})$ . Combining (A.3) and (A.4) leads to
$$
\sup  _ {t \in (0, 1)} (1 - t) \mathrm {D} _ {t} \left(P _ {z} \| P _ {z ^ {\prime}}\right) \geq d \sum_ {a \neq b} N _ {a b} \sum_ {c} N _ {c c} = d m (n - m),
$$
and this ends the proof.
A.2.2 Lower bound
We now focus on lower-bounding  $\mathbb{P}_z(L(z) \geq L(z'))$  when  $\mathrm{Ham}(z, z') = 1$ . In particular, the condition  $\mathrm{Ham}(z, z') = 1$  implies that there exists a unique node  $u \in [n]$  such that  $z_u \neq z_u'$ . Let  $a, b \in [K]$  such that  $z_u = a$  and  $z_u' = b$ . By definition of the likelihood, we have  $L(z) - L(z') = \Delta_{ub}(X, Y, z)$  where
$$
\Delta_{ub}(X,Y,z) = \sum_{\substack{v = 1\\ v\neq u}}^{n}\log \frac{f_{bz_{v}}}{f_{az_{v}}} (X_{uv}) + \log \frac{h_{b}}{h_{a}} (Y_{u}). \tag{A.5}
$$
Before studying the large deviation rates of likelihood ratios such as  $\mathbb{P}_z(\Delta_{ub} > 0)$  and  $\mathbb{P}_z(\Delta_{ub} > 0, \Delta_{vb} > 0)$ , we first recall some large deviation result for arbitrary sequences of random variables [30, 10].
Proposition 1 (Strong large deviations for arbitrary sequences of random variables - Theorem 3.3 of [10]). Let  $T_{n}$  be a sequence of random variables whose moment generating function  $\phi_n(t) = \mathbb{E}\left[e^{tT_n}\right]$  is non-vanishing and analytic in the region  $\Omega = \{z\in \mathbb{C}:|z| < a\}$  for some  $a > 0$ . Let  $k_{n}$  be a sequence of real numbers, and let  $\psi_{n}(t) = k_{n}^{-1}\log \phi_{n}(t)$ . Let  $(m_{n})$  be a bounded sequence of real numbers such that there exists a sequence  $(\tau_{n})$  verifying  $\psi_n^\prime (\tau_n) = m_n$  and  $0 < \tau_{n} < \alpha_{0} < \alpha$ . Suppose that:
1. there exists  $b > 0$  such that  $|\psi_n(z)| \leq b$  for all  $z \in \Omega$ ;
2. there exists  $a > 0$  such that  $\psi_n''(\tau_n) > c$ ;
3. there exists  $\delta_0 > 0$  such that  $\sup_{\delta < |t| < \lambda \tau_n} \left| \frac{\phi_n(\tau_n + it)}{\phi_n(\tau_n)} \right| = o(k_n^{-1/2})$  for any given  $\delta, \lambda$  such that  $0 < \delta < \delta_0 < \lambda$ .
$$
\mathbb {P} \left(T _ {n} > a _ {n} m _ {n}\right) = \frac {1 + o (1)}{\tau_ {n} \sqrt {2 \pi a _ {n} \psi^ {\prime \prime} (\tau_ {n})}} e ^ {- a _ {n} (m _ {n} \tau_ {n} - \psi_ {n} (\tau_ {n}))}.
$$
Proposition 1 is an extension of Cramer's large deviation theorem for sums of iid r.v. to sequences of arbitrary random variables (see [10, Remark 3.6]). We will apply it to the study of  $\mathbb{P}\left(\Delta_{ub} > 0\right)$ .
Lemma 4. Let  $z \in \mathcal{Z}_{\xi}$  (where  $\mathcal{Z}_{\xi}$  is defined in (A.1)) with  $\xi = o(1)$ . Let  $u \in [n]$  such that  $z_{u} = a$  and let  $\Delta_{ub}$  be given in (A.5). Suppose that there exists  $\delta_{n} = \omega(1)$  such that  $\beta: t \in (0,1) \mapsto -\lim_{n \to \infty} n\delta_{n}^{-1}\mathrm{CH}_{t}(a,b)$  exists and is strictly convex. Then, for any sequence  $\epsilon_{n}$  such that  $\delta_{n}\epsilon_{n} \to \epsilon \in \{\beta'(t), t \in (0,1)\}$  we have
$$
\mathbb {P} _ {z} \left(\Delta_ {u b} > \delta_ {n} \epsilon_ {n}\right) \sim \frac {1}{t _ {\epsilon} \sqrt {2 \pi \delta_ {n} \beta^ {\prime \prime} (t _ {\epsilon})}} e ^ {- \delta_ {n} \beta^ {*} (t _ {\epsilon})},
$$
where  $\beta^{*}(x) = \sup_{t > 0}\{tx - \beta (t)\}$  is the Legendre transform of  $\beta$ , and  $t_\epsilon$  is such that  $\beta^{\prime}(t_{\epsilon}) = \epsilon$ . In particular  $0\in \{\beta '(t),t\in (0,1)\}$ , and therefore for any sequence  $\epsilon_{n} = o(\delta_{n}^{-1})$  we have
$$
\mathbb {P} _ {z} \left(\Delta_ {u b} > \delta_ {n} \epsilon_ {n}\right) \sim \frac {1}{t _ {0} \sqrt {2 \pi \delta_ {n} \beta^ {\prime \prime} (t _ {0})}} e ^ {- n \mathrm {C H} (a, b)}.
$$
Proof of Lemma 4. We will apply Proposition 1 with  $\Omega = \{z\in \mathbb{C}\colon |z| < 1\}$  and  $k_{n} = \delta_{n}^{-1}$  to obtain the stated results.
Let us first compute  $\phi_n(t) = \mathbb{E}_z\left[e^{t\Delta_{ub}}\right]$  and  $\psi_n(t) = \delta_n^{-1}\log \phi_n(t)$  for  $t\in (0,1)$ . We first notice that for all  $v\in [n]$ ,
$$
\mathbb {E} _ {z} \left[ e ^ {t \log \frac {f _ {b z _ {v}}}{f _ {a z _ {v}}} (X _ {u v})} \right] = \mathbb {E} \left[ \left(\frac {f _ {b z _ {v}}}{f _ {a z _ {v}}}\right) ^ {t} (X _ {u v}) \right] = e ^ {- (1 - t) \mathrm {D} _ {t} (f _ {b z _ {v}} \| f _ {a z _ {v}})},
$$
by definition of the Rényi divergence. Similar computations show that
$$
\mathbb {E} _ {z} \left[ e ^ {t \log \frac {h _ {b}}{h _ {a}} (Y _ {u})} \right] = e ^ {- (1 - t) \mathrm {D} _ {t} (h _ {b} \| h _ {a})}.
$$
$$
\phi_ {n} (t) = e ^ {t \log \frac {\pi_ {b}}{\pi_ {a}} - n \mathrm {C H} _ {t} (a, b, z)},
$$
$$
\mathrm {C H} _ {t} (a, b, z) = (1 - t) \left[ \sum_ {c = 1} ^ {K} \hat {\pi} _ {c} \mathrm {D} _ {t} \left(f _ {b c} \| f _ {a c}\right) + \frac {1}{n} \mathrm {D} _ {t} \left(h _ {b} \| h _ {a}\right) \right], \tag {A.6}
$$
with  $\hat{\pi}_c = n^{-1}\left|z^{-1}(k)\right|$ . We note that since  $z\in \mathcal{Z}_{\xi}$  we have  $\mathrm{CH}_t(a,b,z) = (1 + O(\xi))\mathrm{CH}_t(a,b)$ .
Thus,  $\psi_n(t) = -(1 + o(1))n\mathrm{CH}_t(a,b)$ . Moreover, the assumption  $\mathrm{CH}(a,b) = \Theta (n^{-1}\delta_n)$  implies
that  $\mathrm{CH}_t(a,b) = \Theta (n^{-1}\delta_n)$  for all  $t\in (0,1)$  since the Renyi divergences of orders  $t\in (0,1)$  are equivalent [35, Theorem 16]. Hence,  $\delta_{n}^{-1}\psi_{n}(t) = (1 + o(1))\beta (t)$ . Since  $\beta$  is well-defined and strictly convex on  $(0,1)$ , this ensures that Assumptions 1 and 2 of Proposition 1 are verified. Moreover, we notice that  $e^{\beta (t)}$  is the m.g.f of some r.v.  $X$ , and let  $\varphi (t) = \mathbb{E}e^{itX}$  be the characteristic function of  $X$ . Then,  $\frac{\phi_n(t^* + it)}{\phi_n(t^*)} = \left(\frac{\varphi(t^* + it)}{\varphi(t^*)}\right)^{\delta_n}$ . Since  $\frac{\varphi(t^* + it)}{\varphi(t^*)}$  is the characteristic function of some r.v., its module is strictly less than 1 on an interval not containing 0, and hence Assumption 3 of Proposition 1 is verified.
Finally, Lemma 8 ensures that  $\beta'(0) \leq 0$  and  $\beta'(1) \geq 0$  and hence  $0 \in \{\beta'(t), t \in (0,1)\}$ .
A.2.3 Asymptotic independence
Finally, the following lemma shows that the events  $\Delta_{ub} > 0$  and  $\Delta_{vb} > 0$  are asymptotically independent.
Lemma 5. Let  $z\in \mathcal{Z}_{\xi}$ $u,v\in z^{-1}(a)$  , and  $b\in [K]\backslash \{a\}$  . Then,
$$
\frac {\mathbb {P} _ {z} \left(\Delta_ {u b} > 0 , \Delta_ {v b} > 0\right)}{\mathbb {P} _ {z} \left(\Delta_ {u b} > 0\right) \mathbb {P} _ {z} \left(\Delta_ {v b} > 0\right)} = 1 + o (1).
$$
Proof. Let  $\xi(X_{uv}) = \log \frac{f_{aa}}{f_{ab}}(X_{uv})$ . We have
$$
\Delta_{ub} = \log \frac{\pi_{b}}{\pi_{a}} +\sum_{\substack{w = 1\\ v\notin \{u,v\}}}^{n}\log \frac{f_{bz_{w}}}{f_{az_{w}}} (X_{uw}) + \log \frac{h_{b}}{h_{a}} (Y_{u}) + \log \frac{f_{ba}}{f_{aa}} (X_{uv}),
$$
$$
\Delta_{vb} = \log \frac{\pi_{b}}{\pi_{a}} +\sum_{\substack{w = 1\\ v\notin \{u,v\}}}^{n}\log \frac{f_{bz_{w}}}{f_{az_{w}}} (X_{vw}) + \log \frac{h_{b}}{h_{a}} (Y_{v}) + \log \frac{f_{ba}}{f_{aa}} (X_{uv}).
$$
$$
\Delta_ {u b} = U _ {u} - \xi \left(X _ {u v}\right) \quad \text {a n d} \quad \Delta_ {v b} = U _ {v} - \xi \left(X _ {u v}\right)
$$
where  $U_{u}$  and  $U_{v}$  are iid. Therefore,
$$
\mathbb {P} _ {z} \left(\Delta_ {u b} > 0, \Delta_ {v b} > 0\right) - \mathbb {P} _ {z} \left(\Delta_ {u b} > 0\right) \mathbb {P} _ {z} \left(\Delta_ {v b} > 0\right) = \operatorname {C o v} _ {z} \left(1 \left(\Delta_ {u b} > 0\right), 1 \left(\Delta_ {v b} > 0\right). \right.
$$
Conditioning on  $U_{u}$  and  $U_{v}$ , we observe that
$$
\operatorname {C o v} _ {z} (1 (\Delta_ {u b} > 0), 1 (\Delta_ {v b} > 0) = \iint \operatorname {C o v} _ {z} \left(\phi_ {u} (\xi), \phi_ {u ^ {\prime}} (\xi)\right) \mu (d u) \mu (d u ^ {\prime}),
$$
where  $\phi_t(\xi) = 1 (t > \xi)$  and  $\mu = \mathrm{Law}(\xi)$ . Because  $\phi_u$  and  $\phi_{u'}$  are monotonous, the Fortuin-Kasteleyn-Ginibre (FKG) inequality [20, 17] (see also [19, Section 2.2]) implies that  $\mathrm{Cov}(\phi_u(\xi), \phi_{u'}(\xi)) \geq 0$ . Therefore,
$$
\frac {\mathbb {P} _ {z} \left(\Delta_ {u b} > 0 , \Delta_ {v b} > 0\right)}{\mathbb {P} _ {z} \left(\Delta_ {u b} > 0\right) \mathbb {P} _ {z} \left(\Delta_ {v b} > 0\right)} \geq 1.
$$
Let us now derive an upper bound for this ratio. First, Lemma 4 with  $\epsilon_{n} = 0$  and  $\delta_n = \log n$  implies
$$
\mathbb {P} \left(\Delta_ {u b} > 0\right) = \frac {1 + o (1)}{t ^ {*} \sqrt {2 \pi \log n \beta^ {\prime \prime} (t ^ {*})}} e ^ {- n \mathrm {C H} (a, b)},
$$
and the same relation holds for  $\mathbb{P}(\Delta_{vb} > 0)$ . Moreover, conditionally on  $X_{uv}$  we have
$$
\mathbb {P} _ {z} \left(\Delta_ {u b} > 0, \Delta_ {v b} > 0\right) = \int_ {x \in \mathcal {X}} (\gamma (x)) ^ {2} f _ {a a} (x) d x,
$$
where  $\gamma (x) = \mathbb{P}_z(U > \xi (x))$ . Since  $\mathrm{CH}_t(a,b) = o(1)$ , then  $f_{ac}$  and  $f_{bc}$  are mutually contiguous for all  $c$  (see [35, Theorem 25]). In particular, this implies that  $\xi (x) < \infty$  for all  $x\in \mathcal{X}$  such that
4Let  $(p_n)$  and  $(q_{n})$  be two sequences of distributions. Then  $p_n$  is contiguous with respect to  $q_{n}$  if for all sequence of event  $\mathcal{A}_n$  such that  $q_{n}(\mathcal{A}_{n}) = o(1)$  we also have  $p_n(\mathcal{A}_n) = o(1)$
$f_{aa}(x) > 0$ . Thus, we can apply Lemma 4 with  $\epsilon_n = \xi(x)$  and  $\delta_n = \log n$ , verifying  $\delta_n \epsilon_n \to 0$  to obtain
$$
\gamma (x) = \frac {1 + o (1)}{t ^ {*} \sqrt {2 \pi \log n \beta^ {\prime \prime} (t ^ {*})}} e ^ {- n \mathrm {C H} (a, b)},
$$
A.3 Impossibility of exact recovery
For  $a, b \in [K]$  two block indexes, we recall the quantity  $\mathrm{CH}(a, b)$  defined in (3.2) of the main text denotes the hardness to distinguish a node in block  $a$  from a node in block  $b$ . We suppose that  $I = \min_{a \neq b} \mathrm{CH}(a, b) = \Theta\left(\frac{\log n}{n}\right)$  with  $\lim_{n \to \infty} \frac{n}{\log n} I < 1$ . We prove the failure of the MAP estimator for exact recovery in three steps:
(i) We start by showing that we can restrict the study to the node labelling vector  $z$  for which the relative size of the communities are close to their expectations, i.e.,  $\frac{|z^{-1}(a)|}{n} = (1 + o(1))\pi_a$  for all  $a \in [K]$ ;
(ii) Let  $M_{ab}(z)$  be the number of nodes in block  $a$  for which changing their community label to block  $b$  results in an increase of likelihood. We show that  $\mathbb{E}M_{ab}(z) \gg 1$  when  $a, b$  are the two hardest blocks to distinguish.
(iii) We show that  $M_{ab}(z) > 0$  almost surely using the second-moment method.
(i) Conditioning on well-behaving community sizes. Recall the definition of  $\mathcal{Z}_{\xi}$  in (A.1). We established in Section A.1 that  $\mathbb{P}(\mathcal{Z}_{\xi}) = 1 - o(1)$  for  $\xi = \frac{\log\log n}{\sqrt{n}}$ . Hence,
$$
\begin{array}{l} \mathbb {P} (\text {M A P f a i l s}) = \sum_ {z \in \mathcal {Z}} \mathbb {P} _ {z} (z ^ {\text {M A P}} \neq z) \mathbb {P} (z) \\ \geq \sum_ {z \in \mathcal {Z} _ {\xi}} \mathbb {P} _ {z} (z ^ {\mathrm {M A P}} \neq z) \mathbb {P} (z) \\ \geq \mathbb {P} \left(\mathcal {Z} _ {\xi}\right) \inf  _ {z \in \mathcal {Z} _ {\xi}} \mathbb {P} _ {z} \left(z ^ {\mathrm {M A P}} \neq z\right) \\ \geq \left(1 - o (1)\right) \inf  _ {z \in \mathcal {Z} _ {\xi}} \mathbb {P} _ {z} \left(z ^ {\operatorname {M A P}} \neq z\right). \\ \end{array}
$$
The rest of the proof is devoted to show that  $\mathbb{P}_z\left(z^{\mathrm{MAP}}\neq z\right) = 1 - o(1)$  for all  $z\in \mathcal{Z}_{\xi}$ .
(ii) Expected number of bad nodes. Given a block structure  $z \in \mathcal{Z}_{\xi}$ , an arbitrary node  $u \in [n]$  such that  $z_{u} = a$  and a block  $b \neq a$ . We define by  $\tilde{z}$  the block structure obtained from  $z$  by swapping the block of node  $u$  to  $b$ , i.e.,
$$
\forall v \in [ n ] \colon \tilde {z} _ {v} = (1 - \delta_ {v u}) z _ {v} + \delta_ {v u} b.
$$
Suppose that  $X, Y$  are generating from a true block structure  $z$ , and let
$$
\Delta_ {u b} (X, Y, z) = \log \mathbb {P} (\tilde {z} | X, Y) - \log \mathbb {P} (z | X, Y) \tag {A.7}
$$
the change in the MAP estimation of  $z$  obtained by swapping the label of node  $u$  from its true block  $a$  to a wrong block  $b$ . By the definition of  $\tilde{z}$ , we have using Bayes' law
$$
\begin{array}{l} \Delta_ {u b} (X, Y, z) = \log \left(\frac {\mathbb {P} \left(z _ {u} = b \mid X , Y , z _ {- u}\right)}{\mathbb {P} \left(z _ {u} = a \mid X , Y , z _ {- u}\right)}\right) \\ = \log \left(\frac {\pi_ {b} \mathbb {P} (X , Y \mid z _ {- u} , z _ {u} = b)}{\pi_ {a} \mathbb {P} (X , Y \mid z _ {- u} , z _ {u} = a)}\right). \\ \end{array}
$$
$$
\begin{array}{l} \log \mathbb {P} (X, Y \mid z _ {- u}, z _ {u} = b) = \sum_ {1 \leq v <   w \leq n} \log f _ {z _ {v} z _ {w}} (X _ {v w}) + \sum_ {v = 1} ^ {n} \log h _ {z _ {v}} (Y _ {v}) \\ = \sum_{\substack{v = 1\\ v\neq u}}^{n}\log f_{bz_{v}}(X_{uv}) + \log h_{b}(Y_{u}) + C \\ \end{array}
$$
where  $C$  does not depend on  $b$ . Hence
$$
\Delta_{ub}(X,Y,z) = \log \frac{\pi_{b}}{\pi_{a}} +\sum_{\substack{v = 1\\ v\neq u}}^{n}\log \frac{f_{bz_{v}}}{f_{az_{v}}} (X_{uv}) + \log \frac{h_{b}}{h_{a}} (Y_{u}).
$$
The number of nodes in block  $a$  for which updating the label to  $b$  would cause the change of likelihood to be strictly positive is given by
$$
M _ {a b} (z) = \sum_ {u \in z ^ {- 1} (a)} 1 \left(\Delta_ {u b} (X, Y, z) > 0\right).
$$
In the following, we select  $a, b$  as the indexes of the two hardest blocks to distinguish. Hence,  $I = \mathrm{CH}(a, b, \pi, f, h)$  and we have using Lemma 4 that
$$
\mathbb {E} _ {z} M _ {a b} (z) \sim \pi_ {a} n e ^ {- (1 + o (1)) n \mathrm {C H} (a, b, \hat {\pi}, f, g)}.
$$
Since  $z \in \mathcal{Z}_{\xi}$  we have that  $\mathrm{CH}(a, b, \hat{\pi}, f, h) = (1 + o(1))I$ . Moreover, by assumption  $I < (1 - \epsilon)\frac{\log n}{n}$  for some  $\epsilon > 0$  and for any  $n$  large enough. Hence  $\mathbb{E}_z M_{ab}(z) \gg 1$ .
(iii) Conclusion. We will conclude that  $M_{ab}(z) > 0$  almost surely using the second-moment method. Denote by  $\alpha = \mathbb{P}_z(\Delta_{ub} > 0)$  and  $\beta = \mathbb{P}(\Delta_{ub} > 0, \Delta_{vb} > 0)$  for two arbitrary distinct nodes  $u, v \in z^{-1}(a)$ . We have  $\mathbb{E}_z M_{ab} = |z^{-1}(k)| \alpha$  and
$$
\begin{array}{l} \operatorname {V a r} _ {z} M _ {a b} = \sum_ {u, v \in z ^ {- 1} (a)} \operatorname {C o v} \left(1 \left(\Delta_ {u \ell} > 0\right), 1 \left(\Delta_ {v \ell} > 0\right)\right) \\ = \left| z ^ {- 1} (a) \right| \left(\alpha - \alpha^ {2}\right) + \left| z ^ {- 1} (a) \right| \left(\left| z ^ {- 1} (a) \right| - 1\right) (\beta - \alpha^ {2}) \\ \leq \mathbb {E} _ {z} M _ {a b} + (\mathbb {E} _ {z} M _ {a b}) ^ {2} \frac {\beta - \alpha^ {2}}{\alpha^ {2}}. \\ \end{array}
$$
Hence, the second-moment method implies that
$$
\mathbb {P} _ {z} (M _ {a b} = 0) \leq \frac {\operatorname {V a r} _ {z} M _ {a b}}{(\mathbb {E} _ {z} M _ {a b}) ^ {2}} \leq \frac {1}{\mathbb {E} _ {z} M _ {a b}} + \frac {\beta}{\alpha^ {2}} - 1.
$$
We end the proof using Lemma 5.
A.4 Possibility of exact recovery
To show that the MAP estimator achieves exact recovery up to the desired threshold, we need to show that there is no possibility of reducing the likelihood by swapping  $m$  vertices from each community. In all the following, we recall that  $z$  denotes the true community labelling, and for any  $z' \in [K]$  we denote by  $L(z') = \mathbb{P}(X, Y \mid z')$  the likelihood of labelling  $z'$ . For any  $m \geq 1$ , let us denote the set of node-labelling at a distance  $m$  of  $z$  by
$$
\Gamma_ {m} = \left\{z ^ {\prime} \in \mathcal {Z}: \operatorname {l o s s} \left(z, z ^ {\prime}\right) = m \right\}. \tag {A.8}
$$
The probability that there exists a labelling  $z' \in \Gamma_m$  with higher likelihood than  $z$  is
$$
P _ {m} = \mathbb {P} _ {z} \left(\exists z ^ {\prime} \in \Gamma_ {m} \colon L \left(z ^ {\prime}\right) \geq L (z)\right).
$$
Let  $\hat{z}$  be the block labelling estimated by the MAP. Lemma 7 ensures that  $|\Gamma_m| = 0$  if  $m \geq n\frac{K - 1}{K}$ . Thus, we have, using union bounds,
$$
\mathbb {P} _ {z} \left(\mathrm {l o s s} \left(z, \hat {z}\right) \geq 1\right) \leq \sum_ {m = 1} ^ {\frac {2 K - 1}{2 K}} \left| \Gamma_ {m} \right| \max _ {z ^ {\prime} \in \Gamma_ {m}} \mathbb {P} _ {z} \left(L \left(z ^ {\prime}\right) \geq L (z)\right).
$$
Moreover, [39, Proposition 5.2] show that
$$
\left| \Gamma_ {m} \right| \leq \min  \left\{\left(\frac {e n K}{m}\right) ^ {m}, K ^ {n} \right\},
$$
while Lemma 3 provides an upper bound on  $\max_{z' \in \Gamma_m} \mathbb{P}_z(L(z') \geq L(z))$ . Combining these upper bounds ensure that for some sequence  $\eta = o(1)$ , we have
$$
\mathbb {P} _ {z} (\operatorname {l o s s} (z, \hat {z}) \geq 1) \leq \sum_ {m = 1} ^ {n \frac {2 K - 1}{2 K}} \left(s _ {m}\right) ^ {m}, \tag {A.9}
$$
where  $s_m = \frac{enK}{m}\min \left(e^{-(1 - \eta)\left(1 - \frac{m}{n\pi_{\mathrm{min}}}\right)nI};e^{-(n - m)d}\right)$  with  $d = \sup_{t\in (0,1)}\min_{\substack{a\neq b\in [K]\\ c\in [K]}}(1-$ $t)\mathrm{D}_t(f_{ac}\| f_{bc})$
Let  $\epsilon > 0$  such that  $I > (1 + \epsilon)\frac{\log n}{n}$ . We will now show that the sum on the right-hand side of Equation (A.9) goes to zero, by considering the cases (i)  $m \leq \frac{\pi_{\min}}{2} n$  and (ii)  $\frac{\pi_{\min}}{2} n \leq m \leq \frac{1}{2} n$ .
(i) First of all, suppose that  $m \leq \frac{\pi_{\min}}{2} n$ . Then,
$$
\begin{array}{l} s _ {m} \leq \frac {e K}{n ^ {\epsilon (1 - \eta) + \eta}} e ^ {(1 - \eta) (1 + \epsilon) \frac {m}{\pi_ {\mathrm {m i n}}} \frac {\log n}{n} - \log m} \\ \leq \frac {e K}{n ^ {\epsilon / 2}} e ^ {(1 + \epsilon) \frac {m}{\pi_ {\operatorname* {m i n}}} \frac {\log n}{n} - \log m}. \\ \end{array}
$$
Let  $f(m) = \frac{\log m}{m} - \frac{1 + \epsilon}{\pi_{\min}} \frac{\log n}{n}$ . We will show that  $f(m) \geq \frac{\log m}{2m}$  for  $m \geq 3$ . Indeed, for  $x \geq 3$ , the function  $x \mapsto \frac{\log x}{x}$  is decreasing. Therefore, for  $3 \leq m \leq \frac{\pi_{\min}}{2} n$  we have
$$
f (m) - \frac {\log m}{2 m} \geq \frac {1}{2} \frac {\log m}{m} - \frac {1 + \epsilon}{\pi_ {\min}} \frac {\log n}{n} \geq \frac {2}{\pi_ {\min}} \frac {\log n - \log (\pi_ {\min} / 2)}{n} - \frac {1 + \epsilon}{\pi_ {\min}} \frac {\log n}{n} > 0
$$
for  $n$  large enough. Hence  $s_m \leq eKn^{-\epsilon/2}e^{-\frac{1}{2}\log m}$  and  $\sum_{m=1}^{\frac{\pi_{\min}}{2}n} s_m^m = o(1)$ .
(ii) Next, suppose that  $\frac{1}{2}\pi_{\mathrm{min}}n\leq m\leq n\frac{K - 1}{K}$ . Then, the assumption  $D_{t}(f_{ac}\| f_{bc}) = \Theta \left(\frac{\log n}{n}\right)$  implies that  $d > \kappa \frac{\log n}{n}$  for some positive constant  $\kappa$ . Hence,
$$
s _ {m} \leq \frac {2 e K}{\pi_ {\mathrm {m i n}}} e ^ {- \frac {\kappa}{K} \log n},
$$
and thus  $\sum_{m = \frac{\pi_{\min}}{2} n}^{\frac{K - 1}{K} n}s_m^m = o(1).$
Hence, (A.9) shows that  $\mathbb{P}_z\left(\mathrm{loss}(z,\hat{z})\geq 1\right) = o(1)$ , and thus the MAP estimator exactly recovers the true community structure  $z$ .
A.5 Additional lemmas
Lemma 6. Let  $z, z' \in [K]^n$  and define for all  $a, b, c, d \in [K]$ :
$$
\begin{array}{l} A _ {a b} = | \{i \in [ n ] \colon (z _ {i}, z _ {i} ^ {\prime}) = (a, b) \} |, \\ M _ {(a b) (c d)} = \left| \left\{1 \leq i <   j \leq n: \left(z _ {i}, z _ {i} ^ {\prime}\right) = (a, b) a n d \left(z _ {j}, z _ {j} ^ {\prime}\right) = (c, d) \right\} \right|. \\ \end{array}
$$
$$
M _ {(a b) (c d)} = A _ {a b} \left(A _ {c d} - 1 _ {(a b) = (c d)}\right) = A _ {c d} \left(A _ {a b} - 1 _ {(a b) = (c d)}\right).
$$
Proof. Denote by  $C_a = z^{-1}(a)$  and  $C_a' = z'^{-1}(a)$ , and let  $C_{ab} = C_a \cap C_b'$ . Then,  $A_{ab} = |C_{ab}|$  and  $M_{(ab)(cd)} = |\{1 \leq i < j \leq n : i \in C_{ab} \text{ and } j \in C_{cd}\}|$ . This proves the lemma.
Lemma 7. For any  $z, z' \in [K]^n$ , we have  $\mathrm{loss}(z, z') \leq n(1 - \frac{1}{K})$ .
Proof. Without loss of generality, suppose that  $\mathrm{loss}(z,z) = \mathrm{Ham}(z,z^{\prime})$  (that is, the optimal permutation in the definition of the loss is simply the identity). For any  $a\in [K]$ , let us denote by  $C_a = z^{-1}(a)$ ,  $C_a^\prime = z^{-1}(b)$ . The confusion matrix of the two node labellings is the  $K$ -by- $K$  matrix having entries  $N_{ab} = |C_a\cap C_b|$ . In particular, we have  $n = \sum_{a,b}N_{ab}$  and
$$
\begin{array}{l} \operatorname {loss}(z,z^{\prime}) = \sum_{a = 1}^{K}\sum_{\substack{b = 1\\ b\neq a}}^{K}N_{ab} \\ = n - \sum_ {a} N _ {a a}. \\ \end{array}
$$
[5, Lemma B.2] show that  $N_{ab} \leq N_{aa} + N_{bb} - N_{ba}$ , and therefore
$$
\left. \operatorname {l o s s} \left(z, z ^ {\prime}\right) \leq \sum_ {a = 1} ^ {K} \sum_ {\substack {b = 1 \\ b \neq a}} ^ {K} \left(N _ {a a} + N _ {b b} - N _ {b a}\right). \right. \tag{A.10}
$$
We notice that
$$
\sum_ {a} \sum_ {b \neq a} N _ {a a} = (K - 1) \sum_ {a} N _ {a a} = (K - 1) (n - \operatorname {l o s s} (z, z ^ {\prime})),
$$
$$
\sum_ {a} \sum_ {b \neq a} N _ {b b} = \sum_ {a} \left(\sum_ {b} N _ {b b} - N _ {a a}\right) = (K - 1) (n - \operatorname {l o s s} (z, z ^ {\prime})).
$$
Finally,  $\sum_{a}\sum_{b\neq a}N_{ba} = \mathrm{loss}(z,z^{\prime})$  . Thus, going back to (A.10) leads to
$$
\operatorname {l o s s} (z, z ^ {\prime}) \leq 2 (K - 1) n - (2 K - 1) \operatorname {l o s s} (z, z ^ {\prime}),
$$
Lemma 8. Let  $f, g$  be two probability distributions and denote  $c(t) = (1 - t)\mathrm{D}_t(f\| g)$  the Chernoff coefficient of order  $t$  between  $f$  and  $g$ . We have  $c'(0) = -\mathrm{d}_{\mathrm{KL}}(g\| f)$  and  $c'(1) = \mathrm{d}_{\mathrm{KL}}(f\| g)$ .
Proof. From  $c(t) = \log \int f^t g^{1 - t}$ , we notice that  $c'(t) = \frac{\int f^t g^{1 - t} \log \frac{f}{g}}{\int f^t g^{1 - t}}$ , and the result follows.
Proof of Lemma 1. Using a Taylor expansion, we have
$$
\begin{array}{l} (1 - t) \mathrm {D} _ {t} (f _ {a c} \| f _ {b c}) = \log \left[ (1 - p _ {a c}) ^ {t} (1 - p _ {b c}) ^ {1 - t} + p _ {a c} ^ {t} p _ {b c} ^ {1 - t} \int (\tilde {f} _ {a b}) ^ {t} (\tilde {f} _ {b c}) ^ {1 - t} \right] \\ = t p + (1 - t) q - p ^ {t} q ^ {1 - t} \int \left(\tilde {f} _ {a c}\right) ^ {t} \left(\tilde {f} _ {b c}\right) ^ {1 - t} + o (\delta), \\ \end{array}
$$
and we finish the proof using  $\int (\tilde{f}_{ac})^t (\tilde{f}_{bc})^{1 - t} = e^{-J_{\psi}(\theta_{ab}\| \theta_{bc})}$  and  $(1 - t)\mathrm{D}_t(h_a\| h_b) = J_\phi (\eta_a\| \eta_b)$  (see for example [28]).
C Additional numerical results
We present in Table 2 and 3 the numerical results that are drawn in Figure (4a) and (4b), respectively. We observe that the variance of Algorithm 1 is very low, while all other algorithms (excepted EM-GMM) exhibit a very large variance.
Table 2: Average ARI of the different algorithms over 60 trials with standard deviation in brackets obtained for Figure (4a).