SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} \mathbb {E} \left[ | \Delta_ {2} | ^ {q} \mid Z _ {1}, \dots , Z _ {n} \right] \\ \leq \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ | \mathbf {E} _ {1 1} | ^ {q} \right] \max  _ {v \in \mathcal {Z}} \| \mathbf {S} (v) \| _ {\mathrm {o p}} ^ {q} \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ \| \mathbf {X} (Z _ {i}) \| ^ {q} \mid Z _ {1}, \dots , Z _ {n} \right] \\ = \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ | \mathbf {E} _ {1 1} | ^ {q} \right] \max  _ {v \in \mathcal {Z}} \| \mathbf {S} (v) \| _ {\mathrm {o p}} ^ {q} \mathbb {E} \left[ \left(\frac {1}{p} \sum_ {k = 1} ^ {p} | X _ {k} (Z _ {j}) | ^ {2}\right) ^ {q / 2} \Bigg | Z _ {1}, \dots , Z _ {n} \right] \\ \leq \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ | \mathbf {E} _ {1 1} | ^ {q} \right] \max  _ {v \in \mathcal {Z}} \| \mathbf {S} (v) \| _ {\mathrm {o p}} ^ {q} \mathbb {E} \left[ \frac {1}{p} \sum_ {k = 1} ^ {p} | X _ {k} (Z _ {j}) | ^ {q} \middle | Z _ {1}, \dots , Z _ {n} \right] \\ \leq \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ \left| \mathbf {E} _ {1 1} \right| ^ {q} \right] \max  _ {v \in \mathcal {Z}} \| \mathbf {S} (v) \| _ {\mathrm {o p}} ^ {q} \sup  _ {k \geq 1} \max  _ {v \in \mathcal {Z}} \mathbb {E} \left[ | X _ {k} (v) | ^ {q} \right] \tag {24} \\ \end{array}
$$
where the second inequality holds by Jensen's inequality (recall  $q \geq 2$ ). Since the r.h.s. of (24) does not depend on  $i$  or  $j$ , the same bound holds with  $\Delta_2$  on the l.h.s. replaced by  $\Delta_3$ .
Turning to  $\Delta_4$ , we have
$$
\Delta_ {4} := \frac {1}{p} \left\langle \mathbf {S} (Z _ {i}) \mathbf {E} _ {i}, \mathbf {S} (Z _ {j}) \mathbf {E} _ {j} \right\rangle = \frac {1}{p} \sum_ {1 \leq k, \ell \leq p} \Delta_ {4, k, \ell}, \quad \Delta_ {4, k, \ell} := \mathbf {E} _ {i k} \mathbf {E} _ {j \ell} [ \mathbf {S} (Z _ {i}) ^ {\top} \mathbf {S} (Z _ {j}) ] _ {k \ell}.
$$
Noting that  $i \neq j$ , and that the elements of  $\mathbf{E}_i$  and  $\mathbf{E}_j$  are independent, identically distributed, and mean zero, we see that  $\Delta_4$  is a sum of  $p^2$  random variables which are all conditionally mean zero and conditionally independent given  $Z_1, \ldots, Z_n$ . The Marcinkiewicz-Zygmund inequality gives:
$$
\mathbb {E} \left[ | \Delta_ {4} | ^ {q} \mid Z _ {1}, \dots , Z _ {n} \right] \leq C _ {2} (q) \mathbb {E} \left[ \left| \frac {1}{p ^ {2}} \sum_ {1 \leq k, \ell \leq s} ^ {p} | \Delta_ {4, k, \ell} | ^ {2} \right| ^ {q / 2} \mid Z _ {1}, \dots , Z _ {n} \right]. \tag {25}
$$
Applying Minkowski's inequality to the r.h.s. of (25),
$$
\begin{array}{l} \mathbb {E} \left[ \left| \frac {1}{p ^ {2}} \sum_ {1 \leq k, \ell \leq p} | \Delta_ {4, k, \ell} | ^ {2} \right| ^ {q / 2} \right| Z _ {1}, \dots , Z _ {n} \bigg ] ^ {2 / q} \\ \leq \frac {1}{p ^ {2}} \sum_ {1 \leq k, \ell \leq p} \mathbb {E} \left[ | \Delta_ {4, k, \ell} | ^ {q} \mid Z _ {1}, \dots , Z _ {n} \right] ^ {2 / q} \\ = \frac {1}{p ^ {2}} \sum_ {1 \leq k, \ell \leq p} \mathbb {E} \left[ \right. | \mathbf {E} _ {i k} | ^ {q} | \mathbf {E} _ {j \ell} | ^ {q} \left| [ \mathbf {S} (Z _ {i}) ^ {\top} \mathbf {S} (Z _ {j}) ] _ {k \ell} \right| ^ {q} \left. \right\rvert   Z _ {1}, \dots , Z _ {n} \left. \right] ^ {2 / q} \\ = \frac {1}{p ^ {2}} \mathbb {E} \left[ | \mathbf {E} _ {1 1} | ^ {q} \right] ^ {4 / q} \sum_ {1 \leq k, \ell \leq p} \left| [ \mathbf {S} (Z _ {i}) ^ {\top} \mathbf {S} (Z _ {j}) ] _ {k \ell} \right| ^ {2} \\ \leq \frac {1}{p ^ {2}} \mathbb {E} \left[ | \mathbf {E} _ {1 1} | ^ {2 q} \right] ^ {2 / q} \max  _ {u, v \in \mathcal {Z}} \| \mathbf {S} (u) ^ {\top} \mathbf {S} (v) \| _ {\mathrm {F}} ^ {2}, \\ \end{array}
$$
where the final inequality holds by Jensen's inequality. Substituting back into (25) and using  $\| \mathbf{S}(u)^{\top}\mathbf{S}(v)\|_{\mathrm{F}}\leq p^{1 / 2}\| \mathbf{S}(u)^{\top}\mathbf{S}(v)\|_{\mathrm{op}}\leq p^{1 / 2}\| \mathbf{S}(u)\|_{\mathrm{op}}\| \mathbf{S}(v)\|_{\mathrm{op}}$  we obtain:
$$
\mathbb {E} \left[ | \Delta_ {4} | ^ {q} \mid Z _ {1}, \dots , Z _ {n} \right] \leq C _ {2} (q) \frac {1}{p ^ {q / 2}} \mathbb {E} \left[ \left| \mathbf {E} _ {1 1} \right| ^ {2 q} \right] \max  _ {u \in \mathcal {Z}} \| \mathbf {S} (u) \| _ {\mathrm {o p}} ^ {2 q}. \tag {26}
$$
Combining (22), (24) and (26) using the fact that for  $a, b \geq 0$ ,  $(a + b)^q \leq 2^{q - 1}(a^q + b^q)$ , we find that there exists a constant  $C(q, \varphi)$  depending only on  $q$  and  $\varphi$  such that
$$
\begin{array}{l} \mathbb {E} \left[ \left| p ^ {- 1} \langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \rangle - \alpha (Z _ {i}, Z _ {j}) \right| ^ {q} \right\rvert   Z _ {1}, \dots , Z _ {n} \Bigg ] \\ \leq C (q, \varphi) \frac {1}{p ^ {q / 2}} M (q, \mathbf {X}, \mathbf {E}, \mathbf {S}), \\ \end{array}
$$
where  $M(q, \mathbf{X}, \mathbf{E}, \mathbf{S})$  is defined in the statement of the proposition and is finite by assumptions A4 and A5. By Markov's inequality, for any  $\delta \geq 0$ ,
$$
\mathbb {P} \left(\left| p ^ {- 1} \langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \rangle - \alpha \left(Z _ {i}, Z _ {j}\right) \right| \geq \delta \mid Z _ {1}, \dots , Z _ {n}\right) \leq \frac {1}{\delta^ {q}} C (q, \varphi) \frac {1}{p ^ {q / 2}} M (q, \mathbf {X}, \mathbf {E}, \mathbf {S}) \tag {27}
$$
and the proof is completed by a union bound:
$$
\begin{array}{l} \mathbb {P} \left(\max  _ {1 \leq i <   j \leq n} \left| p ^ {- 1} \left\langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \right\rangle - \alpha (Z _ {i}, Z _ {j}) \right| <   \delta \Bigg | Z _ {1}, \dots , Z _ {n}\right) \\ = \mathbb {P} \left(\bigcap_ {1 \leq i <   j \leq n} \left| p ^ {- 1} \langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \rangle - \alpha (Z _ {i}, Z _ {j}) \right| <   \delta \middle | Z _ {1}, \dots , Z _ {n}\right) \\ = 1 - \mathbb {P} \left(\bigcup_ {1 \leq i <   j \leq n} \left| p ^ {- 1} \left\langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \right\rangle - \alpha \left(Z _ {i}, Z _ {j}\right) \right| \geq \delta \mid Z _ {1}, \dots , Z _ {n}\right) \\ \geq 1 - \frac {n (n - 1)}{2} \frac {1}{\delta^ {q}} C (q, \varphi) \frac {1}{p ^ {q / 2}} M (q, \mathbf {X}, \mathbf {E}, \mathbf {S}). \\ \end{array}
$$
C.3 Interpretation of merge heights and exact tree recovery
Here we expand on the discussion in section 3.3 and provide further interpretation of merge heights and algorithm 1. In particular our aim is to clarify in what circumstances algorithm 1 will asymptotically correctly recover underlying tree structure. For ease of exposition throughout section C.3 we assume that  $\mathcal{Z}$  are the leaf vertices of  $\mathcal{T}$ .
As a preliminary we note the following corollary to theorem 1: assuming  $b > 0$ , if one takes as input to algorithm 1 the true merge heights, i.e. (up to bijective relabelling of leaf vertices)
$\hat{\alpha} (\cdot ,\cdot)\coloneqq m(\cdot ,\cdot) = \alpha (\cdot ,\cdot)$ , where  $n = |\mathcal{Z}|$ , then theorem 1 implies that algorithm 1 outputs a dendrogram  $\mathcal{D}$  whose merge heights  $\hat{m} (\cdot ,\cdot)$  are equal to  $m(\cdot ,\cdot)$  (up to bijective relabeling over vertices). This clarifies that with knowledge of  $m(\cdot ,\cdot)$ , algorithm 1) constructs a dendrogram which has  $m(\cdot ,\cdot)$  as its merge heights.
We now ask for more: if once again  $m(\cdot, \cdot)$  is taken as input to algorithm 1, under what conditions is the output tree  $\hat{\mathcal{T}}$  equal to  $\mathcal{T}$  (upto bijective relabelling of vertices)? We claim this holds when  $\mathcal{T}$  is a binary tree and that all its non-leaf nodes have different heights. We provide a sketch proof of this claim, since a complete proof involves many tedious and notationally cumbersome details.
To remove the need for repeated considerations of relabelling, suppose  $\mathcal{T} = (\mathcal{V},\mathcal{E})$  is given, then w.l.o.g. relabel the leaf vertices of  $\mathcal{T}$  as  $\{1\},\ldots,\{|Z|\}$  and relabel each non-leaf vertex to be the union of its children. Thus each vertex is some subset of  $[|Z|]$ .
Now assume that  $\mathcal{T}$  is a binary tree and that all its non-leaf nodes have different heights. Note that  $|\mathcal{V}| = 2|\mathcal{Z}| - 1$ , i.e., there are  $|\mathcal{Z}| - 1$  non-leaf vertices. The tree  $\mathcal{T}$  is uniquely characterized by a sequence of partitions  $\tilde{P}_0, \ldots, \tilde{P}_{|\mathcal{Z}| - 1}$  where  $\tilde{P}_0 := \{\{1\}, \ldots, |\mathcal{Z}|\}$ , and for  $m = 1, \ldots, |\mathcal{Z}| - 1$ ,  $\tilde{P}_m$  is constructed from  $\tilde{P}_{m - 1}$  by merging the two elements of  $\tilde{P}_{m - 1}$  whose most recent common ancestor is the  $m$ th highest non-leaf vertex (which is uniquely defined since we are assuming no two non-leaf vertices have equal heights).
To see that in this situation algorithm 1, with  $\hat{\alpha} (\cdot ,\cdot)\coloneqq m(\cdot ,\cdot)$  and  $n = |\mathcal{Z}|$  as input, performs exact recovery of the tree, i.e.,  $\tilde{T} = T$  , it suffices to notice that the sequence of partitions  $P_0,\ldots ,P_{|\mathcal{Z}| - 1}$  constructed by algorithm 1 uniquely characterizes  $\tilde{T}$  , and moreover  $(\tilde{P}_0,\dots ,\tilde{P}_{|\mathcal{Z}| - 1}) = (P_0,\dots ,P_{|\mathcal{Z}| - 1})$  . The details of this last equality involve simple but tedious substitutions of  $m(\cdot ,\cdot)$  in place of  $\hat{\alpha} (\cdot ,\cdot)$  in algorithm 1, so are omitted.
D Further details of numerical experiments and data preparation
All real datasets used are publicly available under the CC0: Public domain license. Further, all experiments were run locally on a laptop with an integrated GPU (Intel UHD Graphics 620).
D.1 Simulated data
For each  $v \in \mathcal{V}$ ,  $X_{1}(v), \ldots, X_{p}(v)$  are independent and identically distributed Gaussian random variables with:
$$
X _ {j} (1) \sim N (X _ {j} (6), 5),
$$
$$
X _ {j} (2) \sim N (X _ {j} (6), 2),
$$
$$
X _ {j} (3) \sim N (X _ {j} (6), 2),
$$
$$
X _ {j} (4) \sim N (X _ {j} (7), 0. 5),
$$
$$
X _ {j} (5) \sim N (X _ {j} (7), 7),
$$
$$
X _ {j} (6) \sim N (X _ {j} (8), 2),
$$
$$
X _ {j} (7) \sim N (X _ {j} (8), 1),
$$
$$
X _ {j} (8) \sim N (0, 1),
$$
for  $j = 1,\ldots ,p$
D.2 20 Newsgroups
The dataset originates from [29], however, the version used is the one available in the Python package 'scikit-learn' [38]. Each document is pre-processed in the following way: generic stopwords and e-mail addresses are removed, and words are lemmatised. The processed documents are then converted into a matrix of TF-IDF features. Labels can be found on the 20 Newsgroups website http://qwone.com/~jason/20Newsgroups/, but are mainly intuitive from the title of labels, with full stops separating levels of hierarchy. When using PCA a dimension of  $r = 34$  was selected by the method described in appendix A.
The following numerical results complement those in the main part of the paper.
Table 2: Kendall  $\tau_{b}$  ranking performance measure, for Algorithm 1 and the 20 Newsgroups data set. The mean Kendall  $\tau_{b}$  correlation coefficient is reported alongside the standard error (numerical value shown is the standard error  $\times 10^{3}$ ). This numerical results are plotted in figure 4 below.
Data	Input	p = 500	p = 1000	p = 5000	p = 7500	p = 12818
Newsgroups	Y1:n	0.026 (0.55)	0.016 (1.0)	0.13 (2.2)	0.17 (2.5)	0.26 (2.9)
ζ1:n	0.017 (0.72)	0.047 (1.2)	0.12 (1.9)	0.15 (2.5)	0.24 (2.6)
Performance of Alg. 1 for the 20 Newsgroups data, with  $n$  fixed and  $p$  varying
Figure 4: Performance of Algorithm 1 for the 20 Newsgroups data set as a function of number of TF-IDF features,  $p$ , with  $n$  fixed. See table 1 for numerical values and standard errors.
D.3 Zebrafish gene counts
These data were collected over a 24-hour period (timestamps available in the data), however, the temporal aspect of the data was ignored when selecting a sub-sample. To process the data, we followed the steps in [47] which are the standard steps in the popular SCANPY [50] - a Python package for analysing single-cell gene-expression data to process the data. This involves filtering out genes that are present in less than 3 cells or are highly variable, taking the logarithm, scaling and regressing out the effects of the total counts per cell. When using PCA a dimension of  $r = 29$  was selected by the method described in appendix A.
D.4 Amazon reviews
The pre-processing of this dataset is similar to that of the Newsgroup data except e-mail addresses are no longer removed. Some data points had a label of 'unknown' in the third level of the hierarchy, these were removed from the dataset. In addition, reviews that are two words or less are not included. When using PCA a dimension of  $r = 22$  was selected by the method described in appendix A.
D.5 S&P 500 stock data
This dataset was found through the paper [8] with the authors code used to process the data. The labels follow the Global Industry Classification Standard and can be found here: [3]. The return on day  $i$  of each stock is calculated by
$$
\mathrm {r e t u r n} _ {i} = \frac {p _ {i} ^ {c l} - p _ {i} ^ {o p}}{p _ {i} ^ {o p}},
$$
where  $p_i^{op}$  and  $p_i^{cl}$  is the respective opening and closing price on day  $i$ . When using PCA a dimension of  $r = 10$  was used as selected by the method described in appendix A.
D.6 Additional method comparison
Table 3 reports additional method comparison results, complementing those in table 1 which concerned only the average linkage function (noting UPGMA is equivalent to using the average linkage function with Euclidean distances). In table 3 we also compare to Euclidean and cosine distances paired with complete and single linkage functions. To aid comparison, the first column (average linkage with the dot product) is the same as in table 1. In general, using complete or single linkage performs worse for both Euclidean and cosine distances. The only notable exception being a slight improvement on the simulated dataset.
Table 3: Kendall  $\tau_{b}$  ranking performance measure. For the dot product method, i.e., algorithm 1,  $\mathbf{Y}_{1:n}$  as input corresponds to using  $\hat{\alpha}_{\mathrm{data}}$ , and  $\zeta_{1:n}$  corresponds to  $\hat{\alpha}_{\mathrm{pca}}$ . The mean Kendall  $\tau_{b}$  correlation coefficient is reported alongside the standard error (numerical value shown is the standard error  $\times 10^{3}$ ).
Data	Input	Average linkage Dot product	Complete linkage	Single linkage
Euclidean	Cosine	Euclidean	Cosine
Newsgroups	Y1:n	0.26 (2.9)	0.022 (0.87)	-0.010 (0.88)	-0.0025 (0.62)	-0.0025 (0.62)
ζ1:n	0.24 (2.6)	0.0041 (1.2)	0.036 (1.2)	-0.016 (2.0)	0.067 (1.5)
Zebrafish	Y1:n	0.34 (3.4)	0.15 (2.2)	0.24 (3.2)	0.023 (3.0)	0.032 (2.9)
ζ1:n	0.34 (3.4)	0.17 (2.0)	0.30 (3.4)	0.12 (2.8)	0.15 (3.2)
Reviews	Y1:n	0.15 (2.5)	0.019 (0.90)	0.023 (1.0)	0.0013 (0.81)	0.0013 (0.81)
ζ1:n	0.14 (2.4)	0.058 (1.5)	0.063 (1.8)	0.015 (1.2)	0.038 (1.0)
S&P 500	Y1:n	0.34 (10)	0.33 (10)	0.33 (10)	0.17 (10)	0.17 (10)
ζ1:n	0.36 (9.4)	0.32 (10)	0.31 (10)	0.36 (13)	0.39 (12)
Simulated	Y1:n	0.86 (1)	0.55 (8.7)	0.84 (2.0)	0.55 (8.7)	0.84 (2.0)
ζ1:n	0.86 (1)	0.55 (8.7)	0.84 (2.0)	0.55 (8.7)	0.84 (2.0)
Table 4: Kendall  $\tau_{b}$  ranking performance measure. The mean Kendall  $\tau_{b}$  correlation coefficient is reported alongside the standard error (numerical value shown is the standard error  $\times 10^{3}$ ).
Data	Input	UPGMA with dot product *dissimilarity*	UPGMA with Manhattan distance
Newsgroups	Y1:n	-0.0053 (0.24)	-0.0099 (1.3)
ζ1:n	0.0029 (0.33)	0.052 (1.6)
Zebrafish	Y1:n	0.0012 (0.13)	0.16 (2.4)
ζ1:n	0.00046 (0.12)	0.050 (2.8)
Reviews	Y1:n	-0.0005 (0.29)	0.0018 (0.44)
ζ1:n	-0.0015 (0.41)	0.061 (1.3)
S&P 500	Y1:n	0.0026 (7.7)	0.37 (9.4)
ζ1:n	0.0028 (7.5)	0.39 (11)
Simulated	Y1:n	-0.0026 (1.6)	0.55 (8.7)
ζ1:n	-0.0023 (1.8)	0.84 (2)
E Understanding agglomerative clustering with Euclidean or cosine distances in our framework
E.1 Quantifying dissimilarity using Euclidean distance
The first step of many standard variants of agglomerative clustering such as UPGMA and Ward's method is to find and merge the pair of data vectors which are closest to each other in Euclidean distance. From the elementary identity:
$$
\left\| \mathbf {Y} _ {i} - \mathbf {Y} _ {j} \right\| ^ {2} = \left\| \mathbf {Y} _ {i} \right\| ^ {2} + \left\| \mathbf {Y} _ {j} \right\| ^ {2} - 2 \langle \mathbf {Y} _ {i}, \mathbf {Y} _ {j} \rangle ,
$$
we see that, in general, this is not equivalent to finding the pair with largest dot product, because of the presence of the terms  $\| \mathbf{Y}_i\|^2$  and  $\| \mathbf{Y}_j\|^2$ . For some further insight in to how this relates to our
(a)  $m(a,d) <   m(c,d)\& d(a,d) > d(c,d)$
(b)  $m(a,d) <   m(c,d)\& d(a,d) <   d(c,d)$
Figure 5: Illustration of how maximising merge height  $m(\cdot, \cdot)$  may or may not be equivalent to minimising distance  $d(\cdot, \cdot)$ , depending on the geometry of the dendrogram. (a) Equivalence holds (b) Equivalence does not hold.
modelling and theoretical analysis framework, it is revealing to the consider the idealised case of choosing to merge by maximising merge height  $m(\cdot, \cdot)$  versus minimising  $d(\cdot, \cdot)$  (recall the identities for  $m$  and  $d$  established in lemma 1). Figure 5 shows two simple scenarios in which geometry of the dendrogram has an impact on whether or not maximising merge height  $m(\cdot, \cdot)$  is equivalent to minimising  $d(\cdot, \cdot)$ . From this example we see that, in situations where some branch lengths are disproportionately large, minimising  $d(\cdot, \cdot)$  will have different results to maximising  $m(\cdot, \cdot)$ .
UPGMA and Ward's method differ in their linkage functions, and so differ in the clusters they create in practice after their respective first algorithmic steps. UPGMA uses average linkage to combine Euclidean distances, and there does not seem to be a mathematically simple connection between this and algorithm 1, except to say that in general it will return different results. Ward's method merges the pair of clusters which results in the minimum increase in within-cluster variance. When clusters contain equal numbers of samples, this increase is equal to the squared Euclidean distance between the clusters' respective centroids.
E.2 Agglomerative clustering with cosine distance is equivalent to an instance of algorithm 1
The cosine 'distance' between  $\mathbf{Y}_i$  and  $\mathbf{Y}_j$  is:
$$
d _ {\mathrm {c o s}} (i, j) := 1 - \frac {\langle \mathbf {Y} _ {i} , \mathbf {Y} _ {j} \rangle}{\| \mathbf {Y} _ {i} \| \| \mathbf {Y} _ {j} \|}.
$$
In table 1 we show results for standard agglomerative clustering using  $d_{\mathrm{cos}}$  as a measure of dissimilarity, combined with average linkage. At each iteration, this algorithm works by merging the pair of data-vectors/clusters which are closest with respect to  $d_{\mathrm{cos}}(\cdot, \cdot)$ , say  $u$  and  $v$  merged to form  $w$ , with dissimilarities between  $w$  and the existing data-vectors/clusters computed according to the average linkage function:
$$
d _ {\cos} (w, \cdot) := \frac {| u |}{| w |} d _ {\cos} (u, \cdot) + \frac {| v |}{| w |} d _ {\cos} (v, \cdot). \tag {28}
$$
This procedure can be seen to be equivalent to algorithm 1 with input  $\hat{\alpha} (\cdot ,\cdot) = 1 - d_{\mathrm{cos}}(\cdot ,\cdot)$ . Indeed maximising  $1 - d_{\mathrm{cos}}(\cdot ,\cdot)$  is clearly equivalent to minimizing  $d_{\mathrm{cos}}(\cdot ,\cdot)$ , and with  $\hat{\alpha} (\cdot ,\cdot) = 1 - d_{\mathrm{cos}}(\cdot ,\cdot)$  the affinity computation at line 6 of algorithm 1 is:
$$
\begin{array}{l} \hat {\alpha} (w, \cdot) := \frac {| u |}{| w |} \hat {\alpha} (u, \cdot) + \frac {| v |}{| w |} \hat {\alpha} (v, \cdot) \\ = \frac {| u |}{| w |} [ 1 - d _ {\cos} (u, \cdot) ] + \frac {| v |}{| w |} [ 1 - d _ {\cos} (v, \cdot) ] \\ = \frac {| u | + | v |}{| w |} - \frac {| u |}{| w |} d _ {\cos} (u, \cdot) - \frac {| u |}{| w |} d _ {\cos} (v, \cdot) \\ = 1 - \left[ \frac {| u |}{| w |} d _ {\mathrm {c o s}} (u, \cdot) + \frac {| u |}{| w |} d _ {\mathrm {c o s}} (v, \cdot) \right], \\ \end{array}
$$
where on the r.h.s. of the final equality we recognise (28).
E.3 Using cosine similarity as an affinity measure removes multiplicative noise
Building from the algorithmic equivalence identified in section E.2, we now address the theoretical performance of agglomerative clustering with cosine distance in our modelling framework.
Intuitively, cosine distance is used in situations where the magnitudes of data vectors are thought not to convey useful information about dissimilarity. To formalise this idea, we consider a variation of our statistical model from section 2.1 in which:
-  $\mathcal{Z}$  are the leaf vertices of  $\mathcal{T}$ ,  $|\mathcal{Z}| = n$ , and we take these vertices to be labelled  $\mathcal{Z} = \{1, \dots, n\}$ .
-  $\mathbf{X}$  is as in section 2.1, properties A1 and A2 hold, and it is assumed that for all  $v\in \mathcal{Z}$ ,  $p^{-1}\mathbb{E}[\| \mathbf{X}(v)\| ^2 ] = 1$
- the additive model (1) is replaced by a multiplicative noise model:
$$
\mathbf {Y} _ {i} = \gamma_ {i} \mathbf {X} (i), \tag {29}
$$
where  $\gamma_{i} > 0$  are all strictly positive random scalars, independent of other variables, but otherwise arbitrary.
The interpretation of this model is that the expected square magnitude of the data vector  $\mathbf{Y}_i$  is entirely determined by  $\gamma_{i}$ , indeed we have
$$
\frac {1}{p} \mathbb {E} [ \| \mathbf {Y} _ {i} \| ^ {2} | \gamma_ {i} ] = \gamma_ {i} ^ {2} \frac {1}{p} \mathbb {E} [ \| \mathbf {X} (i) \| ^ {2} ] = \gamma_ {i} ^ {2} h (i) = \gamma_ {i} ^ {2},
$$
where  $h$  is as in section 2.1. We note that in this multiplicative model, the random vectors  $\mathbf{E}_i$  and matrices  $\mathbf{S}(v)$  from section 2.1 play no role, and one can view the random variables  $Z_1, \ldots, Z_n$  as being replaced by constants  $Z_i = i$ , rather than being i.i.d.
Now define:
$$
\hat {\alpha} _ {\cos} (i, j) := \frac {\left\langle \mathbf {Y} _ {i} , \mathbf {Y} _ {j} \right\rangle}{\| \mathbf {Y} _ {i} \| \| \mathbf {Y} _ {j} \|} = 1 - d _ {\cos} (i, j).
$$
Theorem 3. Assume that the model specified in section E.3 satisfies A3 and for some  $q \geq 2$ ,  $\sup_{j \geq 1} \max_{v \in \mathcal{Z}} \mathbb{E}[|X_j(v)|^{2q}] < \infty$ . Then
$$
\max  _ {i, j \in [ n ], i \neq j} | \alpha (i, j) - \hat {\alpha} _ {\cos} (i, j) | \in O _ {\mathbb {P}} \left(\frac {n ^ {2 / q}}{\sqrt {p}}\right).
$$
Proof. The main ideas of the proof are that the multiplicative factors  $\gamma_{i},\gamma_{j}$  in the numerator  $\hat{\alpha}_{\mathrm{cos}}(i,j)$  cancel out with those in the denominator, and combined with the condition  $p^{-1}\mathbb{E}[\| \mathbf{X}(v)\| ^2 ] = 1$  we may then establish that  $\alpha (i,j)$  and  $\hat{\alpha}_{\mathrm{cos}}(i,j)$  are probabilistically close using similar arguments to those in the proof of proposition 2.
Consider the decomposition:
$$
\begin{array}{l} \alpha (i, j) - \hat {\alpha} _ {\mathrm {c o s}} (i, j) = \alpha (i, j) - \frac {p ^ {- 1} \langle \mathbf {X} (i) , \mathbf {X} (j) \rangle}{p ^ {- 1 / 2} \| \mathbf {X} (i) \| p ^ {- 1 / 2} \| \mathbf {X} (j) \|} \\ = \alpha (i, j) - \frac {1}{p} \langle \mathbf {X} (i), \mathbf {X} (j) \rangle (30) \\ + \frac {\frac {1}{p} \langle \mathbf {X} (i) , \mathbf {X} (j) \rangle}{p ^ {- 1 / 2} \| \mathbf {X} (i) \| p ^ {- 1 / 2} \| \mathbf {X} (j) \|} \left[ p ^ {- 1 / 2} \| \mathbf {X} (i) \| p ^ {- 1 / 2} \| \mathbf {X} (j) \| - 1 \right]. (31) \\ \end{array}
$$
Applying the Cauchy-Schwartz inequality, and adding and subtracting  $p^{-1/2} \| \mathbf{X}(j) \|$  and 1 in the final term of this decomposition leads to:
$$
\begin{array}{l} \max_{i,j\in [n],i\neq j}|\alpha (i,j) - \hat{\alpha}_{\cos}(i,j)| \\ \leq \max  _ {i, j \in [ n ], i \neq j} \left| \alpha (i, j) - \frac {1}{p} \langle \mathbf {X} (i), \mathbf {X} (j) \rangle \right| (32) \\ + \max  _ {i \in [ n ]} \left| p ^ {- 1 / 2} \| \mathbf {X} (i) \| - 1 \right| (33) \\ + \left(1 + \max  _ {i \in [ n ]} \left| p ^ {- 1 / 2} \| \mathbf {X} (i) \| - 1 \right|\right) \max  _ {j \in [ n ]} \left| p ^ {- 1 / 2} \| \mathbf {X} (j) \| - 1 \right|. (34) \\ \end{array}
$$