diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzzausp" "b/data_all_eng_slimpj/shuffled/split2/finalzzausp" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzzausp" @@ -0,0 +1,5 @@ +{"text":"\\section{Introduction}\nMany machine learning and information retrieval systems rely on distance metrics that can accurately estimate the semantic similarity between two objects of interest. Functions such as Euclidean distance and cosine similarity when applied directly to complex input domains, like images or audio, are poor measures of semantic relatedness. Hence, machine learning has been applied to the problem of constructing metrics suited for specific domains.\n\nRecent advances in this field have taken advantage of the superior modelling capacity of deep neural networks to learn complex relations between data objects. While methods based on deep learning are able to represent more intricate metrics compared to linear Mahalanobis methods, they also take considerably longer to train. The objective of this work is to find a method to accelerate the training of deep learning approaches to similarity metric learning.\n\nCurrent metric learning algorithms based on deep neural networks rely on propagating multiple training examples through the network simultaneously in order to compute the gradient of some objective functions defined over the network output. For example, one could attempt to maximise the Euclidean distance between the network outputs for dissimilar instances, while also trying to minimise the Euclidean distance between the computed representations for instances that are similar. This forces one to train the network on pairs of examples---something that greatly increases the effective training set size, and therefore the time taken for the network to converge towards a good solution.\n\nMany techniques are evaluated on classification benchmark datasets, where each instance is labelled with a class and two instances are considered similar if and only if they share the same class. By evaluating metrics in this way there is an implicit assumption that transitivity is desired---which for some tasks is justified---but this is not always the case. For example, consider three images: A, B, and C. It could be the case the that A and B are considered similar because they have similar backgrounds. It could also be the case that B and C are similar because the same object appears in the foreground of both, despite the rest of the scene being vastly different. If transitivity were to be enforced then A and C would be considered similar, even though there is no reason for that to be the case.\n\nWe are interested in both transitive and non-transitive relations, such as multi-label classification datasets. Elaborating on the previous example; images A and B would be given a label indicating what type of background they have, while B and C would be given a label indicating what foreground object appears in the image. In this case B has two labels, and hence the task fits into the multi-label classification paradigm. However, in this work we take an even more general view of the problem definition. We assume only that the information provided consists of pairwise similarity or dissimilarity constraints. This generalised view enables the use of more diverse data collection strategies, such as the relevance feedback methods commonly used in information retrieval systems.\n\nIn our approach to similarity metric learning we acknowledge that there are latent classes within the data, however no explicit knowledge of these classes is required. By taking advantages of the existence of these latent classes, we first learn the structure of a target vector space for an embedding function, and subsequently learn a model that performs the embedding. The compute intensive part of our algorithm does not operate on pairs of feature vectors, and hence results in a computationally cheaper approach to learning instance similarity.\n\nWe first review some related methods in Section~\\ref{sec:related-work}, and then in Section~\\ref{sec:definition} we describe how the problem can be defined in terms of binary relations. Section~\\ref{sec:method} describes our similarity metric learning method in detail. In Section~\\ref{sec:experiments} we empirically demonstrate that our method converges considerably faster than other conventional methods and that the final accuracy is higher on both intrinsic and extrinsic evaluation tasks.\n\n\\section{Related Work}\n\\label{sec:related-work}\nMetric learning is a well established area, and much research has been put into developing sophisticated algorithms that can learn instance similarity. Metric learning techniques relevant to our work can be roughly divided into two categories: Mahalanobis based methods, and neural network based methods. Notable work in both of these areas are described, as the neural network approaches are often generalisations of the linear Mahalanobis methods to nonlinear models.\n\n\\subsection{Mahalanobis Based Methods}\nThe general form of a Mahalanobis distance metric parameterised by the matrix $\\textbf{M}$ and defined over the set $X$ is given in Equation~\\ref{eq:mahalanobis}, where $\\vec x_i, \\vec x_j \\in X$. The algorithms based on this model primarily differ on how the linear transform is optimised.\n\n\\begin{equation}\n\tD(\\vec x_i, \\vec x_j) = \\sqrt{(\\vec x_i - \\vec x_j)^{\\top} \\textbf{M} (\\vec x_i - \\vec x_j)}\n\t\\label{eq:mahalanobis}\n\\end{equation}\n\nThe large margin nearest neighbours (LMNN)~\\cite{weinberger2005} algorithm employs semidefinite programming to optimise a loss function composed of two terms. Specifically, there are two evaluations of Equation~\\ref{eq:mahalanobis}. One term draws very similar instances together, and the other encourages a margin to be formed between dissimilar instances. As the name suggests, the motivation for the development of this algorithm was to improve the accuracy of $k$-Nearest Neighbours ($k$-NN) classifiers.\n\nInformation-theoretic metric learning is another Mahalanobis technique, and was introduced by~\\cite{davis2007}. This criterion aims to minimise the Kullback-Leibler divergence between two multivariate Gaussians, of which the inverse covariance matrices are used to define Mahalanobis distance metrics. One of these Gaussians is defined in advance and acts as a regulariser, while the other is treated as a free parameter and optimised subject to constraints derived from similarity information.\n\nNeighbourhood Components Analysis (NCA)~\\cite{goldberger2004} is another method developed to be used in conjunction with $k$-NN classifiers. This technique attempts to find the matrix, $\\textbf{M}$, by minimising a differentiable loss function that approximates the behaviour of $k$-NN in the transformed feature space.\n\n\\subsection{Neural Network Based Methods}\nThe first application of neural networks to metric learning was with the introduction of Siamese networks~\\cite{bromley1993}. The original authors initially applied these models to signature verification, however others have since used this technique for many other domains such as face recognition and verification~\\cite{taigman2014}. Siamese networks are composed of two standard feed forward neural networks that have the same topology and share the same parameters. The output of these subnetworks is then compared with the cosine similarity function to produce the final output of the network, indicating whether the instances propagated through the two subnetworks are similar or not. During training the network is presented with pairs of instances labelled either positive or negative. For positive pairs the cosine similarity is maximised, whereas for negative pairs it is minimised.\n\nFollowing on from this, \\cite{chopra2005} developed a variant of Siamese networks that compares the output of the subnetworks using Euclidean distance. This method was then further improved by~\\cite{hadsell2006}, resulting in the contrastive loss function for Siamese networks, as given in Equation~\\ref{eq:contrastive}. This function is then averaged for all training pairs to create an objective function for training the network.\n\n\\begin{equation}\n\\label{eq:contrastive}\nL(\\vec x_i, \\vec x_j, y) = y \\|f(\\vec x_i) - f(\\vec x_j)\\|_2^2 + (1 - y) max(0, m - \\|f(\\vec x_i) - f(\\vec x_j)\\|_2)^2\n\\end{equation}\n\nWhere $\\vec x_i$ and $\\vec x_j$ are two instances, $y$ is the label indicating whether they are similar or dissimilar, $f$ performs a forward propagation through one of the subnetworks, and $m$ is a margin. The value of $m$ simply sets the scale of the resulting vector space and is typically set to 1.\n\nA further generalisation of Siamese networks are the class of methods that consider three instances per loss function evaluation, so called ``triplet'' loss functions~\\cite{gomez2015,schroff2015}. These methods attempt to minimise the distance between a target instance and another positive example, while simultaneously maximising the distance between the same target instance and a negative example. Some variants of this approach allow one to define the ground truth labels in terms of relative similarity. That is, rather than having hard constraints specifying similarity or dissimilarity, similarity is defined as an instance being more similar to one instance than another.\n\nThere is also an extension of NCA to nonlinear transformations of the input data~\\cite{salakhutdinov2007}. This method can be viewed as a probabilistic variant of Siamese networks. The nonlinear transformation models used in the original exposition of this method were stacked Restricted Boltzmann Machines, initialised using unsupervised pretraining and subsequently fine-tuned using the NCA loss function.\n\nA common theme that unifies all the approaches described thus far is the need to train on pairs (or triples) of instances. This increases the effective size of the training set quadratically, greatly slowing down the training time. Our proposal to decouple the process of learning the embeddings from learning the functions that performs the embedding is not entirely new. The work of~\\cite{lin2014} utilises a similar two step process for learning a hashing function. In their work the embeddings are in fact bit strings, and the function used to generate the hash codes takes the form of boosted decision trees. They also use a greedy discrete optimisation procedure to find the target hash codes, rather than a numerical optimisation method to find real valued vectors.\n\n\\section{Problem Definition}\n\\label{sec:definition}\nSimilarity metric learning algorithms are typically trained on pairs of objects labelled as being either positive, for pairs of similar objects, or negative, for pairs of dissimilar objects. More formally, we have a set of objects that we call $X$. We also have a set, $Z \\subset X \\times X \\times \\{1, 0\\}$, that contains pairs of objects from $X$ coupled with labels indicating whether they are similar or not. One can say that $Z$ represents a binary relation where some entries of the relation matrix are unknown.\n\nThis is a convenient problem formulation that naturally gives rise to models that are trained on pairs of objects at a time. The problem with this approach lies in the efficiency of pairwise training. The training set size is effectively squared, resulting in a representation of the training data that does not efficiently encode the useful information required to construct an accurate model. Even though all the information is available to the model, this inefficient encoding significantly slows down the training procedure.\n\nOne must inevitably train on pairs at some point in the metric learning process, however the goal of our work is demonstrate a method for modifying pre-existing loss functions in such a way that the pairwise training comprises a negligible fraction of the runtime.\n\nA key advantage of posing similarity learning as the task of inferring a binary relation is the ability decompose the training data into classes. This idea is most often studied in conjunction with equivalence relations, where the equivalence classes form a disjoint partition over the original training set. In this context the relation must exhibit reflexivity, symmetry, and transitivity---the last of which is somewhat limiting. One can drop the requirement for transitivity by instead considering binary tolerance relations, which are only reflexive and symmetric. As with equivalence relations, it is possible to decompose the training data into a set of classes (termed tolerance classes), however these classes need not be disjoint.\n\nRather than partitioning the training set into, potentially overlapping, subsets that each correspond to a tolerance class, we find a target vector for each instance. These vectors are constrained such that the targets of instances that are related will be close in the target vector space and unrelated instances will be far apart. The rationale behind this is that each tolerance class will be mapped to a cluster in the target vector space, however we can employ a technique that does not have to explicitly determine to which tolerance classes each instance belongs.\n\n\\section{Method}\n\\label{sec:method}\nInstead of training a large Siamese network on pairs of---potentially quite large---feature vectors in the training set, we compute a target vector for each training instance. To do this, we completely disregard any information provided by the features associated with each instance and instead try to solve an optimisation problem that encourages the target vectors of similar instances to be clustered together. After the target vectors have been computed, a multi-target regression model can be trained to embed instances into the target vector space. Provided that a suitable loss function has been chosen for learning the target vectors, some predefined distance metric applied to the target vector space will result in a system capable of determining instance similarity. The assumption that underlies this method is that the confusability between the latent classes in the dataset does not provide information that is useful for constructing a metric.\n\n\\subsection{Learning Target Vectors}\nWe now describe the method more formally, but still with enough abstraction that the generality is obvious. Consider $L(\\vec x_i, \\vec x_j, y_{ij})$, a differentiable loss function over a pair of instances. Similarity metric learning algorithms that rely on embedding data into a space where the semantic similarity is more salient usually rely on several components: the objective function, the model, and a fixed distance such as Euclidean or Manhattan distance. The use of a particular objective function generally implies that a certain fixed distance metric should be used on the embedded data. For example, when using the contrastive loss given in Equation~\\ref{eq:contrastive} it is fairly obvious that Euclidean distance (or squared Euclidean distance) is the intended metric. This leaves two components; the objective function and the embedding model. For this class of metric learning algorithms, where an embedding function is a primary component, one can write the loss function as $L(f_\\Theta(\\vec x_i), f_\\Theta(\\vec x_j), y_{ij})$, where $f_\\Theta$ is an embedding function parameterised by $\\Theta$.\n\nConsider the scenario where $f_\\Theta$ is modelled as a lookup table, so each feature vector, $\\vec x_i$, is simply mapped to a response vector, $t_i$, contained within $\\Theta$. One can then solve the following optimisation problem:\n\n\\begin{equation}\n\t\\Theta^\\ast = \\underset{\\Theta}{\\operatorname{arg}\\,\\operatorname{min}} \\frac{1}{\\|Z\\|} \\sum_{(\\vec x_i, \\vec x_j, y_{ij}) \\in Z} L(f_\\Theta(\\vec x_i), f_\\Theta(\\vec x_j), y_{ij})\n\\end{equation}\n\nBecause we only consider scenarios where $L$ is differentiable, this problem could be solved with any of a large variety of numerical optimisation algorithms.\n\nIt is trivial to see why systems such as this are not used in practice, because as soon as a novel feature vector is encountered where the label is unknown the model is not capable of making a prediction. However, we can take each of the learned target vectors and train a second model, $g_\\Omega$, that implements a more generalisable model. The new model can be created with any multi-target regression algorithm, but we focus on the use of deep neural networks in this paper. Although the original model for $f_\\Theta$ must be trained on pairs of instances, due to the composition with $L$, this new model does not require pairwise training.\n\nWe investigate two options for $L$: the contrastive loss given in Equation~\\ref{eq:contrastive}, and the loss function we define in Equation~\\ref{eq:dotloss}:\n\n\\begin{equation}\n\t\\label{eq:dotloss}\n\tL(f_\\Theta(\\vec x_i), f_\\Theta(\\vec x_j), y_{ij}) = \\frac{1}{2} (y_{ij} - f_\\Theta(\\vec x_i) \\cdot f_\\Theta(\\vec x_j))^2\n\\end{equation}\n\nWhere $\\cdot$ represents the dot product between two vectors. Using this loss function is equivalent to factoring the adjacency matrix of the underlying binary relation defined on the training set. We use the Adam optimiser~\\cite{kingma2014} to minimise both of these loss functions in a matter of seconds for each dataset we consider in our empirical evaluation.\n\n\n\\subsection{Learning an Embedding Function}\nOnce the target vectors have been found a regression model can be trained to minimise the squared error between the embedding of each instance and the corresponding target vector, as shown in Equation~\\ref{eq:squared-error}, where $g_\\Omega$ is the multi-target regression model. Our technique does not rely on a specific regression algorithm, but is instead very general. It is possible to use any multi-target regression method to learn a mapping from features to the learned target vectors, however our focus is on the performance of neural networks for metric learning and hence that is our regression algorithm of choice.\n\n\\begin{equation}\n\t\\label{eq:squared-error}\n\t\\Omega^\\ast = \\underset{\\Omega}{\\operatorname{arg}\\,\\operatorname{min}} \\frac{1}{2\\|X\\|} \\sum_{\\vec x_i \\in X} (f_{\\Theta^\\ast}(\\vec x_i) - g_{\\Omega}(\\vec x_i))^2\n\\end{equation}\n\nThe original Siamese network introduced by~\\cite{bromley1993} applied the cosine similarity function to embeddings of instances, as computed by the branches of the network, in order to determine whether instances are related. In this case a value of one means the instances are very similar, and a value of negative one indicates the instances are very dissimilar. Networks trained with the contrastive loss replace the cosine similarity function with Euclidean distance and the interpretation of the resulting real value is also changed. A value of zero indicates a high degree of similarity, and as the value becomes larger the instances are considered increasingly dissimilar.\n\nThe target vectors learned using the technique presented herein are found by either optimising loss function based on the squared Euclidean distance or the dot product. When using Euclidean distance, small values indicate similar instances and large values indicate dissimilar instances. It is important that the correct fixed metric is used on the resulting embeddings to ensure the optimal performance.\n\nUltimately, for all of these methods a threshold must be chosen if the problem is to be reduced to answering the question of whether two instances should be considered similar.\n\n\\section{Experiments}\n\\label{sec:experiments}\nThe motivation behind introducing this method was to accelerate the training process of neural network based metric learning algorithms. Firstly, we show that the optimisation problem used to compute the target vectors can be solved in a matter of seconds, thus comprising a negligible fraction of the overall training time. Then we demonstrate the time taken for our method and Siamese networks to converge when trained on the same datasets. Finally, we perform an extrinsic evaluation to show that the learned metrics perform well on $k$-NN classification tasks.\n\n\\subsection{Datasets and Network Architectures}\nStandard image classification datasets, summarised in Table~\\ref{tbl:datasets}, are used to demonstrate the capabilities of our method. The similarity metric learning methods we consider all involve pairwise training at some point, which necessitates datasets that contain pairs of instances with binary similarity constraints. In other words, for each dataset we must define a binary relation represented in the same manner as described in Section~\\ref{sec:definition}. For each element in each of the datasets, 10 positive and 10 negative pairs are generated. The pairs are labelled positive if the two instances have at least one class in common. This process is performed separately with the training and testing instances to prevent overlap between the train and test subsets. \n\nThe two most basic datasets considered are MNIST~\\cite{lecun1998} and CIFAR-10~\\cite{krizhevsky2009}. Both consist of 10 balanced classes and a similar number of total instances. The primary difference is that MNIST contains very easily discriminated hand written digits, and CIFAR-10 contains downsampled photographs of natural objects.\n\nThe Public Figures dataset~\\cite{kumar2009} is a large collection of photos spanning 200 different identities. Unfortunately the originators of this dataset only supply URLs for the images, and because the dataset is now several years old many of these links are dead. Fortunately there is a subset called PubFig83 that has been scraped and made available for download by~\\cite{pinto2011}. We use a version of this PubFig83 dataset created by~\\cite{chiachia2014} that has had the faces aligned such that the eyes in each image are always in the same position. In this version of the dataset there are 13,838 colour images that are all $100\\times100$ pixels. The networks trained on this dataset are only supplied with the central $60\\times60$ pixels of each image in order to reduce overfitting caused by the background clutter surrounding the faces.\n\nNUS-WIDE~\\cite{chua2009}, the multi-label dataset, is included in order to simulate a tolerance relation. Although there are only 81 classes, this dataset includes 16,458 unique label vectors consisting of different combinations of these classes. This results in a highly complex metric learning problem. The difficulty of this dataset is further compounded by the presence of label noise, due to the labels being determined using a method that relies on user specified tags. The original dataset consists of a set of image URLs and associated labels, however some of these URLs are now unavailable. We managed to collect 222,654 of the original 269,648 instances. Each image was resized such that the smallest dimension was 100, and then the central $100 \\times 100$ pixels were used for training and testing.\n\n\\begin{table}\n\t\\center\n\t\\caption{A summary of the datasets used for the experiments in this paper.}\n\t\\label{tbl:datasets}\n\t\\begin{tabular*}{0.9\\columnwidth}{@{\\extracolsep{\\fill}}ccccc}\n\t\t\\hline\\noalign{\\smallskip}\n\t\tDataset & Train Instances & Test Instances & Features & Labels \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\t\\noalign{\\smallskip}\n\t\tMNIST & 60,000 & 10,000 & 784 & 10 \\\\\n\t\tCIFAR-10 & 50,000 & 10,000 & 3,072 & 10 \\\\\n\t\tPubFig83 & 11,000 & 2,838 & 30,000 & 83 \\\\\n\t\tNUS-WIDE & 150,000 & 72,654 & 30,000 & 81 \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\\end{tabular*}\n\\end{table}\n\nEach dataset requires a different network due to the varying complexity of the associated task and the different number of features contained within each instance. Table~\\ref{tbl:architectures} provides an overview of these architectures. In the case of a Siamese network the architectures given in Table~\\ref{tbl:architectures} describe only a single branch of the network. Additionally, when training networks on CIFAR-10, PubFig83, and NUS-WIDE, we also train on horizontal flips of images in the training set. The size of the output layer determines the length of the learned target vectors for each dataset.\n\n\\begin{table}\n\t\\center\n\t\\caption{The different network architectures used for each dataset throughout all experiments. In this table Dense $x$ indicates a fully connected layer with $x$ hidden units, Convolutionall $x\\times y\\times z$ means a convolutional layer with $x$ feature maps and filters of size $y\\times z$. Lastly, Max Pool $x \\times y$, $z \\times w$ represents a max pooling layer with a pool size of $x \\times y$ and a stride of $z \\times w$.}\n\t\\label{tbl:architectures}\n\t\\begin{tabular*}{0.7\\columnwidth}{@{\\extracolsep{\\fill}}cc}\n\t\t\\hline\\noalign{\\smallskip}\n\t\tMNIST & PubFig83 \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\t\\noalign{\\smallskip}\n\t\tDense 500 & Convolutional $64 \\times 9 \\times 9$ \\\\\n\t\tDense 500 & Max Pool $2 \\times 2$, $2 \\times 2$ \\\\\n\t\tDense 16 & Convolutional $96 \\times 7 \\times 7$ \\\\\n\t\t& Max Pool $2 \\times 2$, $2 \\times 2$ \\\\\n\t\t& Convolutional $128 \\times 7 \\times 7$ \\\\\n\t\t& Dense 1,024 \\\\\n\t\t& Dense 1,024 \\\\\n\t\t& Dense 64 \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\\noalign{\\smallskip}\n\t\tCIFAR-10 & NUS-WIDE \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\t\\noalign{\\smallskip}\n\t\tConvolutional $64 \\times 3 \\times 3$ & Convolutional $64 \\times 3 \\times 3$ \\\\\n\t\tConvolutional $64 \\times 3 \\times 3$ & Convolutional $64 \\times 3 \\times 3$ \\\\\n\t\tMax Pool $3 \\times 3$, $2 \\times 2$ & Convolutional $64 \\times 3 \\times 3$ \\\\\n\t\tConvolutional $96 \\times 3 \\times 3$ & Max Pool $2 \\times 2$, $2 \\times 2$ \\\\\n\t\tConvolutional $96 \\times 3 \\times 3$ & Convolutional $96 \\times 3 \\times 3$ \\\\\n\t\tMax Pool $3 \\times 3$, $2 \\times 2$ & Convolutional $96 \\times 3 \\times 3$ \\\\\n\t\tDense 128 & Convolutional $96 \\times 3 \\times 3$ \\\\\n\t\tDense 128 & Max Pool $2 \\times 2$, $2 \\times 2$ \\\\\n\t\tDense 16 & Convolutional $128 \\times 3 \\times 3$ \\\\\n\t\t& Convolutional $128 \\times 3 \\times 3$ \\\\\n\t\t& Convolutional $128 \\times 3 \\times 3$ \\\\\n\t\t& Max Pool $2 \\times 2$, $2 \\times 2$ \\\\\n\t\t& Dense 4,096 \\\\\n\t\t& Dense 4,096 \\\\\n\t\t& Dense 32 \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\\end{tabular*}\n\\end{table}\n\nFor each hidden layer the ReLU activation function is used, and the output layers do not use any nonlinearity. Dropout~\\cite{srivastava2014} (with $p=0.5$) was applied before all hidden layers consisting of fully connected units. The weight initialisation procedure of~\\cite{glorot2010} was used for setting the starting values for the weights in all network. We applied a slightly modified standardisation procedure to the target vectors when training the regression networks. Mean subtraction is performed, however rather than dividing by the individual standard deviation for each component in the target vectors we scale all vectors such that the mean standard deviation of all the components is one. This prevents distortion of the target vector space, which would effectively change the objective function to a weighted squared error variant.\n\n\\subsection{Implementation}\nThe target vector optimisation was performed using a single threaded program written in the D programming language\\footnote{http:\/\/www.dlang.org} and run on an Intel i7 4770. The deep networks are trained using an implementation that takes advantage of functions provided by cuDNN 4~\\cite{chetlur2014} and is executed on an NVIDIA TITAN X GPU.\n\n\\subsection{First Phase Optimisation}\nThe first point of order is to show that the first optimisation problem consumes a negligible fraction of the overall training time when constructing a learned similarity metric. Table~\\ref{tbl:first-phase} contains empirical estimates of the expected runtime for both loss functions when applied to each dataset. Although the dot product based loss function takes longer to finish than the contrastive loss, both still finish in a relatively short amount of time.\n\n\\begin{table}\n\t\\center\n\t\\caption{95\\% confidence intervals for the expected runtime of the first phase optimisation problem for each loss function and dataset combination. Values are in seconds. FML-C denotes targets trained with the contrastive loss function and FML-DP denotes targets trained with the loss function given in Equation~\\ref{eq:dotloss}.}\n\t\\label{tbl:first-phase}\n\t\\begin{tabular*}{0.9\\columnwidth}{@{\\extracolsep{\\fill}}ccccc}\n\t\\hline\\noalign{\\smallskip}\n\t& MNIST & CIFAR-10 & PubFig83 & NUS-WIDE \\\\\n\t\\noalign{\\smallskip}\n\t\\hline\n\t\\noalign{\\smallskip}\n\tFML-C & 6.90 ($\\pm$0.01) & 5.19 ($\\pm$0.21) & 1.94 ($\\pm$0.01) & 46.43 ($\\pm$1.91) \\\\\n\tFML-DP & 21.77 ($\\pm$1.38) & 15.89 ($\\pm$1.70) & 6.86 ($\\pm$0.18) & 152.30 ($\\pm$4.89) \\\\\n\t\\noalign{\\smallskip}\n\t\\hline\n\t\\end{tabular*}\n\\end{table}\n\n\\subsection{Time to Converge}\nWe now demonstrate that our method converges significantly faster than a conventional Siamese network trained with the contrastive loss function, while still achieving competitive accuracy on an intrinsic evaluation task. Because the range of the various loss functions used to train the different models we are evaluating are quite different we must select a single metric to use as a proxy for model performance. We have chosen the Area Under the Receiver Operating Characteristic curve (AUROC), where the binary classification task is to determine whether two instances are similar or not according to the previously defined binary relation. Figure~\\ref{fig:convergence} shows how fast the three methods converge for each dataset. \n\n\\begin{figure}\n\t\\begin{subfigure}{0.5\\textwidth}\n\t\t\\center\n\t\t\\begin{tikzpicture}[scale=0.7,trim axis right,trim axis left]\n\t\t\t\\begin{axis}[yticklabel style={\/pgf\/number format\/fixed,\n\t\t\t \/pgf\/number format\/precision=3}, legend pos=south east, ylabel=AUROC, xlabel={Time (Seconds)}]\n\t\t\t\t\\addplot +[mark=none] table[col sep=comma] {results\/mnist-fml-mf.csv};\n\t\t\t\t\\addlegendentry{FML-DP}\n\t\t\t\t\\addplot +[mark=none] table[col sep=comma] {results\/mnist-fml-contrastive.csv};\n\t\t\t\t\\addlegendentry{FML-C}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/mnist-siamese-contrastive.csv};\n\t\t\t\t\\addlegendentry{Siamese}\n\t\t\t\\end{axis}\n\t\t\\end{tikzpicture}\n\t\t\\caption{MNIST}\n\t\\end{subfigure}\n\t\\begin{subfigure}{0.5\\textwidth}\n\t\t\\center\n\t\t\\begin{tikzpicture}[scale=0.7,trim axis right,trim axis left]\n\t\t\t\\begin{axis}[yticklabel style={\/pgf\/number format\/fixed,\n\t\t\t \/pgf\/number format\/precision=3}, legend pos=south east, ylabel=AUROC, xlabel={Time (Seconds)}]\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/cifar10-fml-mf.csv};\n\t\t\t\t\\addlegendentry{FML-DP}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/cifar10-fml-contrastive.csv};\n\t\t\t\t\\addlegendentry{FML-C}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/cifar10-siamese-contrastive.csv};\n\t\t\t\t\\addlegendentry{Siamese}\n\t\t\t\\end{axis}\n\t\t\\end{tikzpicture}\n\t\t\\caption{CIFAR-10}\n\t\\end{subfigure} \\\\[1cm]\n\t\\begin{subfigure}{0.5\\textwidth}\n\t\t\\center\n\t\t\\begin{tikzpicture}[scale=0.7,trim axis right,trim axis left]\n\t\t\t\\begin{axis}[yticklabel style={\/pgf\/number format\/fixed,\n\t\t\t \/pgf\/number format\/precision=3}, legend pos=south east, ylabel=AUROC, xlabel={Time (Seconds)}]\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/pubfig83-fml-mf.csv};\n\t\t\t\t\\addlegendentry{FML-DP}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/pubfig83-fml-contrastive.csv};\n\t\t\t\t\\addlegendentry{FML-C}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/pubfig83-siamese-contrastive.csv};\n\t\t\t\t\\addlegendentry{Siamese}\n\t\t\t\\end{axis}\n\t\t\\end{tikzpicture}\n\t\t\\caption{PubFig83}\n\t\\end{subfigure}\n\t\\begin{subfigure}{0.5\\textwidth}\n\t\t\\center\n\t\t\\begin{tikzpicture}[scale=0.7,trim axis right,trim axis left]\n\t\t\t\\begin{axis}[yticklabel style={\/pgf\/number format\/fixed,\n\t\t\t \/pgf\/number format\/precision=3},\n\t\t\t\t\t\t\t\t scaled ticks=false, tick label style={\/pgf\/number format\/fixed}, legend pos=south east, ylabel=AUROC, xlabel={Time (Seconds)}]\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/nuswide-fml-mf.csv};\n\t\t\t\t\\addlegendentry{FML-DP}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/nuswide-fml-contrastive.csv};\n\t\t\t\t\\addlegendentry{FML-C}\n\t\t\t\t\\addplot +[mark=none] table [col sep=comma] {results\/nuswide-siamese-contrastive.csv};\n\t\t\t\t\\addlegendentry{Siamese}\n\t\t\t\\end{axis}\n\t\t\\end{tikzpicture}\n\t\t\\caption{NUS-WIDE}\n\t\\end{subfigure}\n\t\\caption{Plots of the AUROC on the test set vs training time for each dataset. In these plots FML denotes one of the fast metric learning methods presented in this work. The suffix DP means the targets were found with the loss function given in Equation~\\ref{eq:dotloss}, and C means they were found with the contrastive loss. Each Siamese network was run until convergence, and then the other methods were run for double the number of epochs taken to train the Siamese network. Because the Siamese network considers pairs of images, each epoch takes twice as long as a regular regression network. On the NUS-WIDE experiment we stopped the FML methods earlier due to time constraints and the lack of extra information that would be obtained from running them for the same duration as the Siamese network.}\n\t\\label{fig:convergence}\n\\end{figure}\n\nWe can see that both variants of the fast metric learning method that has been proposed converge significantly faster than the conventional Siamese network. However, on one dataset the Siamese network does outperform our method. \n\n\\subsection{$k$-NN Classifier Performance}\nTo perform an extrinsic evaluation that shows how useful this method can be in practice, $k$-NN classifiers are created that utilise Euclidean distance applied to the embeddings to make predictions. A validation set was used for determining how many epochs each network should be trained for. It should be noted that the models trained with the dot product based loss function given in Equation~\\ref{eq:dotloss} are at a disadvantage in this case. The multiclass classifiers were trained using WEKA~\\cite{hall2009}, and the multi-label classifiers are created using the binary relevance problem transformation scheme as implemented in MEKA.\\footnote{http:\/\/meka.sourceforge.net} Table~\\ref{tbl:knn} shows the performance of the $k$-NN classifiers, with $k = 5$ for all classifiers.\n\n\\begin{table}\n\t\\center\n\t\\caption{Performance of $k$-NN classifiers applied to each dataset and model combination. Accuracy is reported for the three multiclass datasets (MNIST, CIFAR-10, and PubFig83), and the Jaccard index (higher is better) is reported for the multi-label dataset (NUS-WIDE).}\n\t\\label{tbl:knn}\n\t\\begin{tabular*}{0.9\\columnwidth}{@{\\extracolsep{\\fill}}ccccc}\n\t\t\\hline\\noalign{\\smallskip}\n\t\tAlgorithm & MNIST & CIFAR-10 & PubFig83 & NUS-WIDE \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\t\\noalign{\\smallskip}\n\t\tFML-C & 0.976 & 0.806 & 0.777 & 0.427 \\\\\n\t\tFML-DP & 0.978 & 0.806 & 0.768 & 0.229 \\\\\n\t\tSiamese & 0.972 & 0.734 & 0.335 & 0.393 \\\\\n\t\t\\noalign{\\smallskip}\n\t\t\\hline\n\t\\end{tabular*}\n\\end{table}\n\nIt can be seen that both the fast metric learning methods presented in this work outperform the conventional Siamese network trained with the contrastive loss function when evaluating on multiclass classification tasks. Particularly surprising is the performance on PubFig83, where the accuracy of the Siamese network is significantly worse than the other methods. Also interesting is the performance on the NUS-WIDE dataset. It is quite surprising that FML-C achieves a higher Jaccard index than the Siamese network, despite the intrinsic evaluation showing the Siamese network converges towards a more accurate solution.\n\n\\section{Conclusion}\nIn this paper, we have presented a fast method for learning similarity metrics backed by deep neural networks. It has been shown that the convergence time for the techniques presented in this work are significantly faster and, in the majority of cases, result in superior performance on both intrinsic and extrinsic evaluation tasks. Our method, coupled with the contrastive loss function, appears to be a very good choice for learning specialised distance metrics for $k$-NN.\n\nIt would be interesting to investigate how well these methods work on information retrieval tasks. The formalisation given in Section~\\ref{sec:definition} is well suited for scenarios where one does not wish explicity assign a ground truth class during data collection, even though there is likely to be a large number of latent classes or topics. It would also be interesting to investigate how effective two step training phase is for speeding up networks trained with triplet loss functions, especially since these loss functions are more popular for information retrieval tasks~\\cite{chechik2010}.\n\n\\subsubsection*{Acknowledgements.} We thank NVIDIA for donating the TITAN X GPU that was used for training all of the deep networks in this paper.\n\n\\bibliographystyle{plain}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\n\n\\section{Examining Patch Diversity in Vision Transformers}\n\\label{sec:study}\n\nTo understand the origin of the training instability, we study the patch representations learned after each self-attention layer. Ideally, we would hope the patch representations to be diverse and capture different information from the inputs. We study the diversity of the patch representations by computing the patch-wise absolute cosine similarity. Consider a sequence of patch representations $\\bm{h} = [h_{class}, h_1, \\cdots, h_n]$. We define the patch-wise absolute cosine similarity as\n\\begin{equation*}\n\\mathcal{P}(\\bm h) = \\frac{1}{n(n-1)} \\sum_{i\\neq j} \\frac{|h_i^\\top h_j|}{\\parallel h_i \\parallel_2 \\parallel h_j \\parallel_2}.\n\\end{equation*}\nHere we ignore the \\emph{class} patch. Larger values of $\\mathcal{P}(\\bm h)$ indicate a higher correlation among patches and vice versa.\n\nWe test two variants of vision transformers pre-trained on the ImageNet dataset~\\citep{deng2009imagenet}, including a 24-layer DeiT-Base model~\\citep{touvron2020training} (denoted as DeiT-Base24) and a SWIN-Base~\\citep{liu2021swin} model. We also evaluate a ResNet-50~\\citep{he2016deep} model for comparison. For the DeiT-Base24 model, we uniformly select 5 layers to compute the patch-wise cosine similarity. For the SWIN-Base model and ResNet-50 model, we select the input representation to each down-sampling layer. Specifically for the ResNet-50 model, we regard the representations at each spatial location as an individual patch.\n\n\\begin{figure}[t]\n\\centering\n\\setlength{\\tabcolsep}{1pt}\n\\begin{tabular}{cc}\n\\includegraphics[height=0.225\\textwidth]{figures\/vit_baseline.pdf} &\n\\raisebox{1.2em}{\\rotatebox{90}{\\small Cosine similarity}}\n\\includegraphics[height=0.225\\textwidth]{figures\/cos_baseline.pdf}\\\\ \n& {\\small Block index} \\\\\n(a) An illustration of vision transformers \n& (b) Pairwise absolute cosine similarity \\\\% & (b) Layer-wise \\emph{s.t.d.} of Attention \\\\\n\\end{tabular}\n\\caption{(a) An overview of vision transformers by following \\citep{dosovitskiy2020vit}. Each image patch is first transformed to a latent representation using a linear patch projection layer. The \\emph{dog} image is from ImageNet~\\citep{deng2009imagenet}. \n(b) Comparisons of patch-wise absolute cosine similarities.\nAll similarities are computed with 10,000 sub-sampled images from the ImageNet training set without data augmentation.}\n\\label{fig:oversmooth}\n\\end{figure}\n\nAs shown in Figure~\\ref{fig:oversmooth} (b), the patch-wise cosine similarity $\\mathcal{P}(\\cdot)$ of the patch representations learned by DeiT-Base24 and SWIN-Base gradually increases with the the depth of layers. For DeiT-Base24, the average cosine similarity becomes larger than 0.7 for the representations after the last layer. In contrast, ResNet-50 learns relative diversified features across the network without an obvious increase of the patch-wise cosine similarity. Such high similarity across the learned patch representations is undesired as it degrades the learning capacity of the vision transformer models and limits the actual information extracted from the input images. There is also risk for the patch representations to degenerate with the increase of model depth, which may partially explain the high training instability of deep models.\n\n\\iffalse\nIn vision transformers, patch representations are iteratively transformed by the self-attention layers. Intuitively, \none would expect each patch to capture different information from the inputs, such that all learned patch representations are diversified.\nIn this work, \nwe observe that the training of vanilla transformers suffers from the \n\\emph{over-smoothing} problem, in a way that different patches gradually become similar to each other as the layer goes deeper. Such representation degradation leads to sub-optimal performance and limits the capabilities of large-scale vision transformers in practice.\n\nTo study this over-smoothing phenomenon quantitatively,\nwe compute the patch-wise absolute cosine similarity\nto measure the diversity of the learned patch features.\nMore precisely, consider a sequence of patch features $\\bm{h} = [h_{class}, h_1, \\cdots, h_n]$, we define the patch-wise absolute cosine similarity as follows,\n$$\n\\mathcal{P}(\\bm h) = \\frac{1}{n(n-1)} \\sum_{i\\neq j} \\frac{|h_i^\\top h_j|}{\\parallel h_i \\parallel_2 \\parallel h_j \\parallel_2}.\n$$\nHere we leave out the \\emph{class} patch in computation. Larger values of $\\mathcal{P}(\\bm h)$ indicate a higher correlation between patches and vice versa.\n\n\n\n\n\\begin{figure}[t]\n\\centering\n\\setlength{\\tabcolsep}{1pt}\n\\begin{tabular}{cc}\n\\includegraphics[height=0.225\\textwidth]{figures\/vit_baseline.pdf} &\n\\raisebox{1.2em}{\\rotatebox{90}{\\small Cosine similarity}}\n\\includegraphics[height=0.225\\textwidth]{figures\/cos_baseline.pdf}\\\\ \n& {\\small Block index} \\\\\n(a) An illustration of vision transformers \n& (b) Pairwise absolute cosine similarity \\\\% & (b) Layer-wise \\emph{s.t.d.} of Attention \\\\\n\\end{tabular}\n\\caption{(a) An overview of vision transformers by following \\citep{dosovitskiy2020vit}. Each image patch is first transformed to a latent representation using a linear patch projection layer. The \\emph{dog} image is from ImageNet~\\citep{deng2009imagenet}. \n(b) Comparisons of patch-wise absolute cosine similarities.\nAll similarities are computed with 10,000 sub-sampled images from the ImageNet training set without data augmentation.\n}\n\\label{fig:oversmooth}\n\\end{figure}\n\n\\paragraph{Example}\nWe examine two ImageNet~\\citep{deng2009imagenet} pretrained vision transformers, including a 24-layer DEIT-base model~\\citep{touvron2020training} (denoted by DEIT-Base24) and \na SWIN-Base~\\citep{liu2021swin} model, and furthermore,\nwe evaluate a ResNet-50~\\citep{he2016deep} model to provide a baseline.\nSpecifically, for ResNet-50, we treat the features at each spatial location as an individual patch.\n\nTo quantify the diversity of the learned patch representations throughout the network,\nfor DEIT-Base24, we uniformly choose 5 layers ranging from the first layer to the last layer, and compute the patch-wise absolute cosine similarity of their learned features. For SWIN-Base and ResNet-50, we select the layers before each down-sampling step (with the same number of feature maps\/patches) for comparisons. \n\n\nAs illustrated in Figure~\\ref{fig:oversmooth} (b), \nthe patch-wise absolute cosine similarity $\\mathcal{P}(\\cdot) $ for patches learned by DEIT-Base24 and SWIN-Base gradually increases as the the depth of layers increases; the average cosine similarity is larger than 0.7\nfor patches from the last layer. \nOn the hand other, ResNet-50 learns relative diversified features across the network without degradation in representations. \n\n\\fi\n\n\\section{DiversePatch: Promoting Patch Diversification for Vision Transformers}\n\\label{sec:method}\n\nTo alleviate the observed problem, we propose three regularization techniques to encourage diversity across the learned patch representations.\n\n\\paragraph{Patch-wise cosine loss}\nAs a straightforward solution, we propose to directly minimize the patch-wise absolute value of cosine similarity between different patch representations. \nGiven the final-layer patch representations $\\bm{h}^{[L]}$ of an input $\\bm x$,\nwe add a patch-wise cosine loss to the training objective:\n\\begin{equation*}\n\\mathcal{L}_{\\textit{cos}}(\\bm x) = \\mathcal{P}(\\bm{h}^{[L]}).\n\\end{equation*}\nThis regularization loss explicitly minimizes the pairwise cosine similarity between different patches.\nSimilar approaches have also been adopted for training improved \nrepresentations in graph neural networks \\citep{chen2020measuring} and diversified word embeddings in language models \\citep{gao2019representation}.\nMeanwhile, \nthis regularization loss can be viewed as minimizing the upper bound of the largest eigen-value of $\\bm{h}$ \\citep{merikoski1984trace}, hence improving the expressiveness of the representations. See Figure~\\ref{fig:demo} (a) for an illustration.\n\n\\paragraph{Patch-wise contrastive loss}\nSecondly, as shown in Figure~\\ref{fig:oversmooth} (b), \nrepresentations learned in early layers are more diverse compared to that in deeper layers.\nHence, we propose a contrastive loss which uses the representations in early layers, and regularizes the patches in deeper layers to reduce the similarity of patch representations. \nSpecifically, given an image $\\bm{x}$, \nlet $\\bm{h}^{[1]}=\\{h_i^{[1]}\\}_i$ and $\\bm{h}^{[L]}=\\{h_i^{[L]}\\}_i$ denote its patches at the first and the last layer, respectively.\nWe constrain each $h^{[L]}_i$ to be similar to $h^{[1]}_i$ and to be different to any other patches $h^{[1]}_{j\\neq i}$ as follows (see Figure~\\ref{fig:demo} (b)),\n\\begin{equation*}\n\\mathcal{L}_{\\textit{contrastive}}(\\bm x)= - \\frac{1}{n} \\sum_{i=1}^n \\log \\frac{\\exp({h^{[1]}_i}^\\top h^{[L]}_i)}{\\exp({h^{[1]}_i}^\\top h^{[L]}_i) + \\exp({h^{[1]}_i}^\\top (\\frac{1}{n-1}\\sum_{j \\neq i} h^{[L]}_j))}, \n\\end{equation*}\nIn practice, we stop the gradient on $\\bm{h}^{[1]}$.\n\n\\paragraph{Patch-wise mixing loss}\nThirdly, instead of just using the class patch for the final prediction, we propose to train each patch to predict the class label as well. This can be combined with Cutmix~\\citep{yun2019cutmix} data augmentation to provide additional training signals for the vision transformer. As shown in Figure~\\ref{fig:demo} (c), we mix the input patches from two different images and attach an additional shared linear classification head to each output patch representations for classification. The mixing loss forces each patch to only attend to its a subset of patches from the same input images and ignore unrelated patches. Hence, it effectively prevents simple averaging across different patches to yield more informative and useful patch representations. This patch mixing loss can be formulated as below,\n\\begin{equation*}\n\\mathcal{L}_\\textit{mixing}(\\bm x) = \\frac{1}{n} \\sum_{i=1}^n \\mathcal{L}_\\textit{ce}(g(h^{[L]}_i), y_i),\n\\end{equation*}\nwhere $h^{[L]}_i$ represents patch representations in the last layer, $g$ denotes the additional linear classification head, $y_i$ stands for the patch-wise class label and $\\mathcal{L}_\\textit{ce}$ denotes the cross entropy loss.\n\n\\iffalse\nThirdly, we propose to train each patch to predict its own class label. \nThis regularization allows us to leverage Cutmix~\\citep{yun2019cutmix} \nto provide additional training signals to avoid over-smoothing among patches.\nSpecifically, we propose to mix each input with two different images, and in the meantime, attach an additional shared linear classification head to each patch at the last layer for patch-wise classification.\nThis idea is illustrated in Figure~\\ref{fig:demo} (c). \n\nIn this way, each patch would be forced to only attend to its related patches while ignoring unrelated patches from other images. \nBy mixing different images, our \\emph{patch mixing loss} effectively prevents simple averaging across different patches and hence yielding more informative and useful patch representations. \nThis patch mixing loss can be formulated as below,\n\\begin{equation*}\n\\mathcal{L}_\\textit{mixing}(\\bm x) = \\frac{1}{n} \\sum_{i=1}^n \\mathcal{L}_\\textit{ce}(g(h^{[L]}_i), y_i),\n\\end{equation*}\nwhere $h^{[L]}_i$ represents patch representations in the last layer, $g$ denotes the additional linear classification head, $y_i$ stands for the patch-wise class label and $\\mathcal{L}_\\textit{ce}$ denotes the cross entropy loss.\n\\fi\n\n\\paragraph{Algorithm}\nWe improve the training of vision transformers by simply jointly minimizing the weighted combination of $\\alpha_1 \\mathcal{L}_{\\textit{cos}} + \\alpha_2 \\mathcal{L}_{\\textit{contrastive}} +\\alpha_3 \\mathcal{L}_{\\textit{mixing}}$. \nOur method does not require any network modifications, and in the meantime, is not restricted to any specific architectures.\nIn our experiments, we simply set $\\alpha_1=\\alpha_2=\\alpha_3=1$ without any particular hyper-parameters tuning.\n\n\n\\begin{figure}[ht]\n\\centering\n\\setlength{\\tabcolsep}{2pt}\n\\begin{tabular}{ccc}\n\\includegraphics[height=0.19\\textwidth]{figures\/patch_cos_reg.pdf} &\n\\includegraphics[height=0.19\\textwidth]{figures\/patch_contrastive.pdf} &\n\\includegraphics[height=0.19\\textwidth]{figures\/patch_mixing.pdf} \\\\\n(a) Patch-wise Cosine Loss & (b) Patch-wise Contrastive Loss & \n(c) Patch-wise Mixing Loss \\\\\n\\end{tabular}\n\\caption{ An illustration of our patch diversification promoting losses. (a) Patch-wise cosine loss. (b) Patch-wise contrastive loss. (c) Patch-wise mixing loss.\n}\n\\label{fig:demo}\n\\end{figure}\n\n\\section{Introduction}\n\n \n \n \n\nRecently, vision transformers have demonstrated promising performance on various challenging computer vision tasks, including image classification~\\citep{dosovitskiy2020vit}, object detection~\\citep{zhu2020deformable, carion2020end}, multi-object tracking~\\citep{meinhardt2021trackformer}, image generation~\\citep{jiang2021transgan} and video understanding~\\citep{bertasius2021space}. \nCompared with highly optimized convolutional neural networks (CNNs), e.g., ResNet~\\citep{he2016deep} and EfficientNet~\\citep{tan2019efficientnet}, transformer encourages non-local computation and achieves comparable, and even better performance when pre-trained on large scale datasets.\n\nFor a vision transformer, an image is usually split into patches and the sequence of linear embeddings of these patches are provided as the input to the stacked transformer blocks~\\citep{dosovitskiy2020vit}. A vision transformer can learn the patch representations effectively using the self-attention block, which aggregates the information across the patches~\\citep{vaswani2017attention}. The learned patch representations are then used for various vision tasks, such as image classification, image segmentation, and object detection. Hence, learning high-quality and informative patch representations becomes key to the success of a vision transformer.\n\nThough promising results on vision tasks have been demonstrated for vision transformers, it is found that the training of vision transformers is not very stable, especially when the model becomes wider and deeper~\\citep{touvron2021going}. To understand the origin of the training instability, we use two popular vision transformer variants, i.e., DeiT~\\citep{touvron2020training} and SWIN-Transformer~\\citep{liu2021swin}, and study the extracted patch representations of each self-attention layer. We find the average patch-wise absolute cosine similarity between patch representations increases significantly for late layers in both two models. For a 24-layer DeiT-Base model, the cosine similarity can reach more than 0.7 after the last layer. This indicates a high correlation and duplication among the learned patch representations. Such behavior is undesired as it degrades overall representation power of patch representations and reduces the learning capacity of powerful vision transformers. Our findings shed light on the empirical results found by \\citep{touvron2021going}, and may partially explain the reason why simply increasing the depth of standard vision transformers cannot boost the model performance.\n\nTo alleviate the problem in vision transformers, we propose three different techniques. First, We propose to directly promote the diversity among different patch representations by penalizing the patch-wise cosine similarity. Meanwhile, we observe the input patch representations to the first self-attention layer are often more diversified as they rely solely on the input pixels. Based on this observation, we propose a patch-wise contrastive loss to encourage the learned representations of the same patch to be similar between the first and layer layers while force the representations of different patches in one given image to be different.\n\n\nThirdly, we propose a patch-wise mixing loss. Similar to Cutmix~\\citep{yun2019cutmix}, we mix the input patches from two different images and use the learned patch representations from each image to predict its corresponding class labels. With the patch-wise mixing loss, we are forcing the self-attention layers to only attend to patches that are most relevant to its own category, and hence, learning more discriminating features.\n\n\n\nEmpirically, leveraging the proposed diversity-encouraging training techniques, \nwe significantly improve the image classification for standard vision transformers on ImageNet without any architecture modifications or any extra data. \nSpecifically, we achieve 83.3\\% top-1 accuracy on ImageNet with an input resolution of 224$\\times$224 for DeiT.\nWe also finetune the checkpoint trained on ImageNet-22K from SWIN-Transformer \\citep{liu2021swin} and achieve 87.4\\% top-1 accuracy on ImageNet.\nBy transferring the backbone model to semantic segmentation, we enhance the SOTA results on Cityscapes and ADE20k valid set to 83.6 and 54.5 mIoU, respectively.\n\n\n\n\n\n\\section{Primal Experiment}\n\\subsection{Re-Design Self-Attention}\nThe SoftMax attention in self-attention layer is defined as:\ngiven input $X$, let $K = X W^k$, $Q = X W^q$ and $V = X W^v$, the output $y = \\mathrm{SoftMax}(K Q^T \/ \\mathrm{scale}) V$.\nThe time complexity and FLOPs of the attention is $\\mathcal{O}(T^2 N)$ where $T$ is the number of tokens and $N$ is the dimension size.\n\n$X \\in R^{[N, D]} -> X^{\\mathrm{weight}}_i = X W^{\\mathrm{reduce}}_i \\in R^{[N, 1]} -> Y = \\sum_i X \\odot f(X^{\\mathrm{weight}}_i)$ where $f$ is stacked MLP with a final sigmoid function and $f(X^{\\mathrm{weight}}_i) \\in R^{[N, 1]}$.\n\n$x_{i, d} \\hookleftarrow f(x_{i, 1:d}) x_{i, d} + x_{i, d}$\n\n$x_{i, d} \\hookleftarrow f(x_{1:n, d}) x_{i, d} + x_{i, d}$\n\nOriginal FLOPs of attention layer in tiny: 350M -> Now: ~20M.\n\nUsing attention is not a new idea in computer vision, \\citet{hu2018senet, li2019selective} use channel-wise attention to re-weight the importance of each channel.\nInspired by these works, we decompose the SoftMax attention into channel-wise and token\/pixel\/patch-wise attention. \nThe pytorch-style code is:\n\\begin{lstlisting}\n# Linear_1, Linear_2 : linear transform\n# Transform_1, Transform_2: \n# stacked full-connected layers with activation functions\n\n# reduce all token for each dimension\nx = Linear_1(x) * torch.sigmoid(Transform_1(x.mean(dim=1))) \n# reduce all hidden dimension for each token\nx = Linear_2(x) * torch.sigmoid(Transform_2(x.mean(dim=2))) \n\\end{lstlisting}\nIn this way, we re-weight each token and each dimension separately.\nThe decomposed channel-wise attention is similar to the channel-wise attentions \\citep{} which are widely-used in a bunch of computer vision tasks. \nWe build two baselines: 1) MLP layers without any attention 2) SoftMax-style self-attention.\n\n\\paragraph{Multi-head Patch-wise Attention} \nThe information between tokens is only ex-changed in the attention layer. Once we first do a average pooling operation, the expression of the token-level attention is limited. Thus, we create a multi-branch patch-wise attention by sum over several patch-wise attentions with different parameters.\n\n\\paragraph{Compare to Efficient Attentions} \nSparse attention usually has a $\\mathcal{O}(T \\log(T) N)$ time complexity, and linear attention has a $\\mathcal{O}(T N^2)$ complexity. \n\nFirst, we would like to see the performance of the decomposed attention.\nWhat is the next step? Further reducing the parameters in MLP layers, or discussing the value of different kind of attention (e.g. If we remove all the attentions, will the performance of the baseline drop a lot? If we only use token-wise attention, will it be much worse than SoftMax-style attention?)\n\n\\subsection{LN}\nIn the original VIT \\citep{} and DEIT \\citep{}, they use the pre-LayerNorm \\citep{} as:\n\n\\begin{lstlisting}\nx = x + self.drop_path(self.attn(self.norm1(x)))\nx = x + self.drop_path(self.mlp(self.norm2(x)))\n\\end{lstlisting}\n\nWe use the open-source code of DEIT \\footnote{\\url{https:\/\/github.com\/rwightman\/pytorch-image-models\/blob\/master\/timm\/models\/vision_transformer.py}}. \n\n\\subsection{Relative Position Information}\nThe relative position information can be added into the attention or outside. \n\nWe test three module, \n\n1) Relative Positional Embedding \\citep{}:\n\\begin{lstlisting}\nself.remb = nn.Parameter(torch.randn([197, embed_dim\/\/num_heads,197])*0.02)\ntrunc_normal_(self.remb,std=.02)\n \nrpos=q.permute(2,0,1,3).reshape(N,B*self.num_heads,C\/\/self.num_heads)@self.remb\nrpos=rpos.reshape(N,B,-1,N)\nattn=(q@k.transpose(-2,-1)+ rpos.permute(1,2,0,3))*self.scale\n\\end{lstlisting}\n2) MLP as an expansion block: change MLP Layer from Linear(192, 768)-Linear(768, 192) to MLP(192, 768)-Conv(input=192,output=192,groups=192)-MLP(192, 768). \n\n3) Adding a channel-wise conv layer before MLP layer to force local attention for the 14x14 patches.\nWe change the attention to \n\\begin{lstlisting}\nself.conv = torch.nn.Conv2d(in_channels=dim, \\ \nout_channels=dim, kernel_size=3, groups=dim, padding=1)\n\nx = x + self.drop_path(self.attn(self.norm1(x)))\nbatch_size, hidden, patch_length = x.shape[0], x.shape[-1], 224 \/\/ 16\nx[:, 1:, :] = x[:, 1:, :] + self.conv(x[:, 1:, :].transpose(1, 2) \\\n.reshape(batch_size, hidden, patch_length, patch_length))\\\n.reshape(batch_size, hidden, patch_length*patch_length).transpose(1, 2)\nx = x + self.drop_path(self.mlp(self.norm2(x)))\n\\end{lstlisting}\n\n\\begin{table}[h]\n \\centering\n \\begin{tabular}{cccc}\n \\hline\n Model & Params & Additional FLOPs & Accuracy \\\\\n \\hline\n Tiny DEIT & 5.7M & 0M & 72.2\\% \\\\\n \\hline\n + Relative Embedding & 8.2M & 178M & 72.3\\% \\\\\n + Conv in MLP & 5.7M & 16M & 72.5\\% \\\\\n + Conv outside MLP & 5.7M & 4M & \\bf{73.6\\%} \\\\\n \\hline\n \\end{tabular}\n \\caption{ImageNet.}\n \\label{tab:none}\n\\end{table}\n\n\n\\begin{figure}[ht]\n \\centering\n \\begin{tabular}{c}\n \\includegraphics[width=0.4\\textwidth]{figures\/vit_pos_emb.pdf} \n \\end{tabular}\n \\label{fig:vit_base}\n \\caption{Introducing learnanble positional embeddings.}\n\\end{figure}\n\n\n\n\\subsection{LayerNorm}\nIn NLP, the pre LayerNorm \\citep{xiong2020layer} can accelerate the training. However, the post norm (which is used in the original transformer) usually achieves better result. We have a test on it\n1) post LN :\n\\begin{lstlisting}\nx = self.norm1(x + self.drop_path(self.attn(x)))\nx = self.norm2(x + self.drop_path(self.mlp(x)))\n\\end{lstlisting}\n\n2) additional LN normalization:\n\\begin{lstlisting}\nattn_x = x + self.drop_path(self.attn(self.norm1(x)))\nx = attn_x + self.drop_path(self.mlp(self.norm2(attn_x)))\nx = self.norm3(x + attn_x)\n\\end{lstlisting}\n\n\\begin{table}[h]\n \\centering\n \\begin{tabular}{cccc}\n \\hline\n Model & Params & Additional FLOPs & Accuracy \\\\\n \\hline\n Tiny DEIT & 5.7M & 0M & 72.2\\% \\\\\n \\hline\n Post LN & 5.7M & 0M & 70.8\\% \\\\\n + Additional LN & 5.7M & ~0M & \\bf{72.4\\%} \\\\\n \\hline\n \\end{tabular}\n \\caption{ImageNet.}\n \\label{tab:none}\n\\end{table}\n\n\\subsection{MLP}\nIs where to put the MLP and to put how many MLP important?\nWe use a weight-shared MLP:\n\n\\begin{lstlisting}\nx = x + self.drop_path(self.attn(self.norm1(x)))\nfor mlp_index in range(num_mlp):\n x = x + self.drop_path(self.mlp(self.norm2(x))) \/n\n\\end{lstlisting}, \n\nand a weight-unshared MLP:\n\\begin{lstlisting}\nx = x + self.drop_path(self.attn(self.norm1(x)))\nfor mlp_index in range(num_mlp):\n x = x + self.drop_path(self.mlp[mlp_index](self.norm2[mlp_index](x))) \/ n\n\\end{lstlisting},\nto see whether there is difference. Notice that the original MLP(dim-hidden-dim) increase the hidden size to $4\\times$dimension size, we decrease the MLP hidden size to make the number of parameters the same.\n\nWe set the number of layer to 2 to do a test.\n\\begin{table}[h]\n \\centering\n \\begin{tabular}{cccc}\n \\hline\n Model & Params & Additional FLOPs & Accuracy \\\\\n \\hline\n Tiny DEIT & 5.7M & 0M & 72.2\\% \\\\\n \\hline\n Shared MLP & 5.7M & 500M & 72.4\\% \\\\\n Unshared MLP & 5.7M & 0M & \\bf{72.5\\%} \\\\\n \\hline\n \\end{tabular}\n \\caption{ImageNet.}\n \\label{tab:none}\n\\end{table}\n\n\\subsection{Initialization and Optimization}\nWe test Fixup and its followup \\citep{huang2020improving}, it does not have an impact on the final result. \n\n\\subsection{Hand-Crafted and NAS}\nWe combine these features to design a new network structure:\n\\begin{lstlisting}\nbatch_size, hidden, patch_length = x.shape[0], x.shape[-1], 224 \/\/ 16\nx[:, 1:, :] += Conv(x[:, 1:, :])\nx = self.norm1(x)\nx = x + 1. \/ 2 * self.drop_path(self.mlp1(x))\n\nx = self.norm2(x)\nx = x + self.drop_path(self.attn(x)) \n\nx[:, 1:, :] += Conv(x[:, 1:, :])\nx = self.norm3(x)\nx = x + 1. \/ 2 * self.drop_path(self.mlp(x))\nx = self.norm4(x)\n\\end{lstlisting}\n\nWe also use a DARTs-like NAS method to do a search. Note that in the search space, when we decide whether to use a module (e.g. LayerNorm, Conv) or Identity, we add a penalty on the Identity operator to avoid degenerate during searching.\n\n\\textbf{We not only achieve much better results, but also accelerate the training by a large margin (e.g. Training with 20 epochs on Tiny-DEIT, we improve the 25\\% top-1 accuracy baseline to 54\\%).}\n\n\\begin{table}[h]\n \\centering\n \\begin{tabular}{cccc}\n \\hline\n Model & Params & Additional FLOPs & Accuracy \\\\\n \\hline\n Tiny DEIT & 5.7M & 0M & 72.2\\% \\\\\n Human-Design & 5.7M & 8M & \\bf{74.2\\%} (not finished) \\\\\n NAS & 5.7M & 0M & \\bf{-} \\\\\n \\hline\n Small DEIT & 16.8M & 0M & 79.9\\% \\\\\n Human-Design & 16.8M & 16M & \\bf{81.1\\%} (not finished) \\\\\n NAS & 5.7M & 0M & \\bf{-} \\\\\n \\hline\n \\end{tabular}\n \\caption{ImageNet. \\textbf{Our result is even better than the DEIT with teacher model.}}\n \\label{tab:none}\n\\end{table}\n\n\n\\subsection{More...}\nThe next step is either designing a mobile-version or designing the attention module.\nLet us make a short version as a workshop paper first.\n\\section{Preliminaries: Vision Transformers}\n\nIn this section, we give a brief introduction \nto vision transformers~\\citep{dosovitskiy2020vit}.\nGiven a training example $(\\bm{x}, y)$, where $\\bm x$ and $y$ denote the input image and the label, respectively. \nA vision transformer first splits $\\bm x$ into a set of non-overlapping patches, i.e., $\\bm{x} = (x_1, \\cdots, x_n)$,\nwhere $x_i$ denotes a patch and $n$ is the total number of patches. \nEach patch $x_i$ is then transformed into a latent representation via a projection layer, and augmented with a position embedding. \nA learnable \\emph{class} patch is introduced to capture the label information. \nDuring training, a vision transformer model gradually transforms patch representations $\\bm{h}^{[\\ell]} = (h_{class}^{[\\ell]}, h_1^{[\\ell]}, \\cdots, h_n^{[\\ell]})$ with a stack of self-attention layers~\\citep{vaswani2017attention}. \nHere, $\\ell$ denotes the layer index and $h_{class}^{[\\ell]}$ and $h_i^{[\\ell]}$ denote the learned \\emph{class} patch and the image patch of $x_i$ at the $\\ell$-th layer, respectively.\nLet $L$ denote the total number of layers and $g$ denote a classification head. The vision transformer is trained by minimizing a classification loss $\\mathcal{L}(g(h_{class}^{[L]}), y)$. See Figure~\\ref{fig:oversmooth} (a) for an overview of vision transformers. It has been reported that the training of vision transformer can suffer from instability issue, especially for deep models \\citep{touvron2020training}.\n\\section{Introduction}\n\nPlease follow the steps outlined below when submitting your manuscript to\nthe IEEE Computer Society Press. This style guide now has several\nimportant modifications (for example, you are no longer warned against the\nuse of sticky tape to attach your artwork to the paper), so all authors\nshould read this new version.\n\n\\subsection{Language}\n\nAll manuscripts must be in English.\n\n\\subsection{Dual submission}\n\nPlease refer to the author guidelines on the ICCV 2021 web page for a\ndiscussion of the policy on dual submissions.\n\n\\subsection{Paper length}\nPapers, excluding the references section,\nmust be no longer than eight pages in length. The references section\nwill not be included in the page count, and there is no limit on the\nlength of the references section. For example, a paper of eight pages\nwith two pages of references would have a total length of 10 pages.\n{\\bf There will be no extra page charges for ICCV 2021.}\n\nOverlength papers will simply not be reviewed. This includes papers\nwhere the margins and formatting are deemed to have been significantly\naltered from those laid down by this style guide. Note that this\n\\LaTeX\\ guide already sets figure captions and references in a smaller font.\nThe reason such papers will not be reviewed is that there is no provision for\nsupervised revisions of manuscripts. The reviewing process cannot determine\nthe suitability of the paper for presentation in eight pages if it is\nreviewed in eleven. \n\n\\subsection{The ruler}\nThe \\LaTeX\\ style defines a printed ruler which should be present in the\nversion submitted for review. The ruler is provided in order that\nreviewers may comment on particular lines in the paper without\ncircumlocution. If you are preparing a document using a non-\\LaTeX\\\ndocument preparation system, please arrange for an equivalent ruler to\nappear on the final output pages. The presence or absence of the ruler\nshould not change the appearance of any other content on the page. The\ncamera ready copy should not contain a ruler. (\\LaTeX\\ users may uncomment\nthe \\verb'\\iccvfinalcopy' command in the document preamble.) Reviewers:\nnote that the ruler measurements do not align well with lines in the paper\n--- this turns out to be very difficult to do well when the paper contains\nmany figures and equations, and, when done, looks ugly. Just use fractional\nreferences (e.g.\\ this line is $095.5$), although in most cases one would\nexpect that the approximate location will be adequate.\n\n\\subsection{Mathematics}\n\nPlease number all of your sections and displayed equations. It is\nimportant for readers to be able to refer to any particular equation. Just\nbecause you didn't refer to it in the text doesn't mean some future reader\nmight not need to refer to it. It is cumbersome to have to use\ncircumlocutions like ``the equation second from the top of page 3 column\n1''. (Note that the ruler will not be present in the final copy, so is not\nan alternative to equation numbers). All authors will benefit from reading\nMermin's description of how to write mathematics:\n\\url{http:\/\/www.pamitc.org\/documents\/mermin.pdf}.\n\n\\subsection{Blind review}\n\nMany authors misunderstand the concept of anonymizing for blind\nreview. Blind review does not mean that one must remove\ncitations to one's own work---in fact it is often impossible to\nreview a paper unless the previous citations are known and\navailable.\n\nBlind review means that you do not use the words ``my'' or ``our''\nwhen citing previous work. That is all. (But see below for\ntech reports.)\n\nSaying ``this builds on the work of Lucy Smith [1]'' does not say\nthat you are Lucy Smith; it says that you are building on her\nwork. If you are Smith and Jones, do not say ``as we show in\n[7]'', say ``as Smith and Jones show in [7]'' and at the end of the\npaper, include reference 7 as you would any other cited work.\n\nAn example of a bad paper just asking to be rejected:\n\\begin{quote}\n\\begin{center}\n An analysis of the frobnicatable foo filter.\n\\end{center}\n\n In this paper we present a performance analysis of our\n previous paper [1], and show it to be inferior to all\n previously known methods. Why the previous paper was\n accepted without this analysis is beyond me.\n\n [1] Removed for blind review\n\\end{quote}\n\nAn example of an acceptable paper:\n\n\\begin{quote}\n\\begin{center}\n An analysis of the frobnicatable foo filter.\n\\end{center}\n\n In this paper we present a performance analysis of the\n paper of Smith \\etal [1], and show it to be inferior to\n all previously known methods. Why the previous paper\n was accepted without this analysis is beyond me.\n\n [1] Smith, L and Jones, C. ``The frobnicatable foo\n filter, a fundamental contribution to human knowledge''.\n Nature 381(12), 1-213.\n\\end{quote}\n\nIf you are making a submission to another conference at the same time,\nwhich covers similar or overlapping material, you may need to refer to that\nsubmission in order to explain the differences, just as you would if you\nhad previously published related work. In such cases, include the\nanonymized parallel submission~\\cite{Authors14} as additional material and\ncite it as\n\\begin{quote}\n[1] Authors. ``The frobnicatable foo filter'', F\\&G 2014 Submission ID 324,\nSupplied as additional material {\\tt fg324.pdf}.\n\\end{quote}\n\nFinally, you may feel you need to tell the reader that more details can be\nfound elsewhere, and refer them to a technical report. For conference\nsubmissions, the paper must stand on its own, and not {\\em require} the\nreviewer to go to a tech report for further details. Thus, you may say in\nthe body of the paper ``further details may be found\nin~\\cite{Authors14b}''. Then submit the tech report as additional material.\nAgain, you may not assume the reviewers will read this material.\n\nSometimes your paper is about a problem which you tested using a tool which\nis widely known to be restricted to a single institution. For example,\nlet's say it's 1969, you have solved a key problem on the Apollo lander,\nand you believe that the ICCV70 audience would like to hear about your\nsolution. The work is a development of your celebrated 1968 paper entitled\n``Zero-g frobnication: How being the only people in the world with access to\nthe Apollo lander source code makes us a wow at parties'', by Zeus \\etal.\n\nYou can handle this paper like any other. Don't write ``We show how to\nimprove our previous work [Anonymous, 1968]. This time we tested the\nalgorithm on a lunar lander [name of lander removed for blind review]''.\nThat would be silly, and would immediately identify the authors. Instead\nwrite the following:\n\\begin{quotation}\n\\noindent\n We describe a system for zero-g frobnication. This\n system is new because it handles the following cases:\n A, B. Previous systems [Zeus et al. 1968] didn't\n handle case B properly. Ours handles it by including\n a foo term in the bar integral.\n\n ...\n\n The proposed system was integrated with the Apollo\n lunar lander, and went all the way to the moon, don't\n you know. It displayed the following behaviours\n which show how well we solved cases A and B: ...\n\\end{quotation}\nAs you can see, the above text follows standard scientific convention,\nreads better than the first version, and does not explicitly name you as\nthe authors. A reviewer might think it likely that the new paper was\nwritten by Zeus \\etal, but cannot make any decision based on that guess.\nHe or she would have to be sure that no other authors could have been\ncontracted to solve problem B.\n\\medskip\n\n\\noindent\nFAQ\\medskip\\\\\n{\\bf Q:} Are acknowledgements OK?\\\\\n{\\bf A:} No. Leave them for the final copy.\\medskip\\\\\n{\\bf Q:} How do I cite my results reported in open challenges?\n{\\bf A:} To conform with the double blind review policy, you can report results of other challenge participants together with your results in your paper. For your results, however, you should not identify yourself and should not mention your participation in the challenge. Instead present your results referring to the method proposed in your paper and draw conclusions based on the experimental comparison to other results.\\medskip\\\\\n\n\\begin{figure}[t]\n\\begin{center}\n\\fbox{\\rule{0pt}{2in} \\rule{0.9\\linewidth}{0pt}}\n \n\\end{center}\n \\caption{Example of caption. It is set in Roman so that mathematics\n (always set in Roman: $B \\sin A = A \\sin B$) may be included without an\n ugly clash.}\n\\label{fig:long}\n\\label{fig:onecol}\n\\end{figure}\n\n\\subsection{Miscellaneous}\n\n\\noindent\nCompare the following:\\\\\n\\begin{tabular}{ll}\n \\verb'$conf_a$' & $conf_a$ \\\\\n \\verb'$\\mathit{conf}_a$' & $\\mathit{conf}_a$\n\\end{tabular}\\\\\nSee The \\TeX book, p165.\n\nThe space after \\eg, meaning ``for example'', should not be a\nsentence-ending space. So \\eg is correct, {\\em e.g.} is not. The provided\n\\verb'\\eg' macro takes care of this.\n\nWhen citing a multi-author paper, you may save space by using ``et alia'',\nshortened to ``\\etal'' (not ``{\\em et.\\ al.}'' as ``{\\em et}'' is a complete word.)\nHowever, use it only when there are three or more authors. Thus, the\nfollowing is correct: ``\n Frobnication has been trendy lately.\n It was introduced by Alpher~\\cite{Alpher02}, and subsequently developed by\n Alpher and Fotheringham-Smythe~\\cite{Alpher03}, and Alpher \\etal~\\cite{Alpher04}.''\n\nThis is incorrect: ``... subsequently developed by Alpher \\etal~\\cite{Alpher03} ...''\nbecause reference~\\cite{Alpher03} has just two authors. If you use the\n\\verb'\\etal' macro provided, then you need not worry about double periods\nwhen used at the end of a sentence as in Alpher \\etal.\n\nFor this citation style, keep multiple citations in numerical (not\nchronological) order, so prefer \\cite{Alpher03,Alpher02,Authors14} to\n\\cite{Alpher02,Alpher03,Authors14}.\n\n\\begin{figure*}\n\\begin{center}\n\\fbox{\\rule{0pt}{2in} \\rule{.9\\linewidth}{0pt}}\n\\end{center}\n \\caption{Example of a short caption, which should be centered.}\n\\label{fig:short}\n\\end{figure*}\n\n\\section{Formatting your paper}\n\nAll text must be in a two-column format. The total allowable width of the\ntext area is $6\\frac78$ inches (17.5 cm) wide by $8\\frac78$ inches (22.54\ncm) high. Columns are to be $3\\frac14$ inches (8.25 cm) wide, with a\n$\\frac{5}{16}$ inch (0.8 cm) space between them. The main title (on the\nfirst page) should begin 1.0 inch (2.54 cm) from the top edge of the\npage. The second and following pages should begin 1.0 inch (2.54 cm) from\nthe top edge. On all pages, the bottom margin should be 1-1\/8 inches (2.86\ncm) from the bottom edge of the page for $8.5 \\times 11$-inch paper; for A4\npaper, approximately 1-5\/8 inches (4.13 cm) from the bottom edge of the\npage.\n\n\\subsection{Margins and page numbering}\n\nAll printed material, including text, illustrations, and charts, must be kept\nwithin a print area 6-7\/8 inches (17.5 cm) wide by 8-7\/8 inches (22.54 cm)\nhigh.\n\nPage numbers should be included for review submissions but not for the \nfinal paper. Review submissions papers should have page numbers in the \nfooter with numbers centered and .75 inches (1.905 cm) from the bottom \nof the page and start on the first page with the number 1.\n\nPage numbers will be added by the publisher to all camera-ready papers \nprior to including them in the proceedings and before submitting the \npapers to IEEE Xplore. As such, your camera-ready submission should \nnot include any page numbers. Page numbers should automatically be \nremoved by uncommenting (if it's not already) the line\n\\begin{verbatim}\n\\end{verbatim}\nnear the beginning of the .tex file.\n\n\\subsection{Type-style and fonts}\n\nWherever Times is specified, Times Roman may also be used. If neither is\navailable on your word processor, please use the font closest in\nappearance to Times to which you have access.\n\nMAIN TITLE. Center the title 1-3\/8 inches (3.49 cm) from the top edge of\nthe first page. The title should be in Times 14-point, boldface type.\nCapitalize the first letter of nouns, pronouns, verbs, adjectives, and\nadverbs; do not capitalize articles, coordinate conjunctions, or\nprepositions (unless the title begins with such a word). Leave two blank\nlines after the title.\n\nAUTHOR NAME(s) and AFFILIATION(s) are to be centered beneath the title\nand printed in Times 12-point, non-boldface type. This information is to\nbe followed by two blank lines.\n\nThe ABSTRACT and MAIN TEXT are to be in a two-column format.\n\nMAIN TEXT. Type main text in 10-point Times, single-spaced. Do NOT use\ndouble-spacing. All paragraphs should be indented 1 pica (approx. 1\/6\ninch or 0.422 cm). Make sure your text is fully justified---that is,\nflush left and flush right. Please do not place any additional blank\nlines between paragraphs.\n\nFigure and table captions should be 9-point Roman type as in\nFigures~\\ref{fig:onecol} and~\\ref{fig:short}. Short captions should be centered.\n\n\\noindent Callouts should be 9-point Helvetica, non-boldface type.\nInitially capitalize only the first word of section titles and first-,\nsecond-, and third-order headings.\n\nFIRST-ORDER HEADINGS. (For example, {\\large \\bf 1. Introduction})\nshould be Times 12-point boldface, initially capitalized, flush left,\nwith one blank line before, and one blank line after.\n\nSECOND-ORDER HEADINGS. (For example, { \\bf 1.1. Database elements})\nshould be Times 11-point boldface, initially capitalized, flush left,\nwith one blank line before, and one after. If you require a third-order\nheading (we discourage it), use 10-point Times, boldface, initially\ncapitalized, flush left, preceded by one blank line, followed by a period\nand your text on the same line.\n\n\\subsection{Footnotes}\n\nPlease use footnotes\\footnote {This is what a footnote looks like. It\noften distracts the reader from the main flow of the argument.} sparingly.\nIndeed, try to avoid footnotes altogether and include necessary peripheral\nobservations in\nthe text (within parentheses, if you prefer, as in this sentence). If you\nwish to use a footnote, place it at the bottom of the column on the page on\nwhich it is referenced. Use Times 8-point type, single-spaced.\n\n\\subsection{References}\n\nList and number all bibliographical references in 9-point Times,\nsingle-spaced, at the end of your paper. When referenced in the text,\nenclose the citation number in square brackets, for\nexample~\\cite{Authors14}. Where appropriate, include the name(s) of\neditors of referenced books.\n\n\\begin{table}\n\\begin{center}\n\\begin{tabular}{|l|c|}\n\\hline\nMethod & Frobnability \\\\\n\\hline\\hline\nTheirs & Frumpy \\\\\nYours & Frobbly \\\\\nOurs & Makes one's heart Frob\\\\\n\\hline\n\\end{tabular}\n\\end{center}\n\\caption{Results. Ours is better.}\n\\end{table}\n\n\\subsection{Illustrations, graphs, and photographs}\n\nAll graphics should be centered. Please ensure that any point you wish to\nmake is resolvable in a printed copy of the paper. Resize fonts in figures\nto match the font in the body text, and choose line widths which render\neffectively in print. Many readers (and reviewers), even of an electronic\ncopy, will choose to print your paper in order to read it. You cannot\ninsist that they do otherwise, and therefore must not assume that they can\nzoom in to see tiny details on a graphic.\n\nWhen placing figures in \\LaTeX, it's almost always best to use\n\\verb+\\includegraphics+, and to specify the figure width as a multiple of\nthe line width as in the example below\n{\\small\\begin{verbatim}\n \\usepackage[dvips]{graphicx} ...\n \\includegraphics[width=0.8\\linewidth]\n {myfile.eps}\n\\end{verbatim}\n}\n\n\\subsection{Color}\n\nPlease refer to the author guidelines on the ICCV 2021 web page for a discussion\nof the use of color in your document.\n\n\\section{Final copy}\n\nYou must include your signed IEEE copyright release form when you submit\nyour finished paper. We MUST have this form before your paper can be\npublished in the proceedings.\n\n{\\small\n\\bibliographystyle{ieee_fullname}\n\n\\section{Conclusion}\nIn this paper, we \nencourage diversified patch representations\n when training image transformers. \nWe address the problem by \nproposing three losses.\nEmpirically, without changing the transformer model structure, \nby making patch representations diverse, \nwe are able to train larger, deeper models and obtain better performance on image classification tasks.\nApplying our pretrained model to semantic segmentation tasks, we obtain SOTA results on two popular datasets, ADE20K and Cityscapes.\n\nFor future works,\nwe plan to study how to encourage diversified patch representations for different tasks. \nWe will also incorporate the proposed loss into self-supervised learning settings, and study if the transformer model can serve as a better self-supervised learner for computer vision tasks when the patch representations are more diverse.\n\n\n\\section{Related Works and Discussions}\n\n\\paragraph{Transformers for image classification}\nTransformers~\\citep{vaswani2017attention} have achieved great success in natural language understanding~\\citep{devlin2018bert, radford2019language}, which motivates recent works in adapting transformers to computer vision.\nFor example, iGPT~\\citep{chen2020generative} views an image as a long sequences of pixels and successfully trains transformers to generate realistic images;\n\\citet{dosovitskiy2020vit} splits each image into a sequence of patches\nand achieves competitive performance on challenging ImageNet when pretraining on a large amount of data; \n\\citet{touvron2020training} leverages knowledge distillation to improve the training efficacy of vision transformers and achieves better speed vs. accuracy on ImageNet compared to EfficientNets. \n\nRecently, a variety of works focus on improving vision transformers by \nintroducing additional convolutional layers to take advantage of the benefits of inductive bias of CNNs, e.g., \n\\citep{han2021transformer, liu2021swin, wu2021cvt, zhou2021deepvit, jiang2021token, touvron2021going, valanarasu2021medical, arnab2021vivit, xie2021sovit, yuan2021tokens}.\nAmong them, \nLV-ViT~\\citep{jiang2021token} is most related to our work, \nLV-ViT~\\citet{jiang2021token} also introduces patch-wise auxiliary loss for training, which is equivalent to our \\emph{patch-wise mixing loss}; \nLV-ViT is a concurrent work of our submission.\nCompared to LV-ViT, our method focuses on improving the patch diversity of vision transformers, which is motivated from a very different perspective. \n\n\\paragraph{Diverse representations in CNNs}\nIn CNNs, the diverse representation often refers to feature diversity across different channels \\citep[e.g.][]{lee2018diverse, liu2018learning}.\nIn vision transformers, patches could be viewed as feature vectors from different spatial locations in CNNs. \nCNNs' feature maps at different spatial locations are naturally diversified as only local operators are used. \nTransformers, on the other hand, use global attention to fuse features across the different locations, and tends to learn similar presentations without regularization.\n\n\n\\paragraph{Limitations and negative societal impacts}\nFor the limitation part, \nin this work, we mainly focus on vision transformer. Therefore, our method can only be applied to transformer models with images as input. \nCurrently, we only focus on supervised learning problems, and do not study unsupervised or semi-supervised learning. \nAlthough our work has positive impact for the research community, we also have potential negative social impacts.\nOnce we open-source our model checkpoints and code, we will have no control of anyone who can get access to the code and model checkpoints.\n\n\n\\section{Vision Transformers}\n\n\\begin{figure}[ht]\n \\centering\n \\begin{tabular}{c}\n \\includegraphics[width=0.4\\textwidth]{figures\/vit_base.pdf} \n \\end{tabular}\n \\label{fig:vit_base}\n \\caption{Overview of basic vision transformer.}\n\\end{figure}\n\n\n\n\\section{Experiments}\n\\label{sec:experiment}\n\nIn this section, we apply our method to improve the training of a variety of \nvision transformers, including DeiT \\citep{touvron2020training} and SWIN-Transformer \\citep{liu2021swin}, and evaluate on a number of image classification and semantic segmentation benchmarks. \nWe show that our training strategy promotes patch diversification and \nlearns transformers with significantly better transfer learning performance on downstream semantic segmentation tasks.\n\n\n\n\n\\begin{table}[t]\n \\centering\n \\setlength{\\tabcolsep}{2pt}\n \n \\begin{tabular}{l|l|c|c|c|c}\n \\hline \n & Method & \\# Params (M) & Input Size & $+$ Conv & Top-1 (\\%) \\\\ \n \\hline\n \\hline\n \\multirow{6}{*}{CNNs} \n & ResNet-152 \\scriptsize{\\citep{he2016deep}} & 230 & 224 &$\\checkmark$ & 78.1 \\\\\n & DenseNet-201 \\scriptsize{\\citep{huang2017densely}} & 77 & 224 & $\\checkmark$ & 77.6 \\\\\n & EffNet-B8 \\scriptsize{\\citep{gong2020maxup}} & 87 & 672 &$\\checkmark$ & 85.8 \\\\\n & EffNetV2-L \\scriptsize{\\citep{tan2021efficientnetv2}} & 121 & 384 &$\\checkmark$ & 85.7 \\\\\n &NFNet \\scriptsize{\\citep{brock2021high}} & 438 & 576 &$\\checkmark$ & 86.5 \\\\\n & LambdaNet-420 \\scriptsize{\\citep{bello2021lambdanetworks}} & 87 & 320 &$\\checkmark$ & 84.9 \\\\\n \\hline\n \\hline\n \\multirow{2}{*}{CNNs + } \n \n \n \n \n & CVT-21 \\scriptsize{\\citep{wu2021cvt}} & 32 & 224 & $\\checkmark$ & 82.5 \\\\\n \\multirow{2}{*}{Transformers} \n & CVT-21 & 32 & 384 & $\\checkmark$ & 83.3 \\\\\n \\cline{2-6}\n & LV-ViT-M \\scriptsize{\\citep{jiang2021token}} & 56 & 224 & $\\checkmark$ & 84.0 \\\\\n & LV-ViT-L & 150 & 448 & $\\checkmark$ & 85.3 \\\\\n \\hline\n \\hline\n \\multirow{6}{*}{DeiT {(scratch)}} & DeiT-Small12 \\scriptsize{\\citep{touvron2020training}} & \\multirow{ 2}{*}{22} & \\multirow{ 2}{*}{224} & \\multirow{ 2}{*}{$\\times$} & 80.4 \\\\\n & + \\bf{{\\bf DiversePatch (ours)}} & & & & \\bf{81.2} \\\\\n \\cline{2-6}\n & DeiT-Small24 & \\multirow{ 2}{*}{44} & \\multirow{ 2}{*}{224} & \\multirow{ 2}{*}{$\\times$} & 80.3 \\\\\n & + {\\bf DiversePatch (ours)} & & & & \\bf{82.2} \\\\\n \\cline{2-6}\n & DeiT-Base12 & \\multirow{ 2}{*}{86} & \\multirow{ 2}{*}{224} & \\multirow{ 2}{*}{$\\times$} & 82.1 \\\\\n & + {\\bf DiversePatch (ours)} & & & & \\bf{82.9} \\\\\n \\cline{2-6}\n & DeiT-Base24 & \\multirow{2}{*}{172} & \\multirow{ 2}{*}{224} & \\multirow{2}{*}{$\\times$} & 82.1 \\\\\n & + {\\bf DiversePatch (ours)}& & & & \\bf{83.3} \\\\\n \n \\cline{2-6}\n & DeiT-Base12 & \\multirow{2}{*}{86} & \\multirow{ 2}{*}{384} & \\multirow{2}{*}{$\\times$} & 83.6 \\\\\n & + {\\bf DiversePatch (ours)} & & & & \\bf{84.2} \\\\\n \\hline\n \\hline\n \\multirow{4}{*}{SWIN {(finetune)}} & SWIN-Base \\scriptsize{\\citep{liu2021swin}} & \\multirow{2}{*}{88} & \\multirow{ 2}{*}{224} & \\multirow{2}{*}{$\\times$} & 83.4 \\\\\n & +{\\bf DiversePatch (ours)} & & & & \\bf{83.7} \\\\\n \\cline{2-6}\n & SWIN-Base & \\multirow{2}{*}{86} & \\multirow{ 2}{*}{384} & \\multirow{2}{*}{$\\times$} & 84.5 \\\\ \n & + {\\bf DiversePatch (ours)} & & & & \\bf{84.7} \\\\ \n \n \n \n \\hline\n \\hline\n \\end{tabular}\n \n \\caption{Top-1 accuracy results on ImageNet. We train all DeiT based models from scratch for 400 epochs. For SWIN-Transformer based models, we finetune from existing checkpoints for 30 epochs.\n Results without any extra data are reported.\n \n }\n \\label{tab:main_result}\n\\end{table}\n\n\\subsection{Main Results on ImageNet}\n\\label{sec:exp_imagenet}\n\nWe use DeiT~\\citep{touvron2020training} and SWIN transformers~\\citep{liu2021swin} as our baseline models, and improving these models by incorporating our patch diversification-promoting losses to the training procedure.\n\n\\paragraph{Settings}\nFor DeiT based models, \nwe closely follow the training settings provided in \\citet{touvron2020training}~\\footnote{\\url{https:\/\/github.com\/facebookresearch\/deit}}.\nWe train all DeiT baselines and our models for 400 epochs. \nWe use stochastic depth dropout and linearly increase the depth dropout ratio from 0 to .5 following ~\\citet{huang2016deep}. \nAdditionally, \nwe use stochastic depth dropout ratio of 0.5 for DeiT-Base24 and DeiT-Small24, \nwhich allows us to train deeper DeiT models without diverging. \nFor our method, we remove \\emph{MixUp} \\citep{zhang2017mixup} \nand repeated data augmentation \\citep{hoffer2020augment} as they are not compatible with our \\emph{path-wise mixing loss}. Detailed ablation study is in Section \\ref{sec:ablation}. \n\n\nFor SWIN transformers, we use the official code for training, evaluation and finetuning \\footnote{\\url{https:\/\/github.com\/microsoft\/Swin-Transformer}}.\nSpecifically, we download the official SWIN-Base models pretrained with resolution of $224\\times 224$ and $384\\times 384$, respectively.\nWe further finetune them for another 30 epochs with or without our patch diversification losses.\nIn particular, we use a batch size of 1024 (128 X 8 GPUS), a constant learning rate of $10^{-5}$ and a weight decay of $10^{-8}$ for finetuning.\n\n\n\n\\paragraph{Results on ImageNet}\n\nAs demonstrated in Table \\ref{tab:main_result}, for all the model architectures we evaluated, \nour method leads to consistent improvements upon its corresponding baseline model. For example, for DeiT based models, \nwe improve the top-1 accuracy of DeiT-Small12 from 80.4\\% to 81.2\\%,\nand improve the top-1 accuracy of DeiT-Base12 from 82.1\\% to 82.9\\%.\nA similar trend can also been for SWIN based models.\n\nAdditionally, our method allows us to train more accurate vision transformers by simply stacking more layers. \nNaive training of DeiT models cannot benefit from larger and deeper models due to rapid patch representation degradation throughout the networks. \nAs we can see from Table~\\ref{tab:main_result}, with standard training, the results from DeiT-Small24 and DeiT-Base24 are not better than the results from DeiT-Small12 and DeiT-Base12;\non the other hand, our method alleviates over-smoothing and learns more diversified patch features, enabling further improvements to the large model regime. Specifically, our method achieves 82.2\\% and 83.3\\% top-1 accuracy for DeiT-Small24 and DeiT-Base24, respectively, which are \n$1.9\\%$ and $1.2\\%$ higher compared to their corresponding DeiT baselines.\n\nTo further verify reproducibility of our results, we run DeiT-Base12 for three trials,\nachieving top-1 accuracy of 82.86\\%, 82.82\\%, 82.89\\%; the round to round performance variant is negligible and the \\emph{s.t.d} is smaller than 0.1.\n\n\\begin{wrapfigure}{r}{0.5\\textwidth}\n\\centering\n\\vspace{-1.2em}\n\\begin{tabular}{c}\n\\raisebox{1.1em}{\\rotatebox{90}{{Avg. Cosine similarity}}} \n\\includegraphics[width=0.45\\textwidth]{figures\/cos_combined_res.pdf} \\\\\n{{Block Index~~~~~~~~~~~~~~~~~~~~~}} \\\\ \n\\end{tabular}\n\\vspace{-1.2em}\n\\caption{Comparison on average patch-wise absolute cosine similarity.\n}\n\\vspace{-1.2em}\n\\label{fig:exp_ours_cosine_sim}\n\\end{wrapfigure}\nFollowing the studies in Section~\\ref{sec:study}, \nwe plot the patch-wise absolute cosine similarity for the patch features learned by our method in Figure~\\ref{fig:exp_ours_cosine_sim}. As shown in Figure~\\ref{fig:exp_ours_cosine_sim}, \nthe patch-wise absolute cosine similarity is reduced significantly for both DeiT-Base24 and SWIN-Base;\nthe cosine similarity among the learned patches \nin the last layer is similar to the result from the ResNet-50 baseline.\n\n\n\nWe also compare with recently proposed CNN and transformer hybrids in Table~\\ref{tab:main_result},\nincluding CVT \\citep{wu2021cvt} and LV-ViT \\citep{jiang2021token}. \nThese hybrid models introduce additional convolution layers to both the patch projection layers and self-attention layers, and achieve better classification accuracy on ImageNet compared to pure transformers like DeiT and SWIN-transformers. \nThese hybrid approaches are non-conflict to our method, and we will further study the diverse patch representations in these architectures and apply our method to them.\n\n\\iffalse\n\\subsection{Ablation Studies}\n\\label{subsec:ablation}\n\\paragraph{Training Technique Analysis}\nWe represent a detailed analysis and ablation study of our training techniques in Table \\ref{tab:deit_base_ablation}.\nWe first observe that, \ncompared to standard DeiT-Base model, \nboth patch contrastive loss and patch mixing loss can boost the performance, while combining these two losses achieve better performance (82.6\\% top-1 accuracy).\nInspired by \\citet{touvron2021going}, \nwe further introduce the talking-head attention into our models and training the model for a longer time, and further improve the results to 82.9\\% top-1 accuracy.\nUsing a deeper model and scale up the image resolution, the performance can be further improved.\n\\fi\n\n\n\\paragraph{Results with ImageNet-22K Pre-training}\n\nWe also fine-tune ViT-Large models \\citep{dosovitskiy2020vit} and SWIN-Large models that are pretrained on ImageNet-22K \\citep{russakovsky2015imagenet} to further push the limits of accuracy on ImageNet.\nImageNet-22k contains 22k classes and 14M images. \nSpecifically, we directly download the ImageNet-22K pre-trained models provided in ViT and SWIN-Transformer and finetune \nthese checkpoints on ImageNet training set with 30 epochs, \na batch size of 1024, a constant learning rate of $10^{-5}$ and a weight decay of $10^{-8}$.\n\nTable~\\ref{tab:imagenet22k} shows the finetuning accuracy on ImageNet.\nOur method again leads consistent improvements across all evaluated settings. Specifically, we improve the VIT-Large top-1 accuracy from 85.1\\% to 85.3\\% and archive 87.4\\% top-1 accuracy with SWIN-Large. \nAs a future work, we will further pretrain the models on ImageNet-22k with our method to see whether the improvement is larger.\n\n\n\\begin{table}[ht]\n \\centering\n \\setlength{\\tabcolsep}{6pt}\n \\begin{tabular}{l|c|c}\n \\hline \n Model & Input Size & Top-1 Acc (\\%)\\\\ \n \\hline \n VIT-Large \\scriptsize{\\citep{dosovitskiy2020vit}} & 224 & 83.6 \\\\\n + {\\bf DiversePatch (ours)} & 224 & \\bf{83.9}\\\\\n \\hline\n VIT-Large & 384 & 85.1\\\\\n + {\\bf DiversePatch (ours)} & 384 & \\bf{85.3}\\\\\n \\hline\n SWIN-Large + ImageNet22k & 384 & 87.3 \\\\ \n + {\\bf DiversePatch (ours)} & 384 & \\bf{87.4} \\\\\n \\hline\n \\end{tabular}\n \\caption{\n Results on ImageNet by finetuing from ImageNet-22K pretrained vision transformers. \n \n \n }\n \\label{tab:imagenet22k}\n\\end{table}\n\n\n\\subsection{Transfer Learning on Semantic Segmentation}\n\\label{sec:exp_segment}\nSemantic segmentation requires a backbone network to extract representative and diversified features from the inputs; the downstream semantic segmentation performance critically relies on the quality of the extracted features. \nIn this section, we use SWIN-Base pretrained on ImageNet (see Table~\\ref{tab:main_result}) and SWIN-large pretrained on both ImageNet22k and ImageNet (see Table~\\ref{tab:imagenet22k}) as our backbone models and finetune them on two widely-used semantic segmentation datasets, ADE20K \\citep{zhou2017scene} and Cityscapes \\citep{cordts2016cityscapes}, to verify the transferability our pretrained models.\n\nIn particular, we show the backbone models trained with our diversity-promoting losses are especially helpful for downstream segmentation tasks. By using our pretrained SWIN-Large ($87.4\\%$ top-1 accuracy), our results outperform all existing methods and establish a new state-of-the-art on ADE20K and the Cityscapes validation dataset, achieving mIOU of {54.5\\%} and {83.6\\%} mIoU, respectively. \n\n\\paragraph{Datasets}\nADE20K \\citep{zhou2017scene} is a large scene parsing dataset, covering 150 object and stuff categories. ADE-20K contains 20K images for training, 2K images for validation, and 3K images for test images.\nCityscapes \\citep{cordts2016cityscapes} dataset labels 19 different categories (with an additional unknown class) and consists of 2975 training images, 500 validation images and 1525 testing images. \nWe do evaluation on the ADE20K and Cityscapes validation set in this paper.\n\n\\paragraph{Baselines}\nWe introduce both state-of-the-art CNNs \\citep[e.g.][]{xiao2018unified, zhang2020resnest, wang2020hr, bai2020multiscale} and recent proposed transformer models \\citep[e.g.][]{liu2021swin, zheng2020rethinking, ranftl2021vision} as our baselines.\n\n\\paragraph{Settings} \nWe closely follow the finetuning settings proposed in SWIN transformers~\\citep{liu2021swin} \\footnote{\\url{https:\/\/github.com\/SwinTransformer\/Swin-Transformer-Semantic-Segmentation}}. \nSpecifically, \nwe use UperNet \\citep{xiao2018unified} in \\emph{mmsegmentation} \\citep{mmseg2020} as our testbed.\nDuring training, we use AdamW \\citep{loshchilov2017decoupled} optimizer with a learning rate of $6\\times 10^{-5}$ and a weight decay of 0.01.\nWe use a cosine learning rate decay and a linear learning rate warmup of 1,500 iterations. \nWe finetune our models for 160K iterations and 80K iterations on ADE20K and Cityscapes training set, respectively.\nWe adopt the default data augmentation scheme in \\emph{mmsegmentation} \\citep{mmseg2020} \\footnote{\\url{https:\/\/github.com\/open-mmlab\/mmsegmentation}} and train with \n512$\\times$512 and 769$\\times$769 crop size for ADE20K and Cityscapes, respectively, following the default setting in \\emph{mmsegmentation}.\nAdditionally, \nfollowing SWIN transformers \\citep{liu2021swin}, we use a stochastic depth dropout of 0.3 for the first 80\\% of training iterations, and increase the dropout ratio to 0.5 for the last 20\\% of training iterations.\n\nFollowing SWIN transformers~\\citep{liu2021swin},\nwe report both the mIoUs from the single-scale evaluation and the mIoUs from the multi-scale flipping evaluation \\citep{zhang2018context}. \nSpecifically, for multi-scale flipping testing, we enumerate testing scales of \\{0.5, 0.75, 1.0, 1.25, 1.5, 1.75\\} and random horizontal flip by following common practices in the literature \\citep[e.g.][]{zhang2020resnest, liu2021swin, zheng2020rethinking}. \nThe images are evaluated at 2048$\\times$1024 and 2049$\\times$1025 for ADE20K and cityscapes, respectively.\n\n\n\\paragraph{Results}\n\nWe summarize our results in Table \\ref{tab:segmentation_ade20k} and Table \\ref{tab:segmentation_cityscape}.\nOur method improves the training of SWIN-Transformers and learns backbones capable of extracting more diversified features from the inputs, \nleading to new state-of-the-art segmentation performance on both ADE-20K and Cityscapes. Our achieve 54.5\\% mIoU on ADE-20K and 83.6\\% mIoU on the Cityscapes validation set, outperforming all existing approaches.\n\n\n\n\n\n\\begin{table}[ht]\n \\centering\n \\begin{tabular}{l|c|cc}\n \\hline \n Model & \\#Params (M) & mIoU (\\%) & mIoU (ms+flip) (\\%)\\\\ \n \\hline\n OCNet \\scriptsize{\\citep{yuan2019object}} & 56 & 45.5 & \\texttt{N\/A} \\\\\n UperNet \\scriptsize{\\citep{xiao2018unified}} & 86 & 46.9 & \\texttt{N\/A} \\\\\n ResNeSt-200 + DeepLab V3 & 88 & \\texttt{N\/A} & 48.4 \\\\\n SETR-Base\\scriptsize{\\citep{zheng2020rethinking}} & 98 & \\texttt{N\/A} & 48.3 \\\\\n SETR-Large \\scriptsize{\\citep{zheng2020rethinking}} & 308 & \\texttt{N\/A} & 50.3 \\\\\n DPT-ViT-Hybrid \\scriptsize{\\citep{ranftl2021vision}} & 90 & \\texttt{N\/A} & 49.0 \\\\\n DPT-ViT-Large \\scriptsize{\\citep{ranftl2021vision}} & 307 & \\texttt{N\/A} & 47.6 \\\\\n \\hline \n \\hline\n Swin-Base & 121 & 48.1 & 49.7 \\\\\n + {\\bf DiversePatch (ours)} & 121 & \\bf{48.4}\\scriptsize{$\\pm$0.2} & \\bf{50.1}\\scriptsize{$\\pm$0.2} \\\\\n \\hline\n Swin-Large & 234 & 52.0 & 53.5 \\\\\n + {\\bf DiversePatch (ours)} & 234 & \\bf{53.1}\\scriptsize{$\\pm$0.1} & \\bf{54.5}\\scriptsize{$\\pm$0.1} \\\\\n \\hline\n \\end{tabular}\n \\caption{State-of-the-art on ADE20K. \n \n \n `ms+flip' refers to mutli-scale testing with flipping \\citep{zhang2018context}, and `\\#Params' denotes the number of parameters.\n }\n \\label{tab:segmentation_ade20k}\n\\end{table}\n\n\n\\begin{table}[ht]\n \\centering\n \\begin{tabular}{l|c|cc}\n \\hline \n Model & \\#Params (M) & mIoU (\\%) & mIoU (ms+flip) (\\%)\\\\ \n \\hline \n OCNet \\scriptsize{\\citep{yuan2019object}} & 56 & 80.1 & \\texttt{N\/A} \\\\\n HRNetV2 + OCR \\scriptsize{\\citep{wang2020hr}} & 70 & 81.6 & \\texttt{N\/A} \\\\\n Panoptic-DeepLab \\scriptsize{\\citep{cheng2019panoptic}} & 44 & 80.5 & 81.5 \\\\\n Multiscale DEQ \\scriptsize{\\citep{bai2020multiscale}}& 71 & 80.3 & \\texttt{N\/A} \\\\\n ResNeSt-200 + DeepLab V3 & 121 & \\texttt{N\/A} & 82.7 \\\\\n SETR-Base\\scriptsize{\\citep{zheng2020rethinking}} & 98 & \\texttt{N\/A} & 78.1 \\\\\n SETR-Large \\scriptsize{\\citep{zheng2020rethinking}} & 308 & \\texttt{N\/A} & 82.1 \\\\\n \\hline\n \\hline\n Swin-Base & 121 & 80.4 & 81.5 \\\\\n + {\\bf DiversePatch (ours)} & 121 & \\bf{80.8}\\scriptsize{$\\pm$0.1} & \\bf{81.8}\\scriptsize{$\\pm$0.1} \\\\\n \\hline\n Swin-Large & 234 & 82.3 & 83.1 \\\\\n + {\\bf DiversePatch (ours)} & 234 & \\bf{82.7}\\scriptsize{$\\pm$0.2} & \\bf{83.6}\\scriptsize{$\\pm$0.1} \\\\\n \\hline\n \\end{tabular}\n \\caption{ State-of-the-art on the Cityscapes validation set. \n \n \n }\n \\label{tab:segmentation_cityscape}\n\\end{table}\n\n\n\n\n\n\n\n\n\n\\newcolumntype{C}{>{\\centering\\arraybackslash}m{2.3cm}}\n\\begin{table}[ht]\n \\centering\n \\setlength{\\tabcolsep}{4pt}\n \\begin{tabular}{CCC|C|C}\n \\hline \n Patch-wise cosine loss & Patch-wise contrastive loss & Patch-wise mixing loss & DeiT-Base24 (\\%) & Swin-Base ~~ (\\%) \\\\ \n \\hline \n \n $\\times$ & $\\times$ & $\\times$ & 82.1 & 83.4 \\\\\n \\hline \n $\\checkmark$ & $\\times$ & $\\times$ & 82.5 & 83.5\\\\\n $\\times$ & $\\checkmark$ & $\\times$ & 82.6 & \\texttt{N\/A} \\\\\n $\\times$ & $\\times$ & $\\checkmark$& 82.8 & 83.4\\\\\n \\hline\n $\\checkmark$ & $\\times$ & $\\checkmark$& 83.1 & \\bf{83.7} \\\\\n $\\checkmark$ & $\\checkmark$ & $\\times$ & 83.1 & \\texttt{N\/A} \\\\\n $\\times$ & $\\checkmark$ & $\\checkmark$ & \\bf{83.3} & \\texttt{N\/A} \\\\\n \n $\\checkmark$ & $\\checkmark$ & $\\checkmark$ & \\bf{83.3} & \\texttt{N\/A} \\\\\n \\hline\n \\end{tabular}\n \\caption{Ablating the impact of different combinations of our proposed patch diversification losses.\n }\n \\label{tab:loss_ablation}\n\\end{table}\n\n\n\n\n\\subsection{Ablation Studies}\n\\label{sec:ablation}\n\n\\paragraph{On the efficacy of our regularization strategies}\nOur method introduces three regularization terms to promote patch diversification. In this part, \nwe use DeiT-Base24 and SWIN-Base as our baseline models and ablate the effectiveness of our \\emph{patch-wise cosine loss}, \\emph{patch-wise contrastive loss} and \\emph{patch-wise mixing loss} by enumerating all different combination of training strategies. \nWe proceed by exactly following the training settings in section~\\ref{sec:exp_imagenet}.\nWe summarize our results in Table~\\ref{tab:loss_ablation}.\nAs we can see from Table~\\ref{tab:loss_ablation}, \nall diversification-promoting losses are helpful and \nall combinations lead to improved top-1 accuracy on ImageNet.\nSpecifically, \nwe improved DeiT-Base24 from 82.1\\% to 83.3\\% on top-1 accuracy by combing all three losses;\nfor SWIN-Base, we did not ablate the \\emph{patch-wise contrastive loss}, because the number of patches was reduced throughout the network due to down-sampling. In this case, we boost the top-1 accuracy from 83.5\\% and 83.7\\% by incorporating the \\emph{patch-wise cosine loss} and \\emph{patch-wise mixing loss} into the training procedure.\nAnd the patch representations learned by our method are particularly useful in down-stream semantic segmentation tasks, as demonstrated in section~\\ref{sec:exp_segment}.\n\n\n\n\\paragraph{On the stabilization of training}\nVision transformers are prone to overfitting, and training successful vision transformers often requires careful hyper-parameters tuning. \nFor example, DeiT uses a bag of tricks for stabilized training, including RandAugment~\\citep{cubuk2020randaugment}, MixUp~\\citep{zhang2017mixup}, CutMix~\\citep{yun2019cutmix}, random erasing~\\citep{zhong2020random},\nstochastic depth~\\citep{huang2016deep}, repeated augmentation~\\citep{hoffer2020augment}, etc.\nAs we shown in Table~\\ref{tab:ablate_deit_training}, \nremoving some of these training tricks leads to significant performance degradation for DeiT. While our patch-wise diversification losses offer a natural regularization to prevent overfitting, and may therefore leading to a more stabilized training process. \nThe models trained via our method yield consistently competitive results\nacross different training settings. \nAdditionally, we show our method could further benefit from more advanced design of talking-heads attentions~\\citep{shazeer2020talking}, longer training time and deeper architecture design, achieving consistent improvements upon our DeiT baselines. \n\n\n\n\n\\begin{table}[ht]\n \\centering\n \\setlength{\\tabcolsep}{12pt}\n \\begin{tabular}{l|cc}\n \\hline \n Model & DeiT-Base12 & DeiT-Base12 +{\\bf DiversePatch (ours)} \\\\ \n \\hline \n Standard (300 epochs) & 81.8 & 82.6 \\\\ \n + Talking Head & 81.8 & 82.7 \\\\\n \\hline \n - Repeat Augmentation & 78.4 & 82.7 \\\\\n - Random Erasing & 77.5 & 82.7 \\\\\n - Mixup & 80.3 & 82.7 \\\\\n - Drop Path & 78.8 & 80.2 \\\\ \n \\hline\n + 400 Epochs & 82.1 & 82.9 \\\\ \n + Depth (24 Layer) & 82.1 & 83.3 \\\\\n \\hline\n \\end{tabular}\n \\caption{\n More stabilized training of DeiT models with our patch diversification promoted losses.\n \n }\n \\label{tab:ablate_deit_training}\n\\end{table}\n\\section{Method}\n\nSome recent works (e.g. Transformer in Transformer, Token to Token Transformer, Centroid Transformer) focus on leverage prior knowledge to the transformer model by re-designing the structure.\nIn this work, however, we argue that the vanilla Transformer structure shown in Figure 1 is powerful enough and focus on let the model converges faster and generalizes better by introducing additional proxy loss (task).\n\n\n\\subsection{Predicting Relative Location for Patches}\nAn additional head to classify whether two patches are nearby or not at final layer.\n\n\\begin{table}[ht]\n \\centering\n \\begin{tabular}{l|c}\n \\hline \n Model & Top-1 accuracy \\\\ \\hline \n DEIT Tiny & 72.2 \\\\\n w\/ predicting location & 72.5 \\\\\n \\hline \n \\end{tabular}\n \\caption{Accuracy on ImageNet validation set. Marginal improvement, can not say anything.}\n \\label{tab:deit_reproduce}\n\\end{table}\n\n\\subsection{Predicting the Label for Each Patch (Learning to Segment Mixed Image)}\n\nSuppose we have two image-label pairs $(\\{x_{0, i}\\}, y_0)$ and $(\\{x_{1, i}\\}, y_1)$, \nwe mix the input patches as $\\{x_{\\text{mix}, i}\\}$ where $x_{\\text{mix}, i} = \\mathbb{I}(\\rho < \\lambda) x_{0, i} + \\mathbb{I}(\\rho \\geq \\lambda) x_{1, i}$ ($\\rho$ is sampled from a uniform distribution)\nand mix the label $y_{\\text{mix}} = \\lambda y_0 + (1 - \\lambda) y_1$.\nFor the last-layer patch $\\{h_{\\text{mix}, i}\\}$ we add an additional patch-level classification loss $\\{h_{\\text{mix}, i}, y_{\\text{mix}, i}\\}$. \nIn order to save computation cost, we average pooling the patch from the same image and then pass it through the additional patch-level classification loss. \n\nDuring evaluation, we do not use the additional proxy loss.\nWhen we mix two images and do not use proxy loss, this is cutmix.\n\n\\begin{lstlisting}\npatch_loss = 0\nfor _ in range(len(mask_lst)):\n avgpool_patches = (patches * mask_lst[_]).mean(dim=(2, 3))\n avgpool_logits = F.log_softmax(self.patch_head(avgpool_patches), dim=-1)\n patch_loss += nn.KLDivLoss()(avgpool_logits, target_lst[_])\n \n # patch_loss += nn.KLDivLoss()(avgpool_logits, target_lst[_]) \\\n # * target_lst[_].sum() \/ target_lst[_].size().sum()\n\\end{lstlisting}\n\n\\begin{table}[ht]\n \\centering\n \\begin{tabular}{l|c|c}\n \\hline \n Model & Top-1 accuracy & Test Loss\\\\ \\hline \n Cutmix + Mixup (Default) & 81.8 @ epoch300 & 0.838\\\\\n Cutmix (reported by DEIT) & 78.7 @ epoch300 & - \\\\\n Ours (mix two) & 80.8 @ epoch240 & - \\\\\n \\hline \n \\end{tabular}\n \\caption{DEIT-Base accuracy on ImageNet validation set. {\\color{red} {will be finished tomorrow, together with experiments on DEIT-small.}} }\n \\label{tab:deit_reproduce}\n\\end{table}\n\n\\paragraph{How to mix}\nRandomly selecting patches or selecting nearby patches like Cutmix.\n\n\\begin{table}[ht]\n \\centering\n \\begin{tabular}{l|c|c}\n \\hline \n Model & Top-1 accuracy & Test Loss\\\\ \\hline \n Cutmix + Mixup (Default) & 79.9 @ epoch300 & 0.882 \\\\\n Randomly Select Patches (mix two) & 80.5 @ epoch300 & 0.827 \\\\\n Select nearby Patches (mix two) & 80.9 @ epoch300 & 0.809\\\\\n \\hline\n Refine & 81.0 @ epoch300 & - \\\\\n \\hline \n \\end{tabular}\n \\caption{DEIT-Small accuracy on ImageNet validation set. `Refine' denotes removing repeat augmentation and adding stronger randaugment.}\n \\label{tab:deit_reproduce}\n\\end{table}\n\n\\paragraph{Mixing Rate}\nWe sample the mixing rate from $\\mathrm{Beta}(1, 1)$, and find out this regularization too strong for smaller models while too weak for larger models. \nWe need an ablation study here.\n\n\\paragraph{Which Layer}\nAdding the loss at intermediate layer. \n\n\\paragraph{Over-estimation}\nWe notice that with our loss, we achieve lower validation loss while the validation accuracy is the same. \nIt indicates that some prediction is over-estimated.\nThus, we add an additional reverse KL term in the loss as a regularization term. {\\color{red} {to do...}}\n\n\\paragraph{Self-supervision}\nThe proxy loss can be easily extended to a self-supervised version, in which we mix a bag of images and predicting whether two patches are from a same image.\nIn this way, \nthe analysis of the loss is similar to supervised-LDA. (let's say each image is a topic, each patch is a word, and learning the classification loss is to learn the allocation.) {\\color{red} {future work...}}\n\n\\paragraph{Next}\nStudy whether mixing more images is useful {\\color{red} {to do...}}\n\nWithout extra data, without extra teacher, we need to beat all the strong CNN models.\nThus, we can try two approaches:\n1) increasing the number of patches, 2) using larger models (e.g. VIT-Large).\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section*{Appendix \\thesection\\protect\\indent #1}\n \\addcontentsline{toc}{section}{Appendix \\thesection\\ \\ \\ #1}\n}\n\\newcommand\\encadremath[1]{\\vbox{\\hrule\\hbox{\\vrule\\kern8pt\n\\vbox{\\kern8pt \\hbox{$\\displaystyle #1$}\\kern8pt}\n\\kern8pt\\vrule}\\hrule}}\n\\def\\enca#1{\\vbox{\\hrule\\hbox{\n\\vrule\\kern8pt\\vbox{\\kern8pt \\hbox{$\\displaystyle #1$}\n\\kern8pt} \\kern8pt\\vrule}\\hrule}}\n\n\\newcommand\\figureframex[3]{\n\\begin{figure}[bth]\n\\hrule\\hbox{\\vrule\\kern8pt\n\\vbox{\\kern8pt \\vbox{\n\\begin{center}\n{\\mbox{\\epsfxsize=#1.truecm\\epsfbox{#2}}}\n\\end{center}\n\\caption{#3}\n}\\kern8pt}\n\\kern8pt\\vrule}\\hrule\n\\end{figure}\n}\n\\newcommand\\figureframey[3]{\n\\begin{figure}[bth]\n\\hrule\\hbox{\\vrule\\kern8pt\n\\vbox{\\kern8pt \\vbox{\n\\begin{center}\n{\\mbox{\\epsfysize=#1.truecm\\epsfbox{#2}}}\n\\end{center}\n\\caption{#3}\n}\\kern8pt}\n\\kern8pt\\vrule}\\hrule\\end{figure}\n}\n\n\\renewcommand{\\thesection}{\\arabic{section}}\n\\renewcommand{\\theequation}{\\arabic{section}-\\arabic{equation}}\n\\makeatletter\n\\@addtoreset{equation}{section}\n\\makeatother\n\\newtheorem{theorem}{Theorem}[section]\n\\newtheorem{conjecture}{Conjecture}[section]\n\\newtheorem{remark}{Remark}[section]\n\\newtheorem{proposition}{Proposition}[section]\n\\newtheorem{lemma}{Lemma}[section]\n\\newtheorem{corollary}{Corollary}[section]\n\\newtheorem{definition}{Definition}[section]\n\\newcommand{\\eq}[1]{eq.~(\\ref{#1})}\n\\def\\begin{remark}\\rm\\small{\\begin{remark}\\rm\\small}\n\\def\\end{remark}{\\end{remark}}\n\\def\\begin{theorem}{\\begin{theorem}}\n\\def\\end{theorem}{\\end{theorem}}\n\\def\\begin{definition}{\\begin{definition}}\n\\def\\end{definition}{\\end{definition}}\n\\def\\begin{proposition}{\\begin{proposition}}\n\\def\\end{proposition}{\\end{proposition}}\n\\def\\begin{lemma}{\\begin{lemma}}\n\\def\\end{lemma}{\\end{lemma}}\n\\def\\begin{corollary}{\\begin{corollary}}\n\\def\\end{corollary}{\\end{corollary}}\n\\def\\begin{eqnarray}{\\begin{eqnarray}}\n\\def\\end{eqnarray}{\\end{eqnarray}}\n\\newcommand{\\proof}[1]{{\\noindent \\bf proof:}\\par\n{#1} $\\bullet$}\n\n\\newcommand{{\\mathbb{R}}}{{\\mathbb{R}}}\n\\newcommand{{\\mathbb{C}}}{{\\mathbb{C}}}\n\\newcommand{{\\mathbb{Z}}}{{\\mathbb{Z}}}\n\\newcommand{\\bigskip \\noindent{\\bf Remarque: }}{\\bigskip \\noindent{\\bf Remarque: }}\n\\newcommand{\\refeq}[1]{eq.(\\ref{#1})}\n\n\\newcommand{\\rf}[1]{(\\ref{#1})}\n\\newcommand{\\rfig}[1]{fig.~\\ref{#1}}\n\n\\newcommand{\\equ}[2]{\\begin{equation}{\\label{#1}}{#2}\\end{equation}}\n\n\\newcommand{\\begin{equation}}{\\begin{equation}}\n\\newcommand{\\end{equation}}{\\end{equation}}\n\\newcommand{\\begin{eqnarray}}{\\begin{eqnarray}}\n\\newcommand{\\end{eqnarray}}{\\end{eqnarray}}\n\n\\newcommand\\eol{\\hspace*{\\fill}\\linebreak}\n\\newcommand\\eop{\\vspace*{\\fill}\\pagebreak}\n\n\\newcommand{\\hspace{0.7cm}}{\\hspace{0.7cm}}\n\\newcommand{\\vspace{0.7cm}}{\\vspace{0.7cm}}\n\n\\renewcommand{\\and}{{\\qquad {\\rm and} \\qquad}}\n\\newcommand{{\\qquad {\\rm where} \\qquad}}{{\\qquad {\\rm where} \\qquad}}\n\\newcommand{{\\qquad {\\rm with} \\qquad}}{{\\qquad {\\rm with} \\qquad}}\n\\newcommand{{\\qquad {\\rm for} \\qquad}}{{\\qquad {\\rm for} \\qquad}}\n\\newcommand{{\\qquad , \\qquad}}{{\\qquad , \\qquad}}\n\n\\newcommand{{\\it i.e.}\\ }{{\\it i.e.}\\ }\n\n\n\n\\newcommand{{\\,\\rm Det}} \\newcommand{{\\,\\rm Tr}\\:}{{\\,\\rm Tr}\\:}{{\\,\\rm Det}} \\newcommand{{\\,\\rm Tr}\\:}{{\\,\\rm Tr}\\:}\n\\newcommand{{\\,\\rm tr}\\:}{{\\,\\rm tr}\\:}\n\\newcommand{{\\,\\rm cte}\\,}{{\\,\\rm cte}\\,}\n\\newcommand{\\mathop{\\,\\rm Res\\,}}{\\mathop{\\,\\rm Res\\,}}\n\n\n\\newcommand{\\td}[1]{{\\tilde{#1}}}\n\n\\renewcommand{\\l}{\\lambda}\n\\newcommand{\\omega}{\\omega}\n\\newcommand{{\\cal P}}{{\\cal P}}\n\n\\newcommand{{\\mathrm{i}}}{{\\mathrm{i}}}\n\\newcommand{{\\,\\rm e}\\,}{{\\,\\rm e}\\,}\n\\newcommand{\\ee}[1]{{{\\rm e}^{#1}}}\n\n\\renewcommand{\\d}{{{\\partial}}}\n\\newcommand{{{\\hbox{d}}}}{{{\\hbox{d}}}}\n\\newcommand{\\dmat}[2]{\\mathrm{d}_{\\scriptscriptstyle{#1}}[#2]}\n\n\\newcommand{{\\int\\kern -1.em -\\kern-.25em}}{{\\int\\kern -1.em -\\kern-.25em}}\n\\newcommand{\\mathrm{Vol}}{\\mathrm{Vol}}\n\\newcommand{\\mathop{\\mathrm{Pol}}}{\\mathop{\\mathrm{Pol}}}\n\n\\newcommand{\\moy}[1]{\\left<{#1}\\right>}\n\n\\renewcommand{\\Re}{{\\mathrm{Re}}}\n\\renewcommand{\\Im}{{\\mathrm{Im}}}\n\n\\newcommand{{\\rm sn}}{{\\rm sn}}\n\\newcommand{{\\rm cn}}{{\\rm cn}}\n\\newcommand{{\\rm dn}}{{\\rm dn}}\n\\newcommand{\\ssq}[1]{{\\sqrt{\\sigma({#1})}}}\n\n\n\\newcommand{\\Sigma}{\\Sigma}\n\\newcommand{{\\overline\\Sigma}}{{\\overline\\Sigma}}\n\n\\renewcommand{\\l}{\\lambda}\n\\renewcommand{\\L}{\\Lambda}\n\\renewcommand{\\ssq}[1]{{\\sqrt{\\sigma({#1})}}}\n\\newcommand{\\overline}{\\overline}\n\\newcommand{{\\rm diag}}{{\\rm diag}}\n\\newcommand{{\\rm Cat}\\,}{{\\rm Cat}\\,}\n\n\n\\preprint{SPhT-T05\/037, hep-th\/0504029}\n\n\\title{Mixed correlation functions in the 2-matrix model, and the Bethe Ansatz}\n\n\\author{B.\\ Eynard, N. \\ Orantin \\\\\nService de Physique Th\\'eorique de Saclay, CEA\/DSM\/SPhT,\\\\\nUnit\\'e de Recherche associ\\'ee au CNRS (URA D2306), CEA Saclay,\\\\\nF-91191 Gif-sur-Yvette Cedex, France.\\\\\n E-mail: eynard@spht.saclay.cea.fr, orantin@spht.saclay.cea.fr}\n\n\\abstract{Using loop equation technics, we compute all mixed traces correlation functions of the 2-matrix model to large N leading order.\nThe solution turns out to be a sort of Bethe Ansatz, i.e. all correlation functions can be decomposed on products of 2-point functions.\nWe also find that, when the correlation functions are written collectively as a matrix, the loop equations are equivalent to commutation relations.}\n\n\\keywords{Matrix Models, Differential and Algebraic Geometry, Bethe Ansatz}\n\n\\begin{document}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\newsection{Introduction}\n\nFormal random matrix models have been used for their interpretation as combinatorial generating functions\nfor discretized surfaces \\cite{Mehta, BIPZ, ZJDFG}.\nThe hermitean one-matrix model counts surfaces made of polygons of only one color, whereas the hermitean\ntwo--matrix model counts surfaces made of polygons of two colors.\nIn that respect, the 2-matrix model is more appropriate for the purpose of studying surfaces with non-uniform\nboundary conditions.\nAt the continuum limit, the 2-matrix model gives access to ``boundary operators'' in conformal field theory \\cite{kostov}.\n\nGenerating functions for surfaces with boundaries are obtained as random matrix expectation values.\nThe expectation value of a product of $l$ traces is the generating function for surfaces with $l$ boundaries,\nthe total power of matrices in each trace being the length of the corresponding boundary.\nIf each trace contains only one type of matrix (different traces may contain different types of matrices),\nthe expectation value is the generating function counting surfaces with uniform boundary conditions.\nThose non-mixed expectation values have been computed for finite $n$ since the work of \\cite{eynardmehta, Mehta2} and refined by \\cite{Bergere1}.\n\nMixed correlation functions have been considered as a difficult problem for a long time and progress have been obtained only recently \\cite{BEmixed, eynprats}.\nIndeed, non-mixed expectation values can easily be written in terms of eigenvalues only (since the trace of a matrix is clearly related to its eigenvalues),\nwhereas mixed correlation functions cannot ($Tr M_1^k M_2^{k'}$ cannot be written in terms of eigenvalues of $M_1$ and $M_2$).\n\nThe large $N$ limit of the generating function of the bicolored disc (i.e. one boundary, two colors, i.e. $$) has\nbeen known since \\cite{kaz, eynchain, eynchaint}.\nThe large $N$ limit of the generating function of the 4-colored disc (i.e. one boundary, 4 colors, i.e. $$) has\nbeen known since \\cite{eynm2m}.\nThe all order expansion of correlation functions for the 1-matrix model has been obtained by a Feynman-graph representation in \\cite{eynloop1mat}\nand the generalization to non-mixed correlation functions of the 2-matrix model has been obtained in \\cite{eoloop2mat}.\n\nRecently, the method of integration over the unitary group of \\cite{eynprats} has allowed to compute, for finite $N$, all mixed correlation functions of the 2-matrix model\nin terms of orthogonal polynomials.\n\n\\smallskip\n\nThe question of computing mixed correlation functions in the large $N$ limit is addressed in the present article.\n\nThe answer is (not so) surprisingly related to classical results in integrable statistical models, i.e. the Bethe Ansatz.\nIt has been known for a long time that random matrix models are integrable in some sense (Toda, KP, KdV, isomonodromic systems,...),\nbut the relationship with Yang-Baxter equations and Bethe Ansatz was rather indirect.\nThe result presented in this article should give some new insight in that direction. We find that the $k$-point functions can be expressed\nas the product of 2-point function, which is the underlying idea of the Bethe Ansatz.\n\n\n\n\n\n\n\n\\bigskip\n\n{\\noindent \\bf Outline of the article:}\n\n- section 1 is an introduction,\n\n- in section 2, we set definitions of the model and correlation functions, and we write the relevant loop equations,\n\n- in section 3, we introduce a Bethe Ansatz-like formula, and prove it in section~4,\n\n- in section 5, we solve the problem under a matrix form,\n\n- section 6 is dedicated to the special Gaussian case.\n\n\\newsection{The 2-matrix model, definitions and loop equations}\n\n\\subsection{Partition function}\n\nWe are interested in the formal matrix integral:\n\\begin{equation}\\label{Zdef}\nZ:=\\int_{H_N^2} dM_1\\, dM_2\\, \\ee{-N{\\,\\rm Tr}\\:[V_1(M_1)+V_2(M_2)+M_1 M_2]}\n\\end{equation}\nwhere $M_1$ and $M_2$ are $N\\times N$ hermitean matrices and $dM_1$ (resp. $dM_2$) is the product of Lebesgue\nmeasures of all independent real components of $M_1$ (resp. $M_2$).\n$V_1(x)$ and $V_2(y)$ are complex polynomials of degree $d_1+1$ and $d_2+1$, called ``potentials''.\nThe formal matrix integral is defined as a formal power series in the coefficients of the potentials (see \\cite{ZJDFG}),\ncomputed by the usual Feynman method:\nconsider a local extremum of $\\ee{-N{\\,\\rm Tr}\\:[V_1(M_1)+V_2(M_2)+M_1 M_2]}$, and expand the non quadratic part\nas a power series and, for each term of the series, perform the Gaussian integration with the quadratic part.\nThis method does not care about the convergence of the integral, or of the series, it makes sense only order by order\nand it is in that sense that it can be interpreted as the generating function of discrete surfaces.\nAll quantities in that model have a well defined $1\/N^2$ expansion \\cite{thoft}.\n\nThe extrema of $V_1(x)+V_2(y)+xy$ are such that:\n\\begin{equation}\nV'_1(x)=-y {\\qquad , \\qquad} V'_2(y)=-x\n\\end{equation}\nthere are $d_1 d_2$ solutions (indeed $V'_2(-V'_1(x))=-x$), which we note $(\\overline{x}_I,\\overline{y}_I)$, \\eol\n$I=1,\\dots, d_1 d_2$.\nThe extrema of ${\\,\\rm Tr}\\:[V_1(M_1)+V_2(M_2)+M_1 M_2]$ can be chosen diagonal (up to a unitary transformation), with $\\overline{x}_I$'s and $\\overline{y}_I$'s on the diagonal:\n\\begin{eqnarray}\nM_1&=&{\\rm diag}(\n{\\stackrel{n_1\\,{\\rm times}}{\\overbrace{\\overline{x}_1,\\dots,\\overline{x}_1}}},\n{\\stackrel{n_2\\,{\\rm times}}{\\overbrace{\\overline{x}_2,\\dots,\\overline{x}_2}}},\n\\dots\n,{\\stackrel{n_{d_1 d_2}\\,{\\rm times}}{\\overbrace{\\overline{x}_{d_1 d_2},\\dots,\\overline{x}_{d_1 d_2}}}})\\cr\nM_2&=&{\\rm diag}(\n{\\stackrel{n_1\\,{\\rm times}}{\\overbrace{\\overline{y}_1,\\dots,\\overline{y}_1}}},\n{\\stackrel{n_2\\,{\\rm times}}{\\overbrace{\\overline{y}_2,\\dots,\\overline{y}_2}}},\n\\dots\n,{\\stackrel{n_{d_1 d_2}\\,{\\rm times}}{\\overbrace{\\overline{y}_{d_1 d_2},\\dots,\\overline{y}_{d_1 d_2}}}})\n\\end{eqnarray}\nThe extremum around which we perform the expansion is thus characterized by a set of filling fractions:\n\\begin{equation}\n\\epsilon_I = {n_I\\over N}\n{\\qquad , \\qquad}\n\\sum_{I=1}^{d_1 d_2} \\epsilon_I=1\n\\end{equation}\n\nTo summarize, let us say that the formal matrix integral is defined for given potentials and filling fractions.\n\nThe ``one-cut'' case is the one where one of the filling fractions is $1$, and all the others vanish.\nThis is the case where the Feynman expansion is performed in the vicinity of only one extremum.\n\n\\subsection{Enumeration of discrete surfaces}\n\nIt is well known that formal matrix integrals are generating functions for the enumeration of discrete surfaces \\cite{ZJDFG, BIPZ, Kazakov, courseynard}.\n\n\\smallskip\n\nFor instance, in the one-cut case (expansion near an extremum $\\overline{x},\\overline{y}$), one has:\n\\begin{equation}\n\\begin{array}{l}\n-\\ln{Z} =\\cr\n\\sum_{G} {1\\over \\#{\\rm Aut}(G)} N^{\\chi(G)} \\left({g_2\\over \\delta}\\right)^{n_{--}(G)}\\left({\\td{g}_2\\over \\delta}\\right)^{n_{++}(G)}\\left({-1\\over \\delta}\\right)^{n_{+-}(G)}\n\\prod_{i=3}^{d_1+1} g_i^{n_i(G)} \\prod_{i=3}^{d_2+1} \\td{g}_i^{\\td{n}_i(G)}\\cr\n\\end{array}\n\\end{equation}\nwhere the summation is over all finite connected closed discrete surfaces made of polygons of two signs (+ and -).\nFor such a surface (or graph) $G$, $\\chi(G)$ is its Euler characteristic, $n_i(G)$ is the number of $i$-gons carrying a $+$ sign, $\\td{n}_i(G)$ is the number of $i$-gons carrying a $-$ sign,\n$n_{++}(G)$ is the number of edges separating two $+$ polygons,\n$n_{--}(G)$ is the number of edges separating two $-$ polygons and $n_{+-}(G)$ is the number of edges separating two polygons of different signs.\n$\\#{\\rm Aut}(G)$ is the number of automorphisms of $G$.\n\nThe $g_i$'s, $\\td{g}_i$'s and $\\delta$ are defined as follows:\n\\begin{equation}\ng_k := \\left.{\\partial^k V_1(x)\\over \\partial x^k}\\right|_{x=\\overline{x}}\n{\\qquad , \\qquad}\n\\td{g}_k := \\left.{\\partial^k V_2(y)\\over \\partial x^k}\\right|_{x=\\overline{y}}\n{\\qquad , \\qquad}\n\\delta := g_2 \\td{g}_2-1\n\\end{equation}\n\nExample of a discrete surface:\n\\begin{equation}\n\\begin{array}{r}\n{\\epsfysize 6cm\\epsffile{surfdiscr.eps}}\n\\end{array}\n\\end{equation}\n\nIn the multicut case, i.e. with arbitrary filling fractions, matrix integrals can still be interpreted in terms of ``foams'' of surfaces,\nand we refer the reader to the appendix of \\cite{BDE} or to \\cite{eynhabilit} for more details.\n\n\\subsection{Enumeration of discrete surfaces with boundaries}\n\nSimilarly, given a sequence of signs $s_1,s_2,\\dots, s_k$, $s_i\\in{1,2}$, it is well known that the following quantity:\n\\begin{equation}\\label{Trdisc}\n\\left<{\\,\\rm Tr}\\:(\\prod_{i=1}^{k} M_{s_i})\\right>\n\\end{equation}\nis the generating function of discrete surfaces with one boundary of length $k$, whose signs of polygons on the edges are given by the sequence $(s_1,\\dots,s_k)$.\n\n\\medskip\nExample of a discrete surface with boundary $(++++++-----+++++------)$:\n\\begin{equation}\n\\begin{array}{lll}\n\\left<{\\,\\rm Tr}\\:(M_1^{6}M_2^{5}M_1^{5}M_2^{6})\\right> \\,\\,& =& \\,\\,\\, \\sum_G\\,\\,\\, {\\epsfysize 5cm\\epsffile{surfdiscr.eps}}\n\\end{array}\n\\end{equation}\n\nMore generally, an expectation value of a product of $n$ traces is the generating function for discrete surfaces with $n$ boundaries.\n\nIn this article, we are interested only in one boundary and to leading order in $N$, i.e. surfaces with the topology of a disc.\n\n\n\\subsection{Master loop equation and algebraic curve}\n\nLet us define:\n\\begin{equation}\nW(x):={1\\over N}\\left<{\\,\\rm Tr}\\:{1\\over x-M_1}\\right>\n{\\qquad , \\qquad}\n\\td{W}(y):={1\\over N}\\left<{\\,\\rm Tr}\\:{1\\over y-M_2}\\right>\n\\end{equation}\nwhere the expectation values are formally computed as explained in the previous section, with the weight\n$\\ee{-N{\\,\\rm Tr}\\:[V_1(M_1)+V_2(M_2)+M_1 M_2]}$.\n$W(x)$ (resp. $\\td{W}(y)$) is defined as a formal power series in its large $x$ (resp. large $y$) expansion,\nas well as in the expansion in the coefficients of the potentials.\n$W(x)$ (resp. $\\td{W}(y)$) is a generating function for surfaces with one uniform boundary, i.e. with only sign $+$ (resp. sign $-$)\npolygons touching the boundary by an edge:\n\\begin{equation}\n\\begin{array}{r}\nW(x)={\\epsfysize 2cm\\epsffile{disc+.eps}}\n{\\qquad , \\qquad}\n\\td{W}(y)={\\epsfysize 2cm\\epsffile{disc-.eps}}\n\\end{array}\n\\end{equation}\n\n\n\nWe also define the following formal series:\n\\begin{equation}\nY(x):=W(x)-V'_1(x)\n{\\qquad , \\qquad}\nX(y):=\\td{W}(y)-V'_2(y)\n\\end{equation}\n\nIn addition, we define:\n\\begin{equation}\nP(x,y):={1\\over N}\\left<{\\,\\rm Tr}\\:{V'_1(x)-V'_1(M_1)\\over x-M_1}{V'_2(y)-V'_2(M_2)\\over y-M_2}\\right>\n\\end{equation}\n\\begin{equation}\nU(x,y):={1\\over N}\\left<{\\,\\rm Tr}\\:{1\\over x-M_1}{V'_2(y)-V'_2(M_2)\\over y-M_2}\\right>+x+V'_2(y)\n\\end{equation}\n\\begin{eqnarray}\nU(x,y;x')&:=&\\left<{\\,\\rm Tr}\\:{1\\over x-M_1}{V'_2(y)-V'_2(M_2)\\over y-M_2}{\\,\\rm Tr}\\:{1\\over x'-M_1}\\right>\\cr\n&& - N^2 W(x') (U(x,y)-x-V'_2(y))\\cr\n\\end{eqnarray}\n\\begin{equation}\nE(x,y):=(V'_1(x)+y)(V'_2(y)+x)+P(x,y)-1\n\\end{equation}\nNotice that $U(x,y)$ and $U(x,y;x')$ are polynomials of $y$ (with degree at most $d_2-1$),\n $P(x,y)$ is a polynomial of both variables of degree ($d_1-1,d_2-1$) and $E(x,y)$ is a polynomial\nof both $x$ and $y$ of degree $(d_1+1,d_2+1)$.\n\nIt has been obtained in many articles \\cite{eynmultimat, staudacher, eynchain, eynchaint}, that:\n\\begin{equation}\nE(x,Y(x))={1\\over N^2} U(x,Y(x),x)\n\\end{equation}\nTo large $N$ leading order that equation reduces to an algebraic equation for $Y(x)$, called the ``Master loop equation'' \\cite{staudacher}:\n\\begin{equation}\nE(x,Y(x))=0\n\\end{equation}\n(similarly, one also has $E(X(y),y)=0$, which implies $Y\\circ X={\\rm Id}$, known as Matytsin's equation \\cite{matytsin}).\nThe coefficients of $E(x,y)$, i.e. of $P(x,y)$, are entirely determined by the conditions $\\oint_{{\\cal A}_i} ydx = 2i\\pi \\epsilon_i$\nfor a choice of irreducible cycles on the algebraic curve.\n\n\nThe properties of that algebraic equation have been studied in many works \\cite{eynmultimat, KazMar}. Here we assume that it is known.\n\n\n\n\n\\subsection{Correlation functions, definitions}\n\n\nWe define:\n\\begin{equation}\n \\overline{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k)\n:={1\\over N}\\left<{\\,\\rm Tr}\\:\\prod_{j=1}^k {1\\over x_j-M_1}{1\\over y_j-M_2}\\right>\n\\end{equation}\n\\begin{eqnarray}\n&& \\overline{U}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&:=& \\mathop{\\mathrm{Pol}}_{y_k} V'_2(y_k)\\, \\overline{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&=&{1\\over N}\\left<{\\,\\rm Tr}\\: {1\\over x_1-M_1}{1\\over y_1-M_2}\\,\\dots \\,{1\\over x_{k}-M_1}{V'_2(y_k)-V'_2(M_2)\\over y_k-M_2}\\right> \\cr\n\\end{eqnarray}\n\\begin{eqnarray}\n&& \\overline{P}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&:=& \\mathop{\\mathrm{Pol}}_{x_1} \\mathop{\\mathrm{Pol}}_{y_k} V'_1(x_1)\\, V'_2(y_k)\\, \\overline{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&=&{1\\over N}\\left<{\\,\\rm Tr}\\: {V'_1(x_1)-V'_1(M_1)\\over x_1-M_1}\\,{1\\over y_1-M_2}\\dots{1\\over x_k-M_1}\\,\\,{V'_2(y_k)-V'_2(M_2)\\over y_k-M_2}\\right> \\cr\n\\end{eqnarray}\n\\begin{equation}\nA_k(x_1,y_1,x_2,\\dots,x_k):={1\\over N}\\left<{\\,\\rm Tr}\\: {1\\over x_1-M_1}{1\\over y_1-M_2}\\dots{1\\over x_k-M_1}V'_2(M_2)\\right>\n\\end{equation}\n\nwhere $\\mathop{\\mathrm{Pol}}_x f(x)$ denotes the polynomial part at infinity of $f(x)$ (i.e. the positive part in the Laurent series for $x$ near infinity).\n\nThe functions $\\overline{W}_k$ are generating functions for discrete discs with all possible boundary conditions.\nOne can recover any generating function of type \\eq{Trdisc} by expanding into powers of the $x_i$'s and $y_i$'s.\n\n\\medskip\n\nFor convenience, we prefer to consider the following functions:\n\\begin{equation}\nW_k(x_1,y_1,x_2,\\dots,x_k,y_k):=\\overline{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k)+\\delta_{k,1}\n\\end{equation}\n\\begin{equation}\nU_k(x_1,y_1,x_2,\\dots,x_k,y_k):=\\overline{U}_k(x_1,y_1,x_2,\\dots,x_k,y_k)+\\delta_{k,1}(V'_2(y_k)+x_k)\n\\end{equation}\nand for $k>1$:\n\\begin{equation}\nP_k(x_1,y_1,x_2,\\dots,x_k,y_k):=\\overline{P}_k(x_1,y_1,x_2,\\dots,x_k,y_k)+{W}_{k-1}(x_{2},\\dots,x_k,y_1)\n\\end{equation}\n\nFor the smallest values of $k$, those expectation values can be found in the literature to large $N$ leading order:\n\n$\\bullet$ it was found in \\cite{eynchain,eynchaint, eynmultimat}:\n\\begin{equation}\\label{W1U1}\nW_1(x,y) = {E(x,y)\\over (x-X(y))(y-Y(x))}\n{\\qquad , \\qquad}\nU_1(x,y) = {E(x,y)\\over (y-Y(x))}\n\\end{equation}\n\n$\\bullet$ it was found in the appendix C of \\cite{eynm2m} (there is a change of sign, because the action in \\cite{eynm2m} was ${\\,\\rm e}\\,^{-N{\\,\\rm tr}\\:(V_1(M_1)+V_2(M_2)-M_1M_2)}$):\n\\begin{equation}\nW_2(x_1,y_1,x_2,y_2) = {W_1(x_1,y_1)W_1(x_2,y_2)-W_1(x_1,y_2)W_1(x_2,y_1)\\over (x_1-x_2)(y_1-y_2)}\n\\end{equation}\n\n$\\bullet$ For finite $N$, it was found in \\cite{BEmixed}, and with notations explained in \\cite{BEmixed}:\n\\begin{equation}\\label{BEmixedW1}\nW_1(x,y) = \\det{\\left(1_N+\\Pi_{N-1}{1\\over x-Q}{1\\over y-P^t}\\Pi_{N-1}\\right)}\n\\end{equation}\n\n$\\bullet$ For finite $N$, it was found in \\cite{eynprats} how to compute any mixed correlation function in terms of determinants involving biorthogonal polynomials, with a formula very similar to \\eq{BEmixedW1}.\n\n\\medskip\n\nHere, we shall find a formula for all $W_k$'s in the large $N$ limit.\n\n\n\\subsection{Loop equations}\n\nLoop equations are nothing but Schwinger--Dyson equations.\nThey are obtained by writing that an integral is invariant under a change of variable,\nor alternatively by writing that the integral of a total derivative vanishes.\n\nThe loop equation method is well known and explained in many works \\cite{eynmultimat, staudacher}.\nHere, we write for each change of variable the corresponding loop equation (we use a presentation similar to that of \\cite{eynmultimat}).\n\nIn all what follows we consider $k>1$.\n\n\\bigskip\n\n$\\bullet$ the change of variable: $\\delta M_2={1\\over x_1-M_1}{1\\over y_1-M_2}\\,\\dots \\,{1\\over x_{k}-M_1}$ implies:\n\\begin{eqnarray}\\label{loopeqA}\nA_k(x_1,\\dots,x_k)\n&=& \\sum_{j=1}^{k-1} \\overline{W}_j(x_1,\\dots,y_j)\\,\\overline{W}_{k-j}(x_k,y_j,\\dots,y_{k-1}) \\cr\n&& + { x_1\\overline{W}_{k-1}(x_{1},y_1,\\dots,y_{k-1})- x_k\\overline{W}_{k-1}(x_{k},y_1,\\dots,y_{k-1})\\over x_1-x_k} \\cr\n&=& \\sum_{j=1}^{k-1} {W}_j(x_1,\\dots,y_j)\\,{W}_{k-j}(x_k,y_j,\\dots,y_{k-1}) \\cr\n&& - {W}_{k-1}(x_k,y_1,\\dots,y_{k-1}) \\cr\n&& + x_k\\,{ {W}_{k-1}(x_{1},y_1,\\dots,y_{k-1})- {W}_{k-1}(x_{k},y_1,\\dots,y_{k-1})\\over x_1-x_k} \\cr\n\\end{eqnarray}\n\n$\\bullet$ the change of variable: $\\delta M_1={1\\over x_1-M_1}{1\\over y_1-M_2}\\,\\dots \\,{1\\over x_{k}-M_1}{V'_2(y_k)-V'_2(M_2)\\over y_{k}-M_2}$ implies:\n\\begin{equation}\\label{loopeqU}\n\\begin{array}{l}\n(Y(x_1)-y_k)\\, \\overline{U}_k(x_1,\\dots,y_k) \\cr\n= \\sum_{j=2}^k {W_{j-1}(x_1,y_1,\\dots,y_{j-1})-W_{j-1}(x_j,y_1,\\dots,y_{j-1})\\over x_1-x_j}\\,\\overline{U}_{k-j+1}(x_j,y_j,\\dots,x_k,y_k) \\cr\n+ V'_2(y_k) {W_{k-1}(x_1,y_1,\\dots,y_{k-1})-W_{k-1}(x_k,y_1,x_2,\\dots,y_{k-1})\\over x_1-x_k} \\cr\n+ A_k(x_1,\\dots,x_k) - \\overline{P}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n= \\sum_{j=2}^k {W_{j-1}(x_1,y_1,\\dots,y_{j-1})-W_{j-1}(x_j,y_1,\\dots,y_{j-1})\\over x_1-x_j}\\,{U}_{k-j+1}(x_j,y_j,\\dots,x_k,y_k) \\cr\n+\\sum_{j=1}^{k-1} {W}_j(x_1,\\dots,y_j)\\,{W}_{k-j}(x_k,y_j,\\dots,y_{k-1}) \\cr\n- {P}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n\\end{array}\n\\end{equation}\nwhere we have used the loop equation \\eq{loopeqA} for $A_k(x_1,\\dots,x_k)$.\n\n\n$\\bullet$ the change of variable: $\\delta M_2={1\\over x_1-M_1}{1\\over y_1-M_2}\\,\\dots \\,{1\\over x_{k}-M_1}{1\\over y_{k}-M_2}$ implies:\n\\begin{eqnarray}\\label{loopeqW}\n&& (X(y_k)-x_1)\\,\\overline{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&=& \\sum_{j=1}^{k-1} {{W}_{k-j}(x_{j+1},\\dots,y_k)-{W}_{k-j}(x_{j+1},\\dots,x_k,y_j)\\over y_k-y_j}\\, {W}_j(x_1,\\dots,y_j) \\cr\n&& - U_k(x_1,\\dots,y_k) \\cr\n\\end{eqnarray}\n\n\\subsection{Recursive determination of the correlation functions}\n\n\\begin{theorem}\\label{thloopdetermineWk}\nThe system of equations \\eq{loopeqU} and \\eq{loopeqW} for all $k$ has a unique solution.\n\\end{theorem}\n\nIn other words, if we can find some functions $W_k$, $U_k$, $P_k$ which obey \\eq{loopeqU} and \\eq{loopeqW}\nfor all $k$, then they are the correlation functions we are seeking.\n\n\\medskip\n\\proof{\n$W_1$, $U_1$ and $P_1$ have already been computed in the literature.\n\nAssume that we have computed $W_j$, $U_j$, $P_j$ for all $j1\\, , \\qquad\n\\sum_{\\sigma\\in {\\overline\\Sigma}_k} C^{(k)}_\\sigma(x_1,y_1,x_2,y_2,\\dots, x_k,y_k) =0\n\\end{equation}\n\\end{lemma}\n\\proof{\nThis expression is a rational function of all its variables.\nConsider the poles at $y_k=y_j$, and write $\\tau=(k,j)$.\nOne can split the symmetric group ${\\overline\\Sigma}_k$ into its two conjugacy classes wrt the subgroup generated by $\\tau$: ${\\overline\\Sigma}_k=[Id]\\oplus[\\tau]$.\nIn other words:\n\\begin{eqnarray}\n&& \\sum_{\\sigma\\in {\\overline\\Sigma}_k} C_\\sigma(x_1,y_1,x_2,y_2,\\dots, x_k,y_k) \\cr\n&=& \\sum_{\\sigma\\in {\\overline\\Sigma}_k\/\\tau} C_\\sigma(x_1,y_1,x_2,y_2,\\dots, x_k,y_k)+C_{\\tau\\sigma}(x_1,y_1,x_2,y_2,\\dots, x_k,y_k) \\cr\n\\end{eqnarray}\nFrom Lemma \\ref{lemcancelpoleC}, the terms in the RHS have no pole at $y_k=y_j$.\nSimilarly, using cyclicity and doing the same for the $x$'s, we prove the lemma.\n}\n\n\n\\medskip\n\nThe Lemmas we have just proven, are sufficient to prove the main theorem \\ref{mainth}.\nThis is done in section \\ref{proofcorrel}.\n\n\n\n\n\n\\subsection{Computation of the rational functions $F^{(k)}(x_1,y_1,\\dots,x_k,y_k)$}\n\nAlthough the exact computation of the $F^{(k)}$'s is not necessary for proving theorem \\ref{mainth},\nwe do it for completeness.\nIn this section we give an explicit (and non-recursive) formula for the $F^{(k)}$'s.\n\nA practical way of computing these formulas is described in Appendix A.\n\n\n\n\n\n\\begin{definition}\\label{deff}\nTo every permutation $\\sigma\\in{\\overline\\Sigma}_{k-1}$, we associate a weight $f_\\sigma$ computed as follows:\n \\begin{equation} f_\\sigma = \\prod_{n=1}^l\n\\prod_{j=2}^{l_n}g_{i_{n,1},i_{n,j},i_{n,j+1}}\\prod_{n=2}^{\\td{l}}\n\\prod_{j=2}^{\\td{l_n}}g_{\\td{i}_{n,j},\\td{i}_{n,1},\\sigma (\\td{i}_{n,j})}\n\\prod_{j=1}^{\\td{l_1}}g_{\\td{i}_{1,j},k,\\sigma (\\td{i}_{1,j})} \\end{equation}\nwhere\n$g_{i,h,j}$ is defined as follows:\n\\begin{equation}\ng_{i,h,j}:=\\frac{1}{x_h-x_i} \\,\\frac{1}{y_h-y_j}\n\\end{equation}\nand $\\sigma$ and $S\\sigma$ are decomposed into their product of cycles as in Definition \\ref{defC}.\n\\end{definition}\n\n\\begin{theorem}\n$F^{(k)}(x_1,y_1, \\dots , x_k,y_k)$ is obtained as the sum of the\nweights $f_\\sigma$'s over all $\\sigma \\in \\Sigma_{k-1}$:\n\\begin{equation}\nF^{(k)}(x_1,y_1, \\dots , x_k,y_k) = \\sum_{\\sigma \\in \\Sigma_{k-1} } f_\\sigma\n\\end{equation}\n\\end{theorem}\n\n\n\\proof{\nFirst of all, let us interpret diagrammatically the recursion relation \\eq{recF} defining the F's:\n\\begin{equation}\n\\begin{array}{r}\n{\\epsfxsize 14cm\\epsffile{recF.eps}}\n\\end{array}\n\\end{equation}\n\nActually, this recursion relation is nothing else but a rule for cutting a graph along the dashed line into two smaller ones.\nThe weight of a graph is then obtained as the sum over all the possible ways of cutting it in two.\n\nNotice that $F^{(k)}$ is the sum of ${\\rm Cat}\\,(k-1)$ different terms.\n\nLet us now explicit this bijection with the graphs with $k-1$ arches. In order to compute one of the terms composing\n$F^{(k)}$, one has to cut it with the help of the recursion relation until one obtains only graphs with one arch.\nThat is to say that one cuts it $k-1$ times along non intersecting lines (corresponding to the dashed one\nin the recursion relation). If one draws these cutting lines on the circle, one obtains a graph with $k-1$ arches dual of the original one.\nThus every way of cutting a graph with $k-1$ arches is associated to a planar permutation $\\sigma \\in \\overline{\\Sigma} (i \\dots k-1)$. Let us now prove\nthat the term obtained by this cutting is equal to $f_\\sigma$.\n\nFor the sake of simplicity, one denotes the identity graph of $(x_j,y_j, \\dots , x_k,y_k)$\nby circle $(j,j+1, \\dots, k)$. In these conditions, the recursion relation reads:\n\\begin{equation}\n(1,2, \\dots, k) = \\sum_{j=1}^{k-1} g_{1,k,j} (1, \\dots , j) (j+1,\\dots ,k)\n\\end{equation}\n\nLet $\\sigma$ be a permutation of $(1, \\dots , k-1)$. Cut it along the line going from the boundary $(x_1,y_{k})$ to\n$(y_{\\sigma(1)},x_{S \\sigma(1)})$. It results from this operation the factor $g_{1,k,\\sigma(1)}$ and the circles\n$(1, \\dots , \\sigma(1))$ and $(S \\sigma(1), \\dots, k)$:\n\\begin{equation}\n(1,\\dots ,k) \\rightarrow^{\\sigma} g_{1,k,\\sigma(1)} (1, \\dots , \\sigma(1)) (S \\sigma(1), \\dots, k)\n\\end{equation}\n\n\nThen cutting the circle $(S \\sigma(1), \\dots, k)$ along $(y_k,x_{S \\sigma(1)}) \\rightarrow (y_{\\sigma S \\sigma(1)}, x_{S \\sigma S \\sigma(1)})$\ngives:\n\\begin{equation}\n(S \\sigma(1), \\dots, k) \\rightarrow^{\\sigma} g_{S \\sigma(1),k, \\sigma S \\sigma(1)} (S \\sigma(1), \\dots , \\sigma S \\sigma(1)) (S \\sigma S \\sigma(1), \\dots , k)\n\\end{equation}\n\nOne pursues this procedure step by step by always cutting the circle containing k. Using the former notations, this reads:\n\\begin{equation}\n(1,\\dots ,k) \\rightarrow^{\\sigma} \\prod_{j=1}^{\\td{l}_1} g_{\\td{i}_{1,j}, k, \\sigma (\\td{i}_{1,j})}\n(\\td{i}_{1,j}, \\dots , \\sigma(\\td{i}_{1,j}))\n\\end{equation}\n\nSo one has computed the weight associated to the first $S\\sigma$ - cycle. The remaining circles correspond to\n$\\sigma$-cycles. Let us compute their weight by considering for example $(\\td{i}_{1,1},\\dots , \\sigma(\\td{i}_{1,1})) = (i_{1,1}, \\dots , i_{1,2})$.\n\nThe cut along the line $(x_{i_{1,1}},y_{i_{1,2}}) \\rightarrow (y_{i_{1,3}},x_{S(i_{1,1})})$ gives:\n\\begin{equation}\n(i_{1,1}, \\dots , i_{1,2}) \\rightarrow^{\\sigma} g_{i_{1,1},i_{1,2},i_{1,3}} (i_{1,1}, \\dots , i_{1,3}) (S(i_{1,3}), \\dots , i_{1,2})\n\\end{equation}\n\nKeeping on cutting the circle containing $i_{1,1}$ at every step gives:\n\\begin{equation}\n(i_{1,1}, \\dots , i_{1,2}) \\rightarrow^{\\sigma} \\prod_{j=2}^{l_1} g_{i_{1,1},i_{1,j},i_{1,j+1}} (S(i_{1,j+1}), \\dots , i_{1,j})\n\\end{equation}\n\nOne can notice that the remaining circles in the RHS correspond to cycles of $S\\sigma$ whose contribution has not been taken\ninto account yet. One can then compute their values by\nfollowing a procedure similar to the one used for the first $S\\sigma$-cycle.\n\nOne can then recursively cut the circles so that one finally obtains only circles containing only one element.\nThis recursion is performed by alternatively processing on $\\sigma$-cycles and $S\\sigma$-cycles.\n\nThus, one straightforwardly finds:\n\\begin{equation}\n(1,\\dots ,k) \\rightarrow^{\\sigma} \\prod_{n=1}^l\n\\prod_{j=2}^{l_n}g_{i_{n,1},i_{n,j},i_{n,j+1}}\\prod_{n=2}^{\\td{l}}\n\\prod_{j=2}^{\\td{l_n}}g_{\\td{i}_{n,j},\\td{i}_{n,1},\\sigma (\\td{i}_{n,j})}\n\\prod_{j=1}^{\\td{l_1}}g_{\\td{i}_{1,j},k,\\sigma (\\td{i}_{1,j})} = f_\\sigma\n\\end{equation}\n\n\nAnd then:\n\\begin{equation}\nF^{(k)} = \\sum_{\\sigma\\in {\\overline\\Sigma}_{k-1}} f_\\sigma\n\\end{equation}\n}\n\n{\\bf Example:}\nLet us compute the weight associated to the permutation $\\sigma \\in {\\overline\\Sigma}_{12}$ introduced earlier. Starting from the circle $(1, \\dots , 13)$, one will proceed\nstep by step the following cutting:\n\\begin{equation}\n\\begin{array}{r}\n{\\epsfxsize 6cm\\epsffile{cut.eps}}\n\\end{array}\n\\end{equation}\n\nThe first step consists in cutting along the $\\td{\\sigma}_1$ cycle. The dashed lines show where one cuts the circles.\n Note that one do not represent the circles of unite length. The associated weight is $g_{1,13,3} \\,\\, g_{4,13,7} \\,\\, g_{8,13,8} \\,\\, g_{9,13,12}$.\n\nThe second step consists in cutting along the remaining $\\sigma$ cycles. One associates the weight $g_{1,3,2} \\,\\, g_{1,2,1} \\times g_{4,7,4} \\times g_{9,12,11} \\,\\, g_{9,11,9}$ to this step.\n\nThe weights associated to the two last cuttings are $g_{5,7,6} \\times g_{10,11,10}$ and $g_{5,6,5}$.\n\n\\begin{equation}\n\\begin{array}{r}\n{\\epsfxsize 13.4cm\\epsffile{cut3.eps}}\n\\end{array}\n\\end{equation}\n\nFinally, the weight of this planar permutation is then:\n\\begin{equation}\nf_{\\sigma} = g_{1,13,3} \\,\\, g_{4,13,7} \\,\\, g_{8,13,8} \\,\\, g_{9,13,12} \\,\\, g_{1,3,2} \\,\\, g_{1,2,1} \\,\\, g_{4,7,4} \\,\\, g_{9,12,11} \\,\\, g_{9,11,9} \\,\\, g_{5,7,6} \\,\\, g_{10,11,10} \\,\\, g_{5,6,5}\n\\end{equation}\n\n\n\\subsection{Proof of the main theorem}\n\\label{proofcorrel}\nWe now prove that the function $\\widehat{W}$ defined by the RHS of \\eq{Ansatz} and the functions $\\widehat{U}$ and $\\widehat{P}$ defined in\ntheorem \\ref{thansatzloop} satisfy the system of equations \\eq{loopeqU} and \\eq{loopeqW}.\n\n{\\noindent \\bf Proof of theorem \\ref{thansatzloop}:}\n\nUsing \\eq{CRessimple}, one has:\n\\begin{eqnarray}\n&&\\widehat{U}_k(x_1,\\dots,y_k)\n= \\mathop{\\mathrm{Pol}}_{y_k} V'_2(y_k)\\,\\widehat{W}_k(x_1,y_1,\\dots,x_k,y_k) \\cr\n&&= \\mathop{\\mathrm{Pol}}_{y_k} V'_2(y_k)\\,\\sum_{\\sigma\\in \\Sigma_k}\\, C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y_k)\\,\\, \\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)}) \\cr\n&&= \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y'_k) dy'_k \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad \\mathop{\\mathrm{Pol}}_{y_k}{V'_2(y_k)W_1(x_{\\sigma^{-1}(k)},y_k)\\over y_k-y_j} \\cr\n&&= \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y'_k) dy'_k \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad \\mathop{\\mathrm{Pol}}_{y_k}{(\\td{W}(y_k)-X(y_k))W_1(x_{\\sigma^{-1}(k)},y_k)\\over y_k-y_j} \\cr\n&&= - \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y'_k) dy'_k \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad \\mathop{\\mathrm{Pol}}_{y_k}{X(y_k)W_1(x_{\\sigma^{-1}(k)},y_k)\\over y_k-y_j} \\cr\n&&= \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y'_k) dy'_k \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\mathop{\\mathrm{Pol}}_{y_k} {(x_{\\sigma^{-1}(k)}-X(y_k))W_1(x_{\\sigma^{-1}(k)},y_k)-(x_{\\sigma^{-1}(k)}-X(y_j))W_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n&&= \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y'_k) dy'_k \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& {(x_{\\sigma^{-1}(k)}-X(y_k))W_1(x_{\\sigma^{-1}(k)},y_k)-(x_{\\sigma^{-1}(k)}-X(y_j))W_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n\\end{eqnarray}\n\nIndeed, using \\eq{W1U1}, one sees that the last expression is a polynomial in $y_k$:\n\\begin{eqnarray}\n&& {(x_{\\sigma^{-1}(k)}-X(y_k))W_1(x_{\\sigma^{-1}(k)},y_k)-(x_{\\sigma^{-1}(k)}-X(y_j))W_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n&=& {{E(x_{\\sigma^{-1}(k)},y_k)\\over y_k-Y(x_{\\sigma^{-1}(k)})}-{E(x_{\\sigma^{-1}(k)},y_j)\\over y_j-Y(x_{\\sigma^{-1}(k)})}\\over y_k-y_j} \\cr\n\\end{eqnarray}\n\nWe have to check \\eq{loopeqW}, i.e. that $A=0$ with:\n\\begin{eqnarray}\\label{defA}\nA&:=& \\sum_{j} {\\widehat{W}_{k-j}(x_{j+1},\\dots,y_k)-\\widehat{W}_{k-j}(x_{j+1},\\dots,x_k,y_j)\\over y_k-y_j}\\, \\widehat{W}_j(x_1,\\dots,y_j) \\cr\n&& - \\widehat{U}_k(x_1,\\dots,y_k) \\cr\n&& + (x_1-X(y_k))\\,\\widehat{W}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n\\end{eqnarray}\nWe have:\n\\begin{eqnarray}\nA&=& \\sum_{j\\neq k} \\sum_\\pi\\sum_\\tau { C^{(j)}_\\tau(x_1,\\dots,y_j)\\,C^{(k-j)}_\\pi(x_{j+1},\\dots,y_k) \\over y_k-y_j} \\cr\n&& \\quad \\times \\prod_{i=1}^{j} W_1(x_{\\tau^{-1}(i)},y_i)\\,\\prod_{i=j+1}^{k} W_1(x_{\\pi^{-1}(i)},y_i) \\cr\n&& - \\sum_{j\\neq k} \\sum_\\pi\\sum_\\tau { C^{(j)}_\\tau(x_1,\\dots,y_j)\\,C^{(k-j)}_\\pi(x_{j+1},\\dots,y_j) \\over y_k-y_j}\\, W_1(x_{\\pi^{-1}(k)},y_j) \\,\\cr\n&& \\quad \\times \\prod_{i=1}^{j} W_1(x_{\\tau^{-1}(i)},y_i)\\,\\prod_{i=j+1}^{k-1} W_1(x_{\\pi^{-1}(i)},y_i) \\cr\n&& - \\sum_\\sigma \\sum_{j\\neq k} {(x_{\\sigma^{-1}(k)}-X(y_k))\\over y_k-y_j}\\,W_1(x_{\\sigma^{-1}(k)},y_k) \\cr\n&& \\quad \\times \\left(\\mathop{\\,\\rm Res\\,}_{y_k\\to y_j} C^{(k)}_\\sigma\\right) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& + \\sum_\\sigma \\sum_{j\\neq k} {(x_{\\sigma^{-1}(k)}-X(y_j))\\over y_k-y_j} \\,W_1(x_{\\sigma^{-1}(k)},y_j) \\cr\n&& \\quad \\times \\left(\\mathop{\\,\\rm Res\\,}_{y_k\\to y_j} C^{(k)}_\\sigma\\right) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& + (x_1-X(y_k)) \\, \\sum_\\sigma C^{(k)}_\\sigma(x_1,\\dots,y_k) W_1(x_{\\sigma^{-1}(k)},y_k) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n\\end{eqnarray}\nUsing \\eq{CRessimple} in the last line, adding it to the 4th line, and using \\eq{CRessimple} again, we get:\n\\begin{eqnarray}\nA&=& \\sum_{j\\neq k} \\sum_\\pi\\sum_\\tau { C^{(j)}_\\tau(x_1,\\dots,y_j)\\,C^{(k-j)}_\\pi(x_{j+1},\\dots,y_k) \\over y_k-y_j} \\cr\n&& \\quad \\times \\prod_{i=1}^{j} W_1(x_{\\tau^{-1}(i)},y_i)\\,\\prod_{i=j+1}^{k} W_1(x_{\\pi^{-1}(i)},y_i) \\cr\n&& + (x_1-x_{\\sigma^{-1}(k)}) \\, \\sum_\\sigma C^{(k)}_\\sigma(x_1,\\dots,y_k) W_1(x_{\\sigma^{-1}(k)},y_k) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& - \\sum_{j\\neq k} \\sum_\\pi\\sum_\\tau { C^{(j)}_\\tau(x_1,\\dots,y_j)\\,C^{(k-j)}_\\pi(x_{j+1},\\dots,y_j) \\over y_k-y_j}\\, W_1(x_{\\pi^{-1}(k)},y_j) \\,\\cr\n&& \\qquad \\prod_{i=1}^{j} W_1(x_{\\tau^{-1}(i)},y_i)\\,\\prod_{i=j+1}^{k-1} W_1(x_{\\pi^{-1}(i)},y_i) \\cr\n&& + \\sum_\\sigma \\sum_{j\\neq k} {(x_{\\sigma^{-1}(k)}-X(y_j))\\over y_k-y_j} \\,W_1(x_{\\sigma^{-1}(k)},y_j) \\cr\n&& \\quad \\times \\left(\\mathop{\\,\\rm Res\\,}_{y_k\\to y_j} C^{(k)}_\\sigma\\right) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n\\end{eqnarray}\nUsing \\eq{Crec} in the second line, exactly cancels the first line, and thus we get:\n\\begin{eqnarray}\nA&=& - \\sum_{j\\neq k} \\sum_\\pi\\sum_\\tau { C^{(j)}_\\tau(x_1,\\dots,y_j)\\,C^{(k-j)}_\\pi(x_{j+1},\\dots,y_j) \\over y_k-y_j}\\, W_1(x_{\\pi^{-1}(k)},y_j) \\,\\cr\n&& \\qquad \\prod_{i=1}^{j} W_1(x_{\\tau^{-1}(i)},y_i)\\,\\prod_{i=j+1}^{k-1} W_1(x_{\\pi^{-1}(i)},y_i) \\cr\n&& + \\sum_\\sigma \\sum_{j\\neq k} {(x_{\\sigma^{-1}(k)}-X(y_j))\\over y_k-y_j} \\,W_1(x_{\\sigma^{-1}(k)},y_j) \\cr\n&& \\quad \\times \\left(\\mathop{\\,\\rm Res\\,}_{y_k\\to y_j} C^{(k)}_\\sigma\\right) \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n\\end{eqnarray}\nwhich is a rational fraction in $y_k$ with poles at $y_k=y_j$ for some $j$.\nFrom Lemma \\ref{lemcancelpoleC}, $A$ as defined in \\eq{defA} cannot have poles at $y_k=y_j$, thus $A=0$.\n\n\\bigskip\nNow, we have to check \\eq{loopeqU}\nUsing \\eq{CRessimple}, one has:\n\\begin{eqnarray}\n&& \\widehat{P}_k(x_1,\\dots,y_k) - \\widehat{W}_{k-1}(x_2,\\dots,x_{k},y_1) \\cr\n&=& \\mathop{\\mathrm{Pol}}_{x_1} V'_1(x_1)\\,\\widehat{U}_k(x_1,y_1,\\dots,x_k,y_k) \\cr\n&=& \\mathop{\\mathrm{Pol}}_{x_1} Y(x_1) \\sum_{\\sigma\\in \\Sigma_k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad {U_1(x_{\\sigma^{-1}(k)},y_k)-U_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n&=& \\mathop{\\mathrm{Pol}}_{x_1} Y(x_1) \\sum_{\\sigma\\in \\Sigma_k,\\,\\sigma(1)=k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad {U_1(x_1,y_k)-U_1(x_1,y_j)\\over y_k-y_j} \\cr\n&& + \\mathop{\\mathrm{Pol}}_{x_1} Y(x_1) \\sum_{\\sigma\\in \\Sigma_k,\\,\\sigma(1)\\neq k}\\,\\sum_{j\\neq k}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma \\,\\, W_1(x_1,y_{\\sigma(1)})\\prod_{i\\neq k,\\sigma(1)} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad {U_1(x_{\\sigma^{-1}(k)},y_k)-U_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n&=& - \\sum_{\\sigma\\in \\Sigma_k,\\,\\sigma(1)=k}\\,\\sum_{j\\neq k}\\,\\sum_{l\\neq 1}\\,\\mathop{\\,\\rm Res\\,}_{x_1\\to x_l}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma \\,\\, \\prod_{i=1}^{k-1} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad {E(x_1,y_k)-E(x_1,y_j)-E(x_l,y_k)+E(x_l,y_j)\\over (x_1-x_l)(y_k-y_j)} \\cr\n&& + \\sum_{\\sigma\\in \\Sigma_k,\\,\\sigma(1)\\neq k}\\,\\sum_{j\\neq k}\\,\\sum_{l\\neq 1}\\,\\mathop{\\,\\rm Res\\,}_{x_1\\to x_l}\\,\\mathop{\\,\\rm Res\\,}_{y'_k\\to y_j} C^{(k)}_\\sigma \\,\\,\\prod_{i\\neq k,\\sigma(1)} W_1(x_{\\sigma^{-1}(i)},y_i) \\cr\n&& \\quad {(y_{\\sigma(1)}-Y(x_1))W_1(x_1,y_{\\sigma(1)})-(y_{\\sigma(1)}-Y(x_l))W_1(x_l,y_{\\sigma(1)})\\over x_1-x_l} \\cr\n&& \\quad {U_1(x_{\\sigma^{-1}(k)},y_k)-U_1(x_{\\sigma^{-1}(k)},y_j)\\over y_k-y_j} \\cr\n\\end{eqnarray}\n\nIn order to satisfy \\eq{loopeqU}, we must prove that $B=0$, where:\n\\begin{eqnarray}\nB&:=& \\sum_{l=2}^k {\\widehat{W}_{l-1}(x_1,y_1,\\dots,y_{l-1})-\\widehat{W}_{l-1}(x_l,y_1,x_2,\\dots,y_{l-1})\\over x_1-x_l}\\cr\n&& \\quad \\times \\widehat{U}_{k-l+1}(x_l,y_l,\\dots,x_k,y_k) \\cr\n&& +\\sum_{l=1}^{k-1} \\widehat{W}_l(x_1,\\dots,y_l)\\,\\widehat{W}_{k-l}(x_k,y_l,\\dots,y_{k-1}) \\cr\n&& - \\widehat{P}_k(x_1,y_1,x_2,\\dots,x_k,y_k) \\cr\n&& - (Y(x_1)-y_k)\\, \\widehat{U}_k(x_1,\\dots,y_k) \\cr\n\\end{eqnarray}\n\nOne does it in a way very similar to the previous one, i.e. first prove, using \\eq{Crec}, that $B$ is a rational fraction of $x_1$, with poles at $x_1=x_l$.\nBut $B$ can have no pole at $x_1=x_l$, so,$B=0$.\n\n\n\n{$\\bullet$}\n\n\n\n\n\n\n\\newsection{Matrix form of correlation functions}\n\nSo far, we have computed mixed correlation functions with only one trace, i.e. the generating function of connected discrete surfaces with\none boundary.\nIn this section, we generalize this theory to the computation of generating functions of non-connected discrete surfaces with any number of\nboundaries.\nIn order to derive those correlation functions, a matrix approach of the problem, similar to the one developed in\n\\cite{eynprats}, is used.\n\n\n\\begin{definition}\\label{defWmatr}\nLet k be a positive integer. Let $\\pi$ and $\\pi$' be two permutations of $\\Sigma_k$ and decompose $\\pi'^{-1} \\pi$ into the product of its irreducible cycles:\n\\begin{equation}\n\\pi'^{-1} \\pi = P_1 P_2 \\dots P_n\n\\end{equation}\nEach cycle $P_i$ of $\\pi'^{-1} \\pi$, of length $p_i$, is denoted :\n\\begin{equation}\nP_m = (i_{m,1} \\rightarrow^{\\pi} j_{m,1} \\leadsto^{\\pi'^{-1}} i_{m,2} \\rightarrow^{\\pi} j_{m,2}\\leadsto^{\\pi'^{-1}} \\dots \\leadsto^{\\pi'^{-1}} i_{m,p_m} \\rightarrow^{\\pi} j_{m,p_m} \\leadsto^{\\pi'^{-1}} i_{m,1})\n\\end{equation}\n\nFor any $(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\in \\mathbf{C}$, we define :\n\\begin{equation}\n{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1, \\dots , x_k,y_k):= \\left\\langle\\prod_{m=1}^{n} \\left( \\delta_{p_m,1} + {1\\over N}{\\,\\rm Tr}\\: \\prod_{j=1}^{p_m} {1 \\over (M_1-x_{i_{m,j}})(M_2-y_{j_{m,j}})}\\right) \\right\\rangle\n\\end{equation}\nwhich is a $k!\\times k!$ matrix.\n\\end{definition}\n\nLet us now generalize the notion of planarity of a permutation.\n\n\\begin{definition}\\label{defcoplanarity}\nLet k be a positive integer. Let $\\pi$ and $\\pi$' be two permutations of $\\Sigma_k$.\n\nA permutation $\\sigma \\in \\Sigma_k$ is said to be planar wrt $(\\pi , \\pi')$ if\n\\begin{equation}\nn_{\\rm cycles}(\\pi^{-1} \\sigma)+n_{\\rm cycles}(\\pi'^{-1} \\sigma)=k+n_{\\rm cycles}(\\pi'^{-1} \\pi)\n\\end{equation}\n\nLet $\\Sigma_k^{(\\pi,\\pi')} \\subset \\Sigma_k$ be the set of permutations planar wrt $(\\pi , \\pi')$.\n\nGraphically, if one draws the sets of points $(x_{i_{1,1}},y_{j_{1,1}},x_{i_{1,2}},y_{j_{1,2}}, \\dots , x_{i_{1,p_1}},y_{j_{1,p_1}})$,\n$(x_{i_{2,1}},y_{j_{2,1}},x_{i_{2,2}},y_{j_{2,2}}, \\dots , x_{i_{2,p_2}},y_{j_{2,p_2}})$, $\\dots$ , $(x_{i_{p,1}},y_{j_{p,1}},x_{i_{p,2}},y_{j_{p,2}}, \\dots , x_{i_{n,p_n}},y_{j_{n,p_n}})$\non n circles and link each pair $(x_j, y_{\\sigma(j)})$ by a line, these lines do not intersect nor go from one circle to another.\n\n\\end{definition}\n\n\n\\begin{remark}\\rm\\small One can straightforwardly see two properties of these sets:\n\\begin{itemize}\n\\item This relation of planarity wrt to $(\\pi , \\pi')$ is symmetric in $\\pi$ and $\\pi'$, that is to say:\n\\begin{equation}\n\\Sigma_k^{(\\pi,\\pi')} = \\Sigma_k^{(\\pi',\\pi)}\n\\end{equation}\n\\item The planarity defined in \\eq{Defplanar} corresponds to $\\pi = Id$ and $\\pi'= S^{-1}$:\n\\begin{equation}\n{\\overline\\Sigma}_k = \\Sigma_k^{(Id,S^{-1})}\n\\end{equation}\n\n\\end{itemize}\n\\end{remark}\n\nDirectly from these definitions and the preceding results comes the following theorem computing any generating function of discrete\nsurface with boundaries.\n\n\n\\begin{theorem}\\label{thWCsigmamat}\n\\begin{equation}\\encadremath{\n{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) = \\sum_\\sigma {\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(x_1,y_1, \\dots , x_k,y_k) \\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)})\n}\\end{equation}\n\nwhere ${\\cal{C}}_{\\sigma}^k$ is the $k! \\times k!$-matrix defined by:\n\\begin{itemize}\n\\item ${\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) := 0$ if $\\sigma$ is not planar wrt $(\\pi,\\pi')$;\n\n\\item if $\\sigma$ is planar wrt $(\\pi,\\pi')$ :\n\\begin{eqnarray}\\label{defCm}\n&&{\\cal{C}}_{\\sigma,\\pi,\\pi'}^k (x_1,y_1, \\dots , x_k,y_k) :=\\cr\n&&\\prod_{m=1}^a F^{(a_m)}(x_{r_{m,1}},y_{\\sigma(r_{m,1})},x_{r_{m,2}},y_{\\sigma(r_{m,2})},\\dots,x_{r_{m,a_m}},y_{\\sigma(r_{m,a_m})}) \\cr\n&&\\times \\prod_{m=1}^\\td{a} F^{(\\td{a}_m)}(x_{\\td{r}_{m,1}},y_{\\sigma(\\td{r}_{m,1})},x_{\\td{r}_{m,2}},y_{\\sigma(\\td{r}_{m,2})},\\dots,x_{\\td{r}_{m,a_m}},y_{\\sigma(\\td{r}_{m,a_m})}) \\cr\n\\end{eqnarray}\n\nwith the decompositions of $\\pi^{-1} \\sigma$ and $\\pi'^{-1} \\sigma$ into their products of cycles:\n\\begin{equation}\n\\pi^{-1} \\sigma = \\pi_1 \\pi_2 \\dots \\pi_a {\\qquad , \\qquad} \\pi'^{-1} \\sigma = \\td{\\pi}_1 \\td{\\pi}_2 \\dots \\td{\\pi}_{\\td{a}}\n\\end{equation}\n\nsuch that:\n\\begin{equation}\n\\pi_m = (r_{m,1},r_{m,2}, \\dots , r_{m,a_m}) {\\qquad , \\qquad} \\td{\\pi}_m = (\\td{r}_{m,1},\\td{r}_{m,2}, \\dots , \\td{r}_{m,\\td{a}_m})\n\\end{equation}\n\\end{itemize}\n\n\\end{theorem}\n\n\\begin{remark}\\rm\\small\nFrom the definition, one can see that $\\sigma(r_{m,a_m}) = \\pi(r_m,1)$ and $\\sigma(\\td{r}_{m,a_m}) = \\pi'(\\td{r}_m,1)$ for any $m$.\n\\end{remark}\n\n\n\\subsection{Properties of the $C_\\sigma^k$'s.}\n\n\\begin{lemma}\nThe matrices ${\\cal{C}}_\\sigma^k$ are symmetric.\n\\end{lemma}\n\n\\proof{ It comes directly from the definition.}\n\n\n\\begin{lemma}\n\\begin{equation}\n\\sum_{\\sigma} {\\cal{C}}_\\sigma^k = Id\n\\end{equation}\n\\end{lemma}\n\n\\proof{\nOne has:\n\\begin{equation}\n{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) = \\sum_\\sigma {\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k} \\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)})\n\\end{equation}\nLet us shift all the $x$'s by a translation $a$ and send $a\\to\\infty$, i.e. replace all the $x_i$'s by $x_i+a$.\nIn the LHS, only the $\\delta$-terms of Definition \\ref{defWmatr} survive in the limit $a\\to\\infty$, and thus the LHS tends towards the identity matrix.\nIn the RHS, notice that $W_1(x_i+a,y_{\\sigma(i)}) \\rightarrow 1$.\nAnd ${\\cal{C}}_{\\sigma}^{k}$, which depends only on the differences between $x_i$'s, is independent of $a$.\n}\n\n\n\\subsection{Some commutation properties}\n\n\\begin{definition}\nLet ${\\cal M}^k(\\vec{x},\\vec{y},\\xi,\\eta)$ be the $k! \\times k!$ matrix defined by:\n\\begin{equation}\n{\\cal M}^k(\\vec{x},\\vec{y},\\xi,\\eta)_{\\pi,\\pi'}:= \\prod_{i} ( \\delta_{\\pi(i),\\pi'(i)} + {1\\over (\\xi-x_i)(\\eta-y_{\\pi(i)})})\n\\end{equation}\n\nLet ${\\cal{A}}^{(k)}(x_1,y_1, \\dots, x_k,y_k)$ be the $k! \\times k!$ matrix defined by:\n\\begin{equation}\n\\left\\{\n\\begin{array}{l}\n{\\cal{A}}^{(k)}_{\\pi,\\pi}(x_1,y_1, \\dots, x_k,y_k) := \\sum_i x_i y_{\\pi(i)} \\cr\n{\\cal{A}}^{(k)}_{\\pi,\\pi'}(x_1,y_1, \\dots, x_k,y_k) := 1 \\; \\rm{if} \\; \\pi \\pi'^{-1} = \\rm{transposition} \\cr\n{\\cal{A}}^{(k)}_{\\pi,\\pi'}(x_1,y_1, \\dots, x_k,y_k) := 0 \\; \\rm{otherwise}\n\\end{array}\n\\right.\n\\end{equation}\n\n\\end{definition}\n\n\n\n\n\n\\begin{theorem}\\label{thcommut}\n\\begin{equation}\\encadremath{\n\\forall \\sigma,\\xi,\\eta\\, , \\qquad [{\\cal M}^k(\\vec{x},\\vec{y},\\xi,\\eta),{\\cal C}_{\\sigma}^{k}(\\vec{x},\\vec{y})]= 0\n}\\end{equation}\nand\n\\begin{equation}\\encadremath{\n\\forall \\xi,\\eta\\, , \\qquad [{\\cal M}^k(\\vec{x},\\vec{y},\\xi,\\eta),{\\cal W}^{k}(\\vec{x},\\vec{y})]= 0\n}\\end{equation}\n\\end{theorem}\n\n\n\n\\proof{\nLet us define:\n\\begin{equation}\n\\widetilde{\\cal{M}}(\\vec{x},\\vec{y},\\xi,\\eta) := {\\cal{M}}(N \\vec{x}, \\vec{y}, N \\xi, \\eta)\n\\end{equation}\nand\n\\begin{equation}\n\\widetilde{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1, \\dots , x_k,y_k):= \\left\\langle\\prod_{m=1}^{n} \\left( \\delta_{p_m,1} + {\\,\\rm Tr}\\: \\prod_{j=1}^{p_m} {1\\over N}{1 \\over (M_1-x_{i_{m,j}})(M_2-y_{j_{m,j}})}\\right) \\right\\rangle\n\\end{equation}\n\nIt was proven in \\cite{eynprats} that:\n\\begin{equation}\n [\\widetilde{\\cal M}^k(\\vec{x},\\vec{y},\\xi,\\eta),\\widetilde{\\cal W}^{k}(\\vec{x},\\vec{y})]= 0\n\\end{equation}\n\nNow, in the large $N$ limit, the factorization property \\cite{ZJDFG} $<{\\,\\rm Tr}\\: {\\,\\rm Tr}\\:>\\sim <{\\,\\rm Tr}\\:><{\\,\\rm Tr}\\:>$, implies:\n\\begin{eqnarray}\n&& \\widetilde{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\cr\n&\\sim& N^{n_{\\rm cycles}(\\pi'^{-1} \\pi)-k}\n\\prod_{m=1}^{n} W_{p_m}(x_{i_{m,1}},y_{\\pi(i_{m,1})},\\dots,x_{i_{m,p_m}},x_{\\pi(i_{m,p_m})}) \\cr\n&\\sim& N^{n_{\\rm cycles}(\\pi'^{-1} \\pi)-k} {\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\cr\n\\end{eqnarray}\nand using theorem \\ref{thWCsigmamat}, we have:\n\\begin{eqnarray}\n&& \\widetilde{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\cr\n&\\sim& N^{n_{\\rm cycles}(\\pi'^{-1} \\pi)-k}\n \\sum_\\sigma {\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)})\n\\end{eqnarray}\n\nNotice that\n\\begin{eqnarray}\n&& {\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k)\\cr\n&=& N^{k-n_{\\rm cycles}(\\pi^{-1} \\sigma)+k-n_{\\rm cycles}(\\pi'^{-1} \\sigma)}\n{\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(Nx_1,y_1,Nx_2,y_2, \\dots , Nx_k,y_k)\\cr\n&=& N^{k-n_{\\rm cycles}(\\pi'^{-1} \\pi)}\n{\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(Nx_1,y_1,Nx_2,y_2, \\dots , Nx_k,y_k)\\cr\n\\end{eqnarray}\n\nThus:\n\\begin{eqnarray}\n&& \\widetilde{\\cal{W}}^{k}_{\\pi,\\pi'}(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\cr\n&\\sim& \\sum_\\sigma {\\cal{C}}_{\\sigma,\\pi,\\pi'}^{k}(Nx_1,y_1,Nx_2,y_2, \\dots , Nx_k,y_k) \\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)})\n\\end{eqnarray}\nThen, from \\cite{eynprats}, we have:\n\\begin{equation}\n0=\\sum_\\sigma \\left[{\\cal{M}}^{k}(N \\vec{x}, \\vec{y}, N \\xi, \\eta), {\\cal{C}}_{\\sigma}^{k}(Nx_1,y_1, \\dots , Nx_k,y_k) \\right]\\prod_{i=1}^k W_1(x_i,y_{\\sigma(i)})\n\\end{equation}\nIn particular, choose a permutation $\\sigma$, and take the limit where $y_i\\to Y(x_{\\sigma^{-1}(i)})$,\nyou get in that limit:\n\\begin{equation}\n0= \\left[{\\cal{M}}^{k}(N \\vec{x}, \\vec{Y(x_{\\sigma^{-1}})}, N \\xi, \\eta), {\\cal{C}}_{\\sigma}^{k}(Nx_1,Y(x_{\\sigma^{-1}(1)}), \\dots , Nx_k,Y(x_{\\sigma^{-1}(k)})) \\right]\n\\end{equation}\nSince this equation holds for any potentials $V_1$ and $V_2$, it holds for any function $Y(x)$, and thus the $Y(x_i)$'s can be chosen independentely of the $x_i$'s, and thus, for any $y_1,\\dots, y_k$,\nwe have:\n\\begin{equation}\n0= \\left[{\\cal{M}}^{k}(N \\vec{x}, \\vec{y}, N \\xi, \\eta), {\\cal{C}}_{\\sigma}^{k}(Nx_1,y_1, \\dots , Nx_k,y_k) \\right]\n\\end{equation}\nSince it holds for any $x_i$'s and $\\xi$, it also holds for $x_i\/N$ and $\\xi\/N$.}\n\n\\begin{corollary}\\label{corcommut}\n\\begin{equation}\n\\forall \\sigma\\, , \\qquad [{\\cal A}^{(k)}(\\vec{x},\\vec{y}),{\\cal C}_{\\sigma}^{k}(\\vec{x},\\vec{y})]= 0\n\\end{equation}\n\\end{corollary}\n\\proof{\nThe corollary is obtained by taking the large $\\xi$ and $\\eta$ limit of theorem \\ref{thcommut} (see Appendix of \\cite{eynprats}).\n}\n\n\n\n\n\\subsection{Examples: $k=2$.}\n\n\\begin{eqnarray}\n{\\cal{W}}^{(2)} = \\pmatrix{W_{11}W_{22} & {W_{11}W_{22}-W_{12}W_{21}\\over (x_1-x_2)(y_1-y_2)}\\cr\n{W_{11}W_{22}-W_{12}W_{21}\\over (x_1-x_2)(y_1-y_2)} & W_{12}W_{21} }\n\\end{eqnarray}\n\nwhere $W_{ij} = W_{1}(x_i,y_j)$.\n\n\\begin{eqnarray}\n{\\cal C}^2_{Id} = \\pmatrix{1 & {1\\over (x_1-x_2)(y_1-y_2)}\\cr {1\\over (x_1-x_2)(y_1-y_2)} & 0 }\n\\end{eqnarray}\n\\begin{eqnarray}\n{\\cal C}^2_{(12)} = \\pmatrix{0 & {1\\over (x_1-x_2)(y_2-y_1)}\\cr {1\\over (x_1-x_2)(y_2-y_1)} & 1 } = 1- {\\cal C}^2_{Id} \\cr\n\\end{eqnarray}\n\n\n\n\n\n\\newsection{Application: Gaussian case}\n\nThere is an example of special interest, in particular for its applications to string theory in the BMN limit \\cite{BMN},\nit is the Gaussian-complex matrix model case, $V_1=V_2=0$.\nIn that case one has $E(x,y)=xy-1$, and thus:\n\\begin{equation}\nW_1(x,y)={xy\\over xy-1}\n\\end{equation}\n\n\nThe loop equation defining recursively the $W_k$'s can be written:\n\\begin{eqnarray}\n&& (x_1 y_k-1)W_k(x_1,y_1,\\dots,x_k,y_k) = \\cr \n&& x_1 \\sum_{j} {W_{j-1}(x_j,y_1,\\dots,y_{j-1})-W_{j-1}(x_1,y_1,\\dots,y_{j-1})\\over x_1-x_j}\\cr\n&& \\quad \\times W_{k-j+1}(x_j,y_j,\\dots,x_k,y_k) \\cr\n\\end{eqnarray}\n\nIts solution is then:\n\\begin{equation}\nW_k(x_1,y_1,\\dots,x_k,y_k) = \\sum_{\\sigma\\in \\Sigma_k}\\, C^{(k)}_\\sigma(x_1,y_1,\\dots,x_k,y_k)\\,\\, \\prod_{i=1}^k {x_i y_{\\sigma(i)} \\over x_i y_{\\sigma(i)} -1 }\n\\end{equation}\n\nFrom the loop equation, one can see that $W_k(x_1,y_1,\\dots,x_k,y_k)$ may have poles only when $x_i \\rightarrow y_j^{-1}$ for any $i$ and $j$.\nBecause the $C_\\sigma$'s are rational functions of all their variables and because $W_k$ has no singularity when $x_i=x_j$ or $y_i=y_j$, one can write:\n\\begin{equation}\nW_k(x_1,y_1,\\dots,x_k,y_k) = {N_k(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\over \\prod_{i,j}(x_i y_j-1)}\n\\end{equation}\n\nwhere $N_k(x_1,y_1,x_2,y_2, \\dots , x_k,y_k)$ is a polynomial in all its variables.\n\nMoreover, the loop equation taken for the values $x_k=0$ or $y_k=0$ shows that $W_k(x_1,y_1,\\dots,0,y_k) = W_k(x_1,y_1,\\dots,x_k,0)=0$.\nUsing the cyclicity property of $W_k(x_1,y_1,\\dots,x_k,y_k)$, one can claim that it vanishes whenever one of its arguments is equal to 0.\nOne can thus factorize the polynomial $N_k(x_1,y_1,x_2,y_2, \\dots , x_k,y_k)$ as follows:\n\\begin{equation}\nW_k(x_1,y_1,\\dots,x_k,y_k) = {Q_k(x_1,y_1,x_2,y_2, \\dots , x_k,y_k) \\prod_{i} x_i y_i \\over \\prod_{i,j}(x_i y_j-1)}\n\\end{equation}\nwhere $Q_k(x_1,y_1,\\dots,x_k,y_k)$ is a polynomial of degree $k-2$ with integer coefficient in all its variables.\n\n\nNotice that $Q_k(x_1,y_1,\\dots, y_{\\sigma(i)}^{-1},y_i, \\dots ,x_k,y_k)=0$ if $\\sigma$ is not planar.\n\nAs an example, we have:\n\\begin{itemize}\n\\item for $k=2$:\n\\begin{equation}\nW_2(x_1,y_1,x_2,y_2) = {x_1x_2 y_1 y_2\\over \\prod_{i,j}(x_i y_j-1)} {\\qquad , \\qquad} Q_2(x_1,y_1,x_2,y_2) = 1\n\\end{equation}\n\n\\item for $k=3$:\n\\begin{equation}\nW_3(x_1,y_1,x_2,y_2,x_3,y_3) = (2-\\sum_i x_i y_{i+1} + x_1 x_2 x_3 y_1 y_2 y_3)\\, {x_1 x_2 x_3 y_1 y_2 y_3\\over \\prod_{i,j}(x_i y_j-1)}\n\\end{equation}\nand\n\\begin{equation}\nQ_3(x_1,y_1,x_2,y_2,x_3,y_3) = (2- x_1y_2 - x_2 y_3 - x_3 y_1 + x_1 x_2 x_3 y_1 y_2 y_3)\n\\end{equation}\n\n\\end{itemize}\n\n\n\n\\newsection{Conclusion}\n\nIn this article, we have computed the generating functions of discs with all possible boundary conditions,\ni.e. the large $N$ limit of all correlation functions of the formal 2-matrix model.\nWe have found that the $2k$ point correlation function can be written like the Bethe Ansatz for the $\\delta$-interacting bosons,\ni.e. a sum over permutations of product of 2-point functions.\nThat formula is universal, it is independent of the potentials.\n\nAn even more powerful approach consists in gathering all possible $2k$ point correlation functions in a $k!\\times k!$ matrix ${\\cal W}^k$.\nWe have found that this matrix ${\\cal W}^k$ satisfies commutation relations with a family of matrices ${\\cal M}^k$ which depend on two spectral parameters,\nand are related to the representations of $U(n)$ \\cite{eynprats}.\nWe claim that the theorem \\ref{thcommut} is almost equivalent to the loop equations, and allows to determine ${\\cal W}^k$.\n\n\\medskip\n\nIt remains to understand how all these matrices and coefficients $C_\\sigma$ are related to usual formulations of integrability,\ni.e. how to write these in terms of Yang Baxter equations. For instance, the similarity with equations found\nin Razumov-Stroganov conjecture's proof \\cite{RazStro} is to be understood.\n\n\\medskip\n\nOne could also hope to find a direct proof of theorem \\ref{mainth}, without having to solve the loop equations.\nIn other words, we have found that the $2k$-point function can be written only in terms of $W_1$, while, in the derivation, we use the one point functions $Y(x)$ and $X(y)$ although they don't appear in the final result.\n\n\\medskip\n\nThe next step, is to be able to compute the $1\/N^2$ expansion of those correlation functions, as well as the large $N$ limit of\nconnected correlation functions.\nWe are already working that out, by mixing the approach presented in the present article and the Feynman graph approach of \\cite{eynloop1mat}\ngeneralized to the 2-matrix model in \\cite{eoloop2mat}.\n\n\\medskip\n\nAnother prospect is to go to the critical limit, i.e. where we describe generating functions for continuous surfaces with conformal invariance,\nand interpret this as boundary conformal field theory \\cite{kostov}.\n\n\n\n\n\n\\subsection*{Acknowledgements}\nThe authors want to thank M. Bauer, M. Berg\\`ere, F. David, P. Di Francesco, J.B. Zuber for stimulating discussions.\nThis work was partly supported by the european network Enigma (MRTN-CT-2004-5652).\n\n\\eop\n\n\\setcounter{section}{0}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section[About Java]{About \\proglang{Java}}\n\\section{Introduction}\n\n\nFeature selection is commonly used to improve model interpretability, parsimony, and generalization. In the linear setting, methods such as the lasso \\citep{tibshirani1996regression}, group lasso \\citep{friedman2010note}, and elastic net \\citep{zou2005regularization} are frequently used to obtain sparse models. These techniques are valued for their ease of use and computational efficiency. \nTo fit a sparse nonlinear model with the lasso, modelers often resort to ad-hoc feature engineering strategies like binning features \\citep{wu2016revisiting} or adding pairwise feature interactions \\citep{nelder1972generalized}, which can explode the dimension of the problem and still underperform compared to tree-based models like XGBoost \\citep{chen2016xgboost} or Random Forest \\citep{breiman2001random}.\n\nFeature selection is more challenging in nonlinear models. Wrapper-based feature selection algorithms, such as recursive feature elimination (RFE), are computationally expensive as the model must be retrained to evaluate each subset of features \\citep{darst2018using}. Feature importance metrics derived from nonlinear models, such as mean decrease in impurity (MDI) importance for tree ensembles, can be biased \\citep{zhou2021unbiased} and can fail when some features are correlated \\citep{liu2021controlburn}: a group of correlated features splits the MDI score between them, and so the score for an important group of features may be suppressed below the importance threshold for every individual feature in the group.\n\n\nIn this paper, we present \\pkg{ControlBurn}, an efficient algorithm for feature selection in nonlinear models that works well even with many correlated features. \\pkg{ControlBurn} first builds a large tree ensemble out of simple trees that isolate the effects of important single features and small subsets of features.\nIt then chooses a subset of the trees that jointly use a small number of features\nby solving a group lasso problem. \nThe algorithm is fast for large-scale data and yields an interpretable model that identifies the effects of important individual features and pairs of features. \nAn implementation of \\pkg{ControlBurn} is available as an open-source package in the \\proglang{Python} programming language. \n\n\nThe paper is organized as follows. Section \\ref{Methodology} presents the \\pkg{ControlBurn} algorithm and section \\ref{software} provides a tutorial of the \\proglang{Python} implementation. Additional capabilities of \\pkg{ControlBurn} are presented in section \\ref{capabilities} and an advanced application of \\pkg{ControlBurn} to emergency room triage appears in section \\ref{application}.\n\n\\section{Nonlinear feature selection with trees} \\label{Methodology}\n\n\\pkg{ControlBurn} first builds a tree ensemble (forest), say, by bagging or by gradient boosting.\nPerformance is sensitive to the quality and diversity of the tree ensemble\nand \\pkg{ControlBurn} works best when each tree uses only a few features. \nWe discuss detailed strategies for building good ensembles in section~\\ref{treebuild}.\n\\pkg{ControlBurn} then seeks a subset of the trees (subforest) that jointly use a small number of features and that predict the response well. \nIt finds this subforest by solving a weighted lasso optimization problem. \n\\pkg{ControlBurn} can find models with different sparsity levels by varying the regularization parameter in the lasso problem\nand can choose the optimal sparsity level to minimize cross-validated error.\nGiven the selected features, \\pkg{ControlBurn} can fit a final (``polished'') tree ensemble on the selected features to debias the model compared to the results after the lasso fit. \n\nWe now describe each step in greater mathematical detail.\nWe begin by discussing methods for sparsifying a forest and \nrevisit methods for building appropriate forests in section~\\ref{treebuild}.\n\n\n\\subsection{General framework}\\label{generalframework}\nGiven $n$ output-response pairs $\\{(x^{(i)}, y^{(i)})\\}_{i=1}^n$, \nsuppose we have constructed $T$ trees: predictors that map each sample $x^{(i)}$\nto a prediction $a^{(i)}$,\nwhich can be continuous (for regression) or binary (for classification).\nEach tree $t=1,\\ldots,T$ is associated with a vector of predictions $a^{(t)} \\in \\mathbb{R}^{N}$ and a binary vector $g^{(t)} \\in \\{0,1\\}^{P}$ that indicates which features are used as splits in tree $t$.\n\\pkg{ControlBurn} works best when the \\emph{ensemble} (set of trees) is reasonably diverse, i.e. each tree is split on a different subset of features. We discuss methods for building trees in \\S\\ref{treebuild}. \n\nOur goal is to choose a sparse weight vector $w \\in \\mathbb{R}^T$ so that \na weighted sum of the predictions of the trees $\\hat y = \\sum_{t=1}^T w_t a^{(t)}$ matches the response $y$ as well as possible.\nWe measure prediction error according to the loss function $\\ell: \\mathbb{R} \\times \\mathbb{R} \\to \\mathbb{R}$, for example:\n\\begin{itemize}\n \\item (for regression) squared error: $\\ell(\\hat y, y) = \\|y - \\hat y\\|^2$,\n \\item (for classification) logistic loss: $\\ell(\\hat y, y) =\\sum_{n=1}^N \\log(1+\\exp(-y_n \\hat y_n))$,\n \\item (for classification) hinge loss: $\\ell(\\hat y, y) =\\sum_{n=1}^N (1 - y_n \\hat y_n)_{+} $.\n\\end{itemize}\n\nFor convenience, denote $A = [a^{(1)}, \\ldots, a^{(T)}] \\in \\mathbb{R}^{N\\times T} $ \nand $G = [g^{(1)}, \\ldots, g^{(T)}] \\in \\mathbb{R}^{N\\times T}$.\nWith this notation, $Aw$ gives the predictions of the weighted tree ensemble and \nfor each feature $p \\in \\{1,\\ldots,P\\}$, $(Gw)_p$ is nonzero if and only if feature $p$ is used by the ensemble.\nSince $w \\geq 0$ and $G$ is binary, $Gw = \\sum_{t=1}^T u_t w_t$, where $u_t$ counts the number of features used by tree $t$, \\textit{i}.\\textit{e}., the number of nonzeros in $g^{(t)}$.\n\n\\pkg{ControlBurn} chooses weights $w$ to minimize the average loss $\\frac{1}{N}\\sum_{n=1}^N \\ell(Aw, y_n)$ of the prediction $Aw$ compared to the response $y$,\ntogether with regularization that controls the number of features selected according to \nregularization parameter $\\alpha$.\nIn the case of square loss, the optimal weight vector $w^\\star$ solves the regularized maximum likelihood estimation problem\n\n\\begin{mini!}\n{w}{\\frac{1}{N}\\left\\|y-\\mathrm{~A} w\\right\\|_{2}^{2}+\\alpha u^T w \\label{opt1obj}}{\\label{optimizationproblem1}}{}\n\\addConstraint{w\\geq 0. \\label{opt1c1}}\n\\end{mini!}\nWe say feature $p$ is selected if $(Gw^\\star)_p$ is non-zero.\n\n\\cite{friedman2003importance} also proposed using the lasso to select trees from an ensemble.\nOur problem differs by weighting each tree $t$ by the number of features $u_t$ used by the tree, in order to reduce the number of \\emph{features} used by the ensemble. \nThis model will tend to choose trees that use only a few features while preserving predictive power.\n\nFinally, \\pkg{ControlBurn} optionally fits another ensemble model of choice, \nsay random forest, on the subset of selected features.\nThis step, which we call \\emph{polishing}, debiases the predictions compared to the lasso predictions \\citep{meinshausen2007relaxed}.\n\n\\subsection{Building trees} \\label{treebuild}\n\nThe success of \\pkg{ControlBurn} depends on the original tree ensemble $\\{1 \\ldots T \\}$. The method works best when the original tree ensemble contains many trees that use only a small fraction of the total features so that the lasso problem can find feature-sparse subsets of the trees. For example, if $\\{1 \\ldots T \\}$ is built via random forests \\citep{breiman2001random} and each tree in the ensemble is grown to full depth, each tree $t \\in \\{1 \\ldots T \\}$ uses nearly every feature. As a result, \\pkg{ControlBurn} will select either all or none of the features; there is no feature-sparse subforest (except the empty forest). Figure \\ref{goodvbad} presents visualizations of \\textit{good} vs. \\textit{bad} ensembles to use in \\pkg{ControlBurn}. \\textit{Good} ensembles are diverse enough so that a feature-sparse subset of trees can be selected. In \\textit{bad} ensembles, selecting a single tree selects almost all of the features. \n\n\n\\begin{figure}[h]%\n \\centering\n\\subfloat[\\centering \\textit{Good} ensemble]{{\\includegraphics[width=0.485\\textwidth]{figures\/sparseforest1.png} }}%\n\\qquad\n\\subfloat[\\centering \\textit{Bad} ensemble]{{\\includegraphics[width=0.445\\textwidth]{figures\/badforest.jpg} }}%\n \\caption{\\textit{Good} vs. \\textit{Bad} ensembles for \\pkg{ControlBurn}. The colors represent which features are used per split. In the \\textit{good} ensemble, the red dashed line selects a feature sparse subforest; features $x_3$ and $x_4$ are excluded. In the \\textit{bad} ensemble, selecting even a single tree selects all the features.}%\n \\label{goodvbad}%\n\\end{figure}\n\n\nVarious algorithms to build ensembles with diverse trees are detailed in \\cite{liu2021controlburn}. We summarize several such algorithms below.\n\n\\begin{itemize}\n \\item \\textbf{Incremental Depth Bagging:} Follow the bagging procedure proposed in \\cite{breiman1996bagging} and grow trees of depth 1. When the training error of the ensemble converges, increment depth; repeat this procedure until the maximum depth is reached.\n \n \\item \\textbf{Incremental Depth Bag-Boosting:} Follow the incremental depth bagging procedure proposed above, but at each depth level, fit trees to the residuals of the model formed by the current ensemble. Across depth levels (boosting iterations) compute the out-of-bag (OOB) difference in error as a proxy for test error. Stop when the OOB error no longer improves.\n \n \\item \\textbf{Incremental Depth Double Bag-Boosting:} Follow the bag-boosting procedure detailed above, but when the training error of the ensemble converges, conduct a boosting iteration \\emph{without} incrementing depth. When the OOB error between boosting iterations no longer improves, increase depth and repeat the procedure until the OOB error of the model no longer improves.\n\\end{itemize}\n\n\n\n\\subsection{Solving optimization problem 1}\n\nLet $D \\in \\mathbb{R}^{T \\times T}$ be a diagonal matrix such that the main diagonal of $D$ is equal to $u$. Each element of $u$, $u_t > 0$ represents the number of features tree $t$ uses. As a result, $D$ is positive-definite and invertible. We can rewrite Problem \\ref{optimizationproblem1} as:\n\n\\begin{mini!}\n{w}{\\frac{1}{N}\\left\\|y-\\mathrm{~AD^{-1}D} w\\right\\|_{2}^{2}+\\alpha \\norm{Dw}_1 \\label{opt2obj}}{\\label{optimizationproblem2}}{}\n\\addConstraint{w\\geq 0. \\label{opt2c1}}\n\\end{mini!}\n\nLet $x=Dw$; the above formulation is equivalent to:\n\n\n\\begin{mini!}\n{w}{\\frac{1}{N}\\left\\|y-\\mathrm{~AD^{-1}} x\\right\\|_{2}^{2}+\\alpha \\norm{x}_1}{\\label{optimizationproblem3}}{}\n\\addConstraint{x \\geq 0. \\label{opt3c1}}\n\\end{mini!}\n\nProblem 3 is equivalent to the non-negative garrote proposed in \\cite{breiman1995better} and can be solved by existing lasso solvers found in \\pkg{Scikit-learn} in \\proglang{Python} or \\pkg{glmnet} in \\proglang{R}. The solution vector $x$ can be mapped back to the weights by a backsolve:\n\\[w = D^{-1}x. \\]\n\nFinally, the entire regularization path for $w$ can be computed efficiently by varying $\\alpha$ and solving problem \\ref{optimizationproblem3} with warm-start continuation \\citep{friedman2010regularization}. This allows a practitioner to rapidly evaluate models with different feature sparsities. \n\n\\section{Software} \\label{software}\n\n\\subsection{Installation}\n\n\n\\pkg{ControlBurn} can be installed via the \\proglang{Python} Package Index \\href{https:\/\/pypi.org\/project\/ControlBurn\/}{PyPI} and is available for Python 3.7 and above. The following dependencies are required.\n\\begin{itemize}\n \\item \\pkg{Numpy} \\citep{harris2020array}\n \\item \\pkg{Pandas} \\citep{jeff_reback_2022_6053272}\n \\item \\pkg{Scikit-learn} \\citep{scikit-learn}\n\\end{itemize}\n\nThe source code for \\pkg{ControlBurn} can be found in the following \\href{https:\/\/github.com\/udellgroup\/controlburn}{repository}. To install \\pkg{ControlBurn}, run the following command in terminal: \\code{pip install ControlBurn}.\n\n\n\\subsection{Quick start}\nBelow, we present a quick example of \\pkg{ControlBurn} on the classic Wisconsin breast cancer binary classification dataset \\citep{wolberg1994machine}. Load \\pkg{ControlBurn} in to your \\proglang{Python} environment via the following.\n\n\\begin{pythoncode}\nimport ControlBurn\nfrom ControlBurn.ControlBurnModel import ControlBurnClassifier\n\\end{pythoncode}\n\nThe code below initalizes a \\code{ControlBurnClassifier}, grows a tree ensemble using the default method of incremental depth bag-boosting, \\code{build_forest_method = 'bagboost'} and solves problem \\ref{optimizationproblem1} with regularization penalty $\\alpha = 0.1$. \n\n\n\\begin{pythoncode}\ncb = ControlBurnClassifier(alpha = 0.1)\ncb.fit(xTrain, yTrain)\nfeatures = cb.features_selected_\n\nfeatures\n>>> ['mean concave points', 'worst perimeter', 'worst concave points']\n\\end{pythoncode}\n\nDuring the ensemble building stage, 40 trees are grown and after the lasso step, 11 trees are selected. The selected ensemble is feature-sparse; the 11 trees only use the features \\code{mean concave points, worst area,} and \\code{worst concave points}. Only 3 of the 30 features in the full dataset are selected.\n\nDuring the \\code{fit} call, \\pkg{ControlBurn} fits a polished model on the selected features. In this example, the default \\code{polish_method = RandomForestClassifier()} is used. The predictions of the polished model on the selected features can be obtained by the following.\n\n\\begin{pythoncode}\npredicted_classes = cb.predict(xTest)\npredicted_probabilities = cb.predict_proba(xTest)\n\\end{pythoncode}\n\nThe prediction accuracy\/AUC of the full 30 feature model is 0.96\/0.99 and the prediction accuracy\/AUC of the polished sparse model of 3 features is 0.96\/0.99. In two lines of code, we obtain a feature-sparse model that performs the same as the full model. \\pkg{ControlBurn} closely follows \\pkg{Scikit-learn} API conventions for easy integration into existing data science workflows. \n\n\\subsection{Tutorial with interpretability tools} \\label{cahousingtutorial}\nIn the following section, we use \\pkg{ControlBurn} on the California Housing Prices regression dataset from UCI MLR \\citep{Dua:2019}. Our goal is to select a sparse subset of features from \\code{MedInc, HouseAge, AveRooms, AveBedrms, Population, AveOccup, Latitude,} and \\code{Longitude} that jointly predict housing price well. We highlight the interpretability tools and features in the package.\n\nTo get started, run the following code.\n\n\\begin{pythoncode}\nfrom ControlBurn.ControlBurnModel import ControlBurnRegressor\ncb = ControlBurnRegressor(build_forest_method = 'doublebagboost', alpha = 0.02)\ncb.fit(xTrain,yTrain)\nprediction = cb.predict(xTest)\nfeatures = cb.features_selected_\n\nfeatures\n>>> ['MedInc', 'HouseAge', 'Latitude', 'Longitude']\n\\end{pythoncode}\n\nWe fit a \\code{ControlBurnRegressor} that uses incremental depth double bag-boosting to build the ensemble (and lasso to sparsify it). Double bag-boosting ensures that the effects due to single features are adequately represented before trees with two features are introduced, and similarly for each higher-order interaction.\n\nOut of the 79 trees grown, only 16 are selected. This subforest only uses the features \\code{MedInc, HouseAge, Latitude, Longitude}; only half of the features are selected. The feature \\code{MedInc} is the average earnings of households in the neighborhood surrounding a house, and \\code{Latitude} and \\code{Longitude} specify the location of the house. These features are important for predicting housing prices. The sparse polished model has a test mean-squared error (MSE) of 0.32 and the full model has a test MSE of 0.33. \\pkg{ControlBurn} is able to quickly eliminate 4 redundant features in this example.\n\n\n\\pkg{ControlBurn} provides interpretability tools to analyze the selected subforest. Import the interpretability module and initialize an interpreter using the fitted \\code{ControlBurnRegressor} object.\n\n\\begin{pythoncode}\nfrom ControlBurn.ControlBurnInterpret import InterpretRegressor\ninterpreter = InterpretRegressor(cb,xTrain,yTrain)\n\\end{pythoncode}\n\nTo plot the feature importance scores of the selected subforest, run the following line of code.\n\n\\begin{pythoncode}\nimportance_score = interpreter.plot_feature_importances()\n\\end{pythoncode}\n\n\n\\begin{figure}[h!]\n \\centering \n\\includegraphics[width = 0.75\\textwidth]{figures\/feature_importance_scores.pdf}\n \\caption{Weighted feature importance scores for the subforest selected by \\pkg{ControlBurn}. }\n \\label{featureimportances}\n\\end{figure}\n\nThe weighted feature importance scores in Figure \\ref{featureimportances} are computed by multiplying the impurity-based feature importance score of each tree in the subforest by the weight the tree is assigned during the lasso step (Problem \\ref{optimizationproblem1}).\n\n\nThe interpreter can also list the features used in each tree of the selected subforest.\n\n\\begin{pythoncode}\nfeatures_per_tree = interpreter.list_subforest(verbose = True)\n\\end{pythoncode}\n\nThis command outputs the following subforest structure:\n\n\\begin{pythoncode}\n>>> ['MedInc'], ['MedInc'], ['MedInc'], ['MedInc'], ['MedInc'], ['MedInc'],\n ['MedInc'], ['MedInc'], ['MedInc'], ['MedInc'], ['MedInc'], \n ['Latitude' 'Longitude'], ['Latitude' 'Longitude'], ['MedInc' 'HouseAge'],\n ['Latitude' 'Longitude'], ['Latitude' 'Longitude']\n\\end{pythoncode}\n\nEach array shows the features used by a decision tree. In this example, the feature \\code{MedInc} appears in several single-feature trees. We can use our interpreter to plot a shape function that shows how changes in the feature contribute to the response by aggregating these single feature trees.\n\n\\begin{pythoncode}\nplot_single = interpreter.plot_single_feature_shape('MedInc')\n\\end{pythoncode}\n\n\\begin{figure}[h]\n \\centering \n\\includegraphics[width = 0.85\\textwidth]{figures\/shapefunctionsinglefeat.pdf}\n \\caption{Shape function showing the contribution of feature \\code{MedInc} towards the prediction.}\n \\label{shapefunctionfigure}\n\\end{figure}\n\n\n\nFrom the plot in Figure \\ref{shapefunctionfigure}, we see that house prices rise with the median income of the neighborhood. We can also see the nonlinearity of the dependence: for example, the very steep rise in house prices as we move to the highest-income neighborhoods.\n\nThe features Latitude and Longitude also appear in many trees together. We can use the interpret module to examine how this pairwise feature interaction impacts the predictions. \n\\begin{pythoncode}\nplot_pairwise = interpreter.plot_pairwise_interactions('Latitude','Longitude')\n\\end{pythoncode}\n\n\n\n\\begin{figure}[p]\n\\centering\n\\includegraphics{figures\/pairwiseheatmap.pdf}\n\\caption{Pairwise interaction between \\code{Latitude} and \\code{Longitude}.}\n\\label{pairwiseheatmap}\n\\includegraphics{figures\/CaliforniaHousing.pdf}\n\\caption{\\code{Latitude} and \\code{Longitude} pairwise interaction effect on housing price, overlayed on a map of California.}\n\\label{CAmap}\n\\end{figure}\n\nWe observe in Figure \\ref{pairwiseheatmap} that house prices are highest in the northwest of California, and lowest in the southeast. We can overlay this heatmap on a map of California to understand this effect better. In Figure \\ref{CAmap} we observe that our model identifies that houses located in the San Francisco Bay area are most expensive; houses along the coast to Los Angeles and San Diego, in yellow, are next most expensive; and houses further inland, in green, are cheaper. These results are consistent with historical house price trends in the state.\n\n\n\n\\subsection{Regularization path}\nBy varying the regularization parameter $\\alpha$, we can compute the entire regularization path and observe how features enter the support. The cost of computing the entire path is comparable to solving the lasso problem once. Execute the code below to compute the entire regularization path and plot how the identified feature importance of each feature changes as the regularization parameter alpha varies.\n\n\\begin{pythoncode}\nalphas,coef = cb.solve_lasso_path(xTrain,yTrain)\nregularization_importances = interpreter.plot_regularization_path()\n\\end{pythoncode}\n\n\\begin{figure}[h]\n \\centering \n\\includegraphics[width = \\textwidth]{figures\/lassopath.pdf}\n \\caption{Regularization path obtained by varying $\\alpha$. }\n \\label{regularizationpath}\n\\end{figure}\n\n\nThe vertical axis of the plot in Figure \\ref{regularizationpath} shows, for each feature, the MDI feature importance from each tree weighted by the lasso solution coefficient. Unlike the linear lasso coefficient regularization path, our feature importance paths are not necessarily monotonic. For example, in Figure \\ref{regularizationpath} when \\code{Latitude} and \\code{Longitude} drop out of the subforest, the remaining feature \\code{MedInc} is assigned a higher weight and therefore a higher weighted feature importance score.\n\n\n\\subsection{Selecting the best regularization parameter}\n\n\\pkg{ControlBurn} can automatically select a good regularization parameter by searching the regularization path for the parameter that minimizes the k-fold cross-validation error (default k = 5) of the model, using the \\code{fit_cv} method. \n\\begin{pythoncode}\nbest_alpha, support_size, best_features = cb.fit_cv(xTrain,yTrain, \n show_plot = True, kwargs = {'tol':0.001})\n\nbest_alpha\n>>> 0.012354087681630486\nsupport_size\n>>> 4\nbest feature sets\n>>> ('AveOccup', 'Latitude', 'Longitude', 'MedInc'), \n ('HouseAge', 'Latitude', 'Longitude', 'MedInc')\n\\end{pythoncode}\n\n\\begin{figure}[h]\n \\centering \n\\includegraphics[width = 1\\textwidth]{figures\/fitcvplot.pdf}\n \\caption{Left plot shows validation error vs. $\\alpha$. Right plot shows validation error vs. number of features selected. The best support size contains four features.}\n \\label{fitcvplot}\n\\end{figure}\n\nIn this example, \\pkg{ControlBurn} selects a regularization parameter of 0.012, which selects four features. \\code{Latitude}, \\code{Longitude}, and \\code{MedInc} are consistently selected as important features while \\code{AveOccup} and \\code{HouseAge} are variably included in the support in different folds. The \\code{fit_cv} method automatically selects the optimal value of alpha and refits a tuned ControlBurnRegressor using that parameter. The features selected by the tuned model can be accessed with the command below.\n\n\\begin{pythoncode}\ncb.features_selected_\n>>> ['MedInc', 'HouseAge', 'Latitude', 'Longitude']\n\\end{pythoncode}\n\n\\section{Advanced capabilities}\n\\label{capabilities}\n\nIn the following section, we present some advanced capabilities of the \\pkg{ControlBurn} package.\n\n\\subsection{Non-homogeneous feature costs}\nIn certain modeling applications, some features may be more expensive to obtain than others. \nIn the \\pkg{ControlBurn} framework, the user can assign each feature a cost and minimize the total cost of the selected features.\n\nLet $c_p$ represent the relative cost of selecting feature $p$ and consider the framework presented in \\S\\ref{generalframework}. Let $\\delta_t$ represent the set of features used by tree $t$. Assign each tree $t$ the following weight:\n\n\\[u_t= \\sum_{p \\in \\delta_t} c_p.\\]\n\nThe original \\pkg{ControlBurn} framework with no feature costs corresponds to the case where $c_p = 1, \\mkern9mu \\forall \\ p \\in \\{ 1 \\ldots P \\}.$\n\nIn the following example, we demonstrate how \\pkg{ControlBurn} incorporates feature costs using the body fat regression dataset from \\cite{penrose1985generalized}. The goal is to predict body fat percentage using the features: \\code{Age,\n Weight,\n Height,\n Neck,\n Chest,\n Abdomen,\n Hip,\n Thigh,\n Knee,\n Ankle, Biceps, Forearm} and \\code{Wrist}.\n \n Consider a hypothetical scenario where it is twenty times more time-consuming for an observer to measure a subject's torso, because the subject may need to remove bulky outerwear. We assign feature costs of 20 to \\code{Chest, Abdomen, Hip} and feature costs of 1 to everything else. Assigning these feature costs and computing the entire regularization path with \\pkg{ControlBurn} can be done via the following.\n \n \\begin{pythoncode}\ncosts = [1,1,1,1,20,20,20,1,1,1,1,1,1]\ncb = ControlBurnRegressor()\ncb.solve_lasso_path(xTrain,yTrain,costs = costs)\n\n\\end{pythoncode}\n\nFigure \\ref{bodyfatfeaturecosts} compares the regularization paths computed by \\pkg{ControlBurn} with and without feature costs. Without feature costs, \\code{Abdomen} circumference is the best predictor of bodyfat percentage. When feature costs are included the trio, \\code{Age, Height,} and \\code{Neck} replace \\code{Abdomen} as the most important features.\n\n\n\n\\subsection{Feature groupings}\n\nIn some settings, users choose whether or not to acquire costly \\emph{groups} of features.\nOnce one feature in the group has been acquired, the rest are free.\nExamples might include measurements taken as part of a complete blood panel (CBC): white blood cell counts are obtained at the same time as red blood cell counts.\nAs another example, in remote sensing, temperature, humidity, and pressure readings at a given location can be obtained by placing a single sensor. To create a model that is sensitive to these feature groupings, \\pkg{ControlBurn} can penalize each tree for the \\emph{groups}, not individual features, that it uses.\n\nConsider the modeling framework presented in \\S\\ref{generalframework} and let $T_t$ represent the set of feature groups used by tree $t$. Let $c_g$ represent the cost of selecting group $g$ and assign each tree $t$ the weight\n\\[u_t= \\sum_{g \\in T_t} c_g.\\]\nThe standard \\pkg{ControlBurn} framework corresponds to the case where all groups are singletons and all weights $c_g$ are set to $1$.\n\nIn the section below, we return to the body fat regression example to demonstrate how \\pkg{ControlBurn} can guide users' decisions on whether to acquire different feature groups. Consider the scenario where the features \\code{Age, Weight, Height} can be obtained from the patient's medical history, and the remaining features are partitioned by their location on the patient's body. The features \\code{Neck, Chest, Abdomen} can be obtained by measuring the patient's core, the features \\code{Hip, Thigh, Knee, Ankle} can be obtained by measuring the patient's legs, and the features \\code{Biceps, Forearm, Wrist} can be obtained by measuring the patient's arm. \n\nWe can penalize selecting features over the four groups, History, Core, Legs, and Arms, each group having a cost of $1$, via the following.\n\n \\begin{pythoncode}\ngroups = [1,1,1,2,2,2,2,3,3,3,4,4,4]\ncb = ControlBurnRegressor()\ncb.solve_lasso_path(xTrain,yTrain,groups = groups)\n\\end{pythoncode}\n\nThe list \\code{groups} assigns each feature an integer group id, and in this setting \\pkg{ControlBurn} minimizes the total number of groups selected.\n\nThe bottom plot in Figure \\ref{bodyfatfeaturecosts} shows the output of this code chunk. Note that compared to the original \\pkg{ControlBurn} regularization path, the regularization path with feature grouping utilizes the feature \\code{Neck} more frequently. This is due to the fact that the feature \\code{Neck} is obtained at no additional cost when the feature \\code{Abdomen} is selected since they both belong to the feature group Core. The feature group History is introduced shortly after the feature group Core.\n\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=\\textwidth]{figures\/bodyfatexample.pdf}\n \\caption{Effect of feature costs and feature groupings on \\pkg{ControlBurn} regularization paths.}\n \\label{bodyfatfeaturecosts}\n\\end{figure}\n\nTo obtain the weighted feature importance scores of each group, run this command.\n\n\\begin{pythoncode}\ngroup_names = ['History', 'Core', 'Legs', 'Arm']\ngroup_importances = interpreter.plot_feature_importances(groups, \n group_names, show_plot = True)\n\\end{pythoncode}\n\nThis outputs a bar plot of feature importance scores by group (Figure \\ref{groupfeatureimportanceplot.fig}).\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=.75\\textwidth]{figures\/groupfeatureimportances.pdf}\n \\caption{Plot of weighted feature importance scores by group.}\n \\label{groupfeatureimportanceplot.fig}\n\\end{figure}\n\n\n\n\\subsection{Custom ensembles}\n\nThe ensemble building algorithms in \\pkg{ControlBurn} can be easily replaced with custom pre-trained ensembles. Pre-trained ensembles are restricted to collections of \\pkg{Scikit-learn} trees. For example, to train and parse in a \\code{GradientBoostingRegressor}, run the following.\n\n\\begin{pythoncode}\nfrom sklearn.ensemble import GradientBoostingRegressor\nStochasticGB = GradientBoostingRegressor(max_depth = 2, max_features = 'log2', \n subsample = 0.05)\nStochasticGB.fit(xTrain.values,yTrain)\ntree_list = np.ndarray.flatten(StochasticGB.estimators_)\n\ncb_custom = ControlBurnRegressor(build_forest_method = 'custom', \n custom_forest = tree_list)\ncb_custom.fit(xTrain,yTrain)\n\\end{pythoncode}\n\nNote that \\pkg{ControlBurn} works best with diverse ensembles that use very few features per split and shallow trees. Caution should be taken that custom ensembles are adequately diverse. Otherwise \\pkg{ControlBurn} may select only the null or the full model. \n\nFor example, given a Random Forest with deep trees, \\pkg{ControlBurn} can only select a null or full model (see the left plot in Figure \\ref{rfvsebm}); whereas the trees grown by an Explainable Boosting Machine (EBM) \\citep{lou2012intelligible} each use at most two features, so \\pkg{ControlBurn} works well.\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=\\textwidth]{figures\/customensembles.pdf}\n \\caption{Regularization path of \\pkg{ControlBurn} on custom ensembles. On a random forest, where each tree uses every feature, \\pkg{ControlBurn} can select either the full or null model. The package works much better on EBMs and can select subforests of varying sparsities.}\n \\label{rfvsebm}\n\\end{figure}\n\n\n\n\n\\subsection{Sketching}\n\nThe optimization framework in \\pkg{ControlBurn} scales linearly with the number of training observations, $N$. To reduce computation time, we can subsample\/sketch matrix $A$. Define $S \\in \\mathbb{R}^{\\eta \\times N}$ as the Gaussian sketching matrix, where $\\eta$ is the number of rows subsampled uniformly from $A$. We rewrite problem \\ref{optimizationproblem1} as\n\n\\begin{mini!}\n{w}{\\frac{1}{N}\\left\\|Sy-S\\mathrm{~A} w\\right\\|_{2}^{2}+\\alpha u^T w \\label{sketchedobj}}{\\label{sketchedproblem}}{}\n\\addConstraint{w\\geq 0. \\label{skectchedc1}}\n\\end{mini!}\n\nTo use sketching in the \\pkg{ControlBurn} package, choose a proportion $\\rho \\in (0,1)$ of the training data to sample, which corresponds to $\\eta = \\lfloor N \\rho \\rfloor$ number of samples. For example, we may choose the sketching parameter $\\rho = 0.1$ and run the following code:\n\\begin{pythoncode}\ncb = ControlBurnRegressor()\ncb.fit(xTrain,yTrain,sketching = 0.1)\n\\end{pythoncode}\n\nFigure \\ref{sketchingcomparison} compares the runtime and performance of sketching versus no-sketching for \\pkg{ControlBurn} on the California housing dataset. With a sketching parameter of $\\rho = 0.1$, the optimization step of \\pkg{ControlBurn} runs about 3x faster (left) and the selected model performs about equally well (right).\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=.96\\textwidth]{figures\/sketchcomparison.pdf} \n \\caption{Comparison of \\pkg{ControlBurn} lasso solve with and without sketching. Sketching reduces computation time with negligible performance loss. }\n \\label{sketchingcomparison}\n\\end{figure}\n\n\\subsection{Best subset selection}\n\n\n\\pkg{ControlBurn} can also use best-subset feature selection to select a feature-sparse subforest. In the linear setting, advancements in combinatorial optimization solvers have made best-subset selection feasible for medium-sized datasets (with thousands of samples and tens of features) \\citep{bertsimas2016best}. \nOn these datasets, best-subset selection has been shown to outperform lasso on regression problems \nin the high signal-to-noise ratio regime \\citep{hastie2017extended,mazumder2020discussion}. \nOne major advantage of best-subset selection is that the desired number of features can be directly specified. \nLet $K$ represent the desired number of features in the selected subforest. \nBest-subset selection over a tree ensemble finds weights $w_t$ for each tree $t \\in \\{ 1,\\ldots,T \\}$ to solve\n\\begin{mini!}\n{w}{\\frac{1}{N}\\left\\|y-\\mathrm{~A} w\\right\\|_{2}^{2}\\label{bestobj}}{\\label{bestsubsetproblem}}{}\n\\addConstraint{\\|Gw\\|_0 = K \\label{bestc1}}\n\\addConstraint{w\\geq 0, \\label{bestc2}}\n\\end{mini!}\nwhere $\\|\\cdot\\|_0$ counts the number of non-zero entries in its vector argument.\nConstraint (\\ref{bestc1}) ensures that exactly $K$ features are selected.\nAs in \\S\\ref{generalframework}, matrix $G$ captures which features are used by each tree. If an entry of $Gw \\in \\mathbb{R}^T$ is zero, the corresponding feature is excluded from the subforest. \n\n\\pkg{ControlBurn} can choose features by best subset selection with the \\code{solve_l0} function:\n\\begin{pythoncode}\ncb = ControlBurnRegressor()\ncb.bagboost_forest(xTrain,yTrain)\ncb.solve_l0(xTrain, yTrain, K = 5)\ncb.features_selected_\n\\end{pythoncode} \n\n\\pkg{ControlBurn} uses \\pkg{Gurobi} to efficiently solve the $\\ell_0$-constrained mixed-integer quadratic program (MIQP) presented above \\citep{gurobi}. \n\nTo demonstrate some advantages of \\pkg{ControlBurn} with best-subset selection, we use best-subset selection and lasso to obtain the best 3-feature model on the US Crime dataset \\citep{redmond2002data}. The goal is to predict neighborhood crime rates using 127 demographic and economic features, many of which are highly correlated. Figure \\ref{bestsubsetcomparison} compares the distribution in performance between the best model selected by lasso versus the best model selected by best-subset selection. The best model selected by best-subset selection improves test MSE slightly compared to the best model selected via lasso, as is common in other problems \\citep{mazumder2020discussion}.\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=.65\\textwidth]{figures\/bestsubset.pdf} \n \\caption{\\pkg{ControlBurn} with best-subset selection vs. lasso. Sparse models selected by best-subset selection improve test MSE slightly compared to those selected by lasso.}\n \\label{bestsubsetcomparison}\n\\end{figure}\n\n\n\\section{Real-world application: Emergency room triage}\n\\label{application}\nWe conclude by applying \\pkg{ControlBurn} to a more extensive real-world example. The Yale Emergency Room Triage dataset \\citep{hong2018predicting} consists of adult emergency room records from the Yale New Haven Health System from 2014 to 2017. In \\cite{hong2018predicting}, the authors build binary classification models to predict hospital informations using triage information and patient medical history. Tree ensemble methods such as XGBoost achieve remarkable performance, with test AUC scores of 0.9. The feature importance scores of such models reveal that the emergency severity index (ESI) score, and what medications the patients were taking were the most influential predictors for hospital admission. ESI scores are triage scores assigned by the admitting medical staff and rank a patient on a scale from 1-5. Score 1 and 2 patients are in critical condition and require immediate life-saving care. Score 3 and 4 patients are non-critical but require care to stabilize. Score 5 patients require no emergency room resources to stabilize.\n\nWe use \\pkg{ControlBurn} to select the most important predictors of hospital admission among non-critical patients that require care (ESI levels 3 and 4). The real-world implications of this classification task are interesting; patients with ESI scores 3 and 4 do not obviously need to be hospitalized but have the potential to take a turn for the worse. Determining which features predict hospital admission among this sub-population may provide useful clues to medical staff conducting triage.\n\nDuring the ensemble-building stage, \\pkg{ControlBurn} uses bag-boosting to build 112 trees that use 896 of the 969 features in the dataset. With a regularization parameter of $\\alpha = 0.0015$, the lasso step of \\pkg{ControlBurn} selects a 10 tree subforest that uses just 10 features. A random forest classifier fit on just the 10 selected features achieves a test AUC score of 0.81. The same classifier fit on the full feature space performs marginally better, with an AUC score of 0.88. For around a 10 percent decrease in performance, the number of features used in the model can be reduced by a factor of 90. Table \\ref{tab:tablecompare} compares the performance of the model using features selected by \\pkg{ControlBurn} against the full model, on various learning algorithms described in \\citep{hong2018predicting}. Across all algorithms, the sparse model selected by \\pkg{ControlBurn} performs within 10 percent of the full model.\n\n\n\\begin{table}[]\n\\centering\n\\begin{tabular}{|l|l|l|}\n\\hline\n\\textbf{Method} & \\textbf{Full Model AUC} & \\textbf{Sparse Model AUC} \\\\ \\hline\n\\textbf{Logistic Regression} & 0.88 & 0.82 \\\\ \\hline\n\\textbf{Random Forest} & 0.88 & 0.81 \\\\ \\hline\n\\textbf{XGBoost} & 0.90 & 0.85 \\\\ \\hline\n\\end{tabular}\n\\caption{Comparison of AUC scores of full model vs. sparse model using features selected by \\pkg{ControlBurn}. Methods from \\cite{hong2018predicting} applied to our modified dataset: emergency room records filtered on ESI levels 3 and 4.}\n\\label{tab:tablecompare}\n\\end{table}\n\n\n\n\nThe subforest selected by \\pkg{ControlBurn} has the following structure of 7 single feature trees and 3 multi-feature trees.\n\n\\begin{pythoncode}\n>>> ['meds_gastrointestinal'], ['meds_cardiovascular'],['meds_cardiovascular'],\n ['meds_cardiovascular'], ['meds_cardiovascular'], ['meds_cardiovascular']\n ['meds_gastrointestinal']\n\n ['previousdispo' 'meds_cardiovascular' 'meds_gastrointestinal'],\n ['previousdispo' 'n_admissions' 'meds_cardiovascular' 'meds_gastrointestinal'],\n ['dep_name' 'age' 'insurance_status' 'n_admissions' 'triage_vital_sbp'\n 'meds_analgesics' 'meds_cardiovascular' 'meds_vitamins']\n\\end{pythoncode}\n\nThe most important features, \\code{meds_cardiovascular} and \\code{meds_gastrointenstinal} are contained in single-feature, single-split trees. These numerical features indicate the amount of cardiovascular or gastrointestinal medication a patient is taking before they present at the ER.\nFrom these single feature trees, it is apparent that patients currently taking these types of medications are more likely to be admitted; these medications are often used to treat chronic conditions in major organ systems.\n\n\\begin{figure}[h!] \n \\centering\n \\includegraphics[width=\\textwidth]{figures\/yale3feattree.pdf} \n \\caption{Three feature tree selected by \\textsc{ControlBurn} on the Yale emergency room triage dataset. Darker shades indicate the node increases the log-likelihood of hospital admission.}\n \\label{yale3feat}\n\\end{figure}\n\nIn addition, the multi-feature trees selected reveal interesting interactions in the data. The 3-feature tree \\code{[previousdisp, meds_cardiovascular, meds_gastrointenstinal]} is presented in Figure \\ref{yale3feat}. The third layer of the tree splits on the ordinal feature \\code{previousdispo} on the value -0.79. This feature represents the disposition of the patient on their last emergency room visit, patients with \\code{previousdispo} values less than -0.79 were either admitted or left against medical advice. In both cases, the recommendation of the ER staff was to admit the patient and as a result, patients who have \\code{previousdispo} values in these categories are more likely to be admitted upon subsequent ER visits. Consider the left-most branch in the tree in Figure \\ref{yale3feat}. Patients along this branch present in a non-critical condition and are not currently taking cardiovascular or gastrointestinal medications, but are more likely to be admitted since they were admitted in the past. This can be due to an abundance of caution on the part of the ER staff.\n\n The features \\code{n_admissions, dep_name, age, insurance_status, meds_vitamins,\\\\ meds_analgesics}, and \\code{triage_vital_sbp} are introduced in the deeper trees selected. The structures of these trees are complex and more difficult to interpret but can reveal interesting relationships. For example, the feature \\code{n_admissions} represents the number of prior hospital admissions for a patient and behaves similarly to the feature \\code{previousdispo}; patients previously hospitalized are more likely to be admitted when visiting the ER. Patients with \\code{insurance_status} equal to self-pay are less likely to be admitted since they may need to cover the cost of hospitalization. Finally, older patients are more likely to be admitted than younger ones.\n \nBy selecting a feature-sparse subforest, \\pkg{ControlBurn} allows practitioners to identify important features and examine individual decision trees to determine how these features interact with each other and the response. The resulting subforest is much more interpretable than standard tree ensembles such as random forests, which contain hundreds to thousands of deep trees to visualize and may yield biased feature importance scores. In addition, a polished model fit on the features selected by the subforest often performs identically to an ensemble fit on the entire feature space. \\pkg{ControlBurn} allows practitioners to extract insights from real-world data while preserving model performance.\n\n\n\n\n\\section{Concluding remarks}\n\nThe package \\pkg{ControlBurn} extends linear feature selection algorithms to the nonlinear setting. The algorithm behind \\pkg{ControlBurn} uses trees as basis functions and penalizes the number of features used per tree via a weighted $\\ell_1$-penalty. By selecting a feature-sparse subforest, \\pkg{ControlBurn} can quickly isolate a subset of important features for further analysis. \\pkg{ControlBurn} also contains various built-in interpretability and visualization tools that can assist data analysis. By examining the structure and decision boundaries of the selected subforest, a practitioner can discover interesting insights in the data. In addition, \\pkg{ControlBurn} can automatically evaluate the best support size by rapidly computing the entire path for the regularization parameter. Finally, \\pkg{ControlBurn} is flexible and can accommodate various frameworks such as feature groupings and non-homogeneous feature costs. The package can also accept custom ensembles and an $\\ell_0$-based solver for best-subset selection over trees. \nThe source code for \\pkg{ControlBurn} as well as the code and data to reproduce the experiments in this paper can be found at \\url{https:\/\/github.com\/udellgroup\/controlburn\/}. \n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction} \\label{section1}\nThe task of storing and exchanging information lies at the heart of our society. In many cases information has to be transmitted in a secure fashion. Numerous examples can be found where a secure information exchange is crucial, ranging from sensitive private information such as one's own genome, to financial information, military equipment, or critical infrastructure. While various encryption schemes, as well as the strategies of breaking them, have been employed over time (see Singh for a historic overview \\cite{Singh1999}), most current security standards rely on the computational complexity of so-called one-way functions \\cite{Impagliazzo1989}. However, considering the steady increase in computational power, today's secrets might not stay secret forever. Additionally, breakthroughs in the fields of quantum computing might endanger security schemes such as the Rivest\u2013Shamir\u2013Adleman (RSA) scheme, which is based on prime factorization of large numbers, a problem that could be solved efficiently on future quantum computers using Shor's algorithm \\cite{Shor1997}. In addition classical encryption protocols do exist, which claim to be post-quantum secure - but none of them offers ultimate security \\cite{Bernstein2017}. \\\\\nThis is where quantum key distribution (QKD) comes into play, which is a method of establishing a random bitstring, securely shared between authenticated parties. This key can then be used to encrypt messages that are indeed provably secure, protected not by computational complexity, but by the laws of quantum mechanics \\cite{Shor2000,Gisin2002}. In brief, the communicating parties exchange quantum two-level systems (also known as quantum bits or qubits), prepared in one of two incompatible bases, so that any eavesdropping attempt requires a measurement on the qubits which causes detectable errors if the wrong basis was chosen by the eavesdropper. The eavesdropper hereby has to decide for only one basis, since quantum states cannot be copied \\cite{Wootters1982}. By that, any eavesdropping attempt can be noticed and the particular bit string is not used as a key to encrypt the message. Also, in contrast to classical encryption schemes, a postponed measurement of the transmitted qubit is not possible. Hence, securely transmitted data will remain secure also in future. \n\\\\\nEqually important, photonic quantum channels not only provide a means of perfectly secure communication, but they also enable other quantum technologies. \"Flying\" qubits, i.e. photons, are vital for distributed quantum computing schemes and to interface different parts of a future quantum computer, as famously formulated in the DiVincenzo criteria \\cite{DiVincenzo2000}. \n\\\\\nOnce several nodes are securely interconnected, one speaks of a quantum network and a future vision would be to connect parties all over the world via perfectly secure quantum channels - a vision often referred to\/called the quantum internet \\cite{Kimble2008}. This review intends to summarize and discuss some of the progress made towards achieving that vision, with a focus on implementations of quantum communication using quantum light sources based on epitaxial semiconductor quantum dots (QDs). \n\\\\\nLet us begin by introducing quantum key distribution in more detail. Historically, the ideas of quantum cryptography date back to the late 1960s, when Wiesner first formulated his ideas on conjugate coding, a work published more than a decade later in 1983 \\cite{Wiesner}. We refer to Bennett et al. \\cite{Bennett1992a} for a first-hand historical review. Motivated by the ideas of Wiesner, Bennett, and Brassard proposed the first actual key distribution protocol in 1984, later referred to as the BB84 protocol, using the quantum mechanical properties of single photons to detect eavesdropping attempts \\cite{Bennett1984}. In their seminal work, the authors proposed to use the polarization of single photons to encode the bits in different, randomly chosen bases (see \\textbf{Figure \\ref{fig:fig1}a}). Once the photons are transmitted from Alice to Bob (typical names for the communicating parties), Bob also measures them in a randomly selected basis. After Alice and Bob are authenticated, they share the selected bases over a public channel and keep only the measurement results of the cases in which both of them had measured a photon in the same basis (a process called \"key sifting\"), without communicating the actual measurement results. By comparing a subset of the results, potential eavesdropping can then be detected, since by the laws of quantum mechanics every measurement of an adversary in the wrong basis perturbs the quantum state, which leads to detectable errors. After post-processing steps, which reduce errors and enhance the secrecy, the remaining bits form the secure (or secret) key. This scheme is also referred to as prepare-and-measure setting, since Alice prepares the photon states and Bob measures them. \\par\nA few years later, in 1991, Artur Ekert proposed the first QKD protocol using entangled photon pairs \\cite{Ekert1991} (Figure \\ref{fig:fig1}b). The Ekert91 protocol relies on detecting an eavesdropper by monitoring the amount of violation of a Bell-like inequality \\cite{Clauser1969,Bell1964}, which quantifies the degree of remaining entanglement. In addition, one can also use the distributed entangled photons directly for measurements in the BB84 bases, compare some of the results and deduce the security from the identified error rates just as in the BB84 protocol - a protocol known as BBM92 \\cite{Bennett1992}. \n\\\\\nNote that sending single photons from Alice to Bob (prepare-and- measure) or Alice and Bob both receiving photons from a central source (entanglement based) are equivalent. One can imagine QKD with entangled photons also in the way that Alice measures a photon, which then travels backwards in time to the source and then forward in time to Bob. \n\\\\\nNote also, that an initial misconception was that, since the source can be placed at half of the distance between Alice and Bob, the achievable distance is doubled in the Ekert protocol. This is not the case, since although each photon needs to travel only half the distance, there are two photons that need to reach the receiver, thus canceling the effect of the reduced individual distance. The arrival probability is proportional to the transmittance of the quantum channels for the respective photons $T_{1(2)}$ for a channel of length $L_{1(2)}$, which are described by an exponential absorption loss inside the optical fiber given by an absorption constant $\\alpha$ (about 0.2 dB\/km in ultralow-loss fibers). The probability that both photons arrive is $P \\sim T_1 \\cdot T_2$ , which is the same as for one photon passing through a channel of the summed lengths.\n\\begin{equation}\n P \\sim T_1 \\cdot T_2 = e^{-\\alpha L_1} \\cdot e^{-\\alpha L_2} = e^{-\\alpha (L_1+L_2)}\n\\end{equation}\nNowadays, numerous other QKD protocols are known beyond the simple BB84 and Ekert protocols, ranging from decoy protocols for attenuated lasers, to asymmetric versions of BB84, protocols with more states (6-state), less states (2-state) or multi-dimensional protocols, full or partly device independent protocols, two-way protocols and coherent-one-way protocols, reference-frame independent protocols, twin-field protocols, continuous variable protocols and many more. For a recent overview we refer to Pirandola et al. \\cite{Pirandola2019}. \n\\\\\nHaving established a secure key by some QKD protocol, how can the two parties now exchange a message and be sure that nobody else knows its content? The only provably secure encryption method \u2013 in an information theoretical sense \u2013 known to date, is the one-time pad (OTP) \\cite{shannon1949} (see Figure \\ref{fig:fig1}c). This symmetric encryption method, first postulated by G. Vernam in 1926 \\cite{Vernam1926}, is based on four requirements:\n\\begin{itemize}\n \\item The key of Alice and Bob is secret\n \\item It is randomly generated\n \\item It has at least the same length as the message to be encrypted\n \\item It is used only once (hence the name one-time-pad).\n\\end{itemize}\nIf these requirements are met, the secret key can be applied to the message using an XOR (eXclusive OR) logical operation (a modulo-2 addition). The resulting encrypted message appears to third parties as random as the key itself and therefore does not disclose any useful information. Then, the encrypted message can be sent over a public channel. The other party can now use the same key and apply it with an XOR operation to the received, encrypted bit string, by which the original message is recovered. The problem for any classical key distribution process however is to guarantee the secrecy of the key distribution. Exactly this secrecy can be guaranteed by means of QKD.\n\\\\\nQuantum cryptography is physically secure in the sense that an eavesdropping attempt can always be detected. The most basic eavesdropping scenario is the intercept-resend strategy where an adversary just measures Alice's photons in a random basis and then sends new photons to Bob, this is indicated in the upper panel of Figure \\ref{fig:fig1}d. In BB84 half the choices then lead to wrong bases and thus to a disturbance of the quantum states. When an eavesdropping attempt is detected, it can either be compensated (if the error is low enough) by distilling a shorter key that is again secure, or the key is discarded and a new key exchange is initiated, until the final key is provably secure. This requires in all cases an authenticated classical channel to communicate some information such as the used measurement bases in the BB84 protocol. To realize that authentication, some shared, secret bits must already be present to begin with, which is why QKD is technically a key expansion scheme. Note furthermore, that in most of the QKD protocols random numbers are needed in one way or the other, either to encode a random bit or to pick measurement bases randomly. Thus, true random number generators are essential for QKD schemes to be absolutely secure (see section \\ref{section4.5}).\nIt is worth mentioning that quantum cryptography in general is the art of using quantum mechanical effects to perform cryptographic tasks, which includes much more than only exchanging a secure key (see e.g. Broadbent et al. for an overview \\cite{Broadbent2016}). Nevertheless, in this review we focus on the task of QKD, since the building blocks that are necessary for successful QKD with single photons (sources, channels, memories, repeaters, random numbers etc.) will also enable many other cryptographic applications. \\\\\n\\begin{figure}[h]\n \\includegraphics[width=\\linewidth]{figure1.png}\n \\caption{Principle of QKD: Prepare and Measure based (a) and entanglement based (b) protocols can be used to generate a secret key that can be used with the one-time-pad (c) for absolutely secure communications. Common eavesdropping strategies (d).}\n \\label{fig:fig1}\n\\end{figure}\nWhen implementing a QKD protocol, one of the first choices to take is the technology platform and the respective qubits used. To realize a \"flying\" qubit, photons are the obvious choice. They can be transmitted over long distances in optical fibers or through free-space links and hardly interact with their environment which leads to unmatched coherence properties \\cite{OBrien2009}. Note that in principle other types of exchangeable qubit realizations could be imagined such as electrons in wires, but compared to photons they face more loss and decoherence which strongly limits the maximum distances \\cite{Hermelin2011,McNeil2011}. Due to the photon's coherence properties, speed, and the possibility to encode information in various degrees of freedom (e.g., polarization, time-bin, energy, path, phase or orbital angular momentum, see \\cite{flamini2018} for an overview), they are a promising candidate for many quantum information tasks such as quantum computing, sensing, metrology and of course quantum cryptography.\nFor QKD different encoding schemes have been developed, which will be briefly summarized in the following \\cite{Gisin2002}. \n\\\\\nIt is straightforward to encode qubits in the polarization states of photons, which is why the very first demonstration of QKD in 1992 \\cite{Bennett1992a}, as well as the first field experiment \\cite{Muller1993}, used polarization encoding. With polarization optics arbitrary polarization states can be prepared, both in optical fibers and in free space. Typically, the rectilinear and the circular bases are used for the two non-commuting BB84 bases, as they can be prepared actively in a random fashion with fast electro-optical modulators on the sender side. On the receiver side, a beam splitter followed by polarization optics that project in two different bases realizes a passive random basis choice. It is crucial to maintain the polarization state in this encoding scheme, which is why effects such as polarization mode dispersion in optical fibers must be compensated and the quantum channel must be stabilized to compensate polarisation drifts over time. \n\\\\\nA coding scheme that is better suited for fiber-based communication is phase encoding. In the simplest case, a single Mach-Zehnder-Interferometer (MZI) is spanned between Alice and Bob via two optical fibers and two couplers, at which each of the parties can apply phase shifts to their half of the MZI. In this configuration, the condition for constructive or destructive interference at the receiving detector depends only on the applied phase shifts (given the MZI pathlength is stable to a fraction of the wavelength) corresponding to the encoded states. As the required path length stability in the single MZI phase encoding scheme is difficult in practice, QKD is typically done with a double MZI phase encoding, in which two unbalanced MZI are put in series, with one being controlled by Alice and one by Bob. If the MZI imbalance is the same at both MZIs, photon paths including the short and long arm exactly once are indistinguishable, leading to interference, which again depends on the applied phase shifts at Alice and Bob \\cite{Yuan2008}. As the photons are in a superposition of different time bins, this is also a way of time-bin encoding. An interesting variation are photons that travel back and forth, which improves the stability , as photons experience the same quantum channel twice in opposite directions thus compensating phase distortions, however at the cost of reduced communication distances \\cite{Martinelli1992}. \n\\\\\nSeveral other encoding schemes exist such as encoding in the relative phase between sidebands of a central optical frequency \\cite{Sun1995}, the photon path \\cite{Monteiro2015}, or using correlations between time bins and photon energy, enabling high-dimensional encoding \\cite{Zhong2015}. Also, several ways exist to convert the different encoding types into each other \\cite{Kupchak2017}.The probability that a photon is detected in a wrong basis in a given encoding scheme is called the quantum bit error ratio (QBER). \n\\\\\nIdeally, all these encoding schemes require practical, high-quality sources of single photons (SPSs) or entangled photon pairs (EPSs). Here, high quality means that all emitted photons are in the single photon Fock states with low multi-photon emission probability (purity), the majority of excitation pulses lead to collected photons (brightness) and photons emitted from the same source are similar (indistinguishability). Being practical implies that they are easy to operate, durable, spectrally tunable, affordable, and scalable. While many non-classical light sources have been developed to date (see e.g. \\cite{Lounis2005,shields2010,Eisaman2011} for an overview), ideal SPSs or EPSs are challenging to realize. Semiconductor QDs, however, are considered one of the most promising candidates to solve this challenge \\cite{Aharonovich2016}. \\\\\n\\begin{figure}\n \\includegraphics[width=\\linewidth]{figure2.png}\n \\caption{Comparison of Photon Statistics for laser sources (a) and single photon sources (b) for different mean photon numbers $\\mu$.}\n \\label{fig:fig2}\n\\end{figure}\nDue to the lack of close-to-ideal quantum light sources, the majority of QKD implementations, and all commercial realizations, made use of phase-randomized attenuated laser pulses, also known as weak coherent pulses (WCP) \\cite{Chen2009,Zhao2006,Jennewein2000a,Poppe2004,Boaron2018a}. These can be realized more easily, but can only approximate a single photon state, since the photon number still obeys the Poisson statistics. The probability to find $n$ photons in a state with mean photon number $\\mu$ is $P(n,\\mu) = e^{-\\mu} \\mu^n \/n!$ Therefore, the conditional probability to find more than one photon, given the pulse is not empty, is \\cite{Gisin2002}\n\\begin{equation}\nP(n>1, \\mu \\mid n>0, \\mu)=\\frac{P(n>1, \\mu)}{P(n>0, \\mu)}=\\frac{1-P(0, \\mu)-P(1, \\mu)}{1-P(0, \\mu)}=\\frac{1-(1+\\mu) e^{-\\mu}}{1-e^{-\\mu}} \\approx \\frac{\\mu}{2}\n\\end{equation}\nThis means that the probability that a non-empty pulse contains more than 1 photon can be made arbitrarily small, however at the cost of an extremely low number of photons in the quantum channel: $P(n=0, \\mu) \\approx 1-\\mu$. QKD experiments with WCPs typically use $\\mu = 0.1$, a mean photon number at which about $5\\%$ of the non-empty pulses still contain more than 1 photon. This leads to possible attacks such as photon number splitting attacks (Figure \\ref{fig:fig1}d) or the more realistic beam splitting attacks \\cite{Lutkenhaus2002}. \n\\\\\nIn these attacks an adversary replaces the channel with one of lower loss, measures the photon number non-perturbatively in each pulse, blocks pulses with 1 photon and steals all but 1 photon from the pulses with more than 1 photon. In this way the eavesdropper possesses a copy of all photons that Bob receives and can measure them according to the basis information disclosed over the public channel. Since an ideal SPS would emit at maximum 1 photon per pulse, the photon number splitting attack would not be possible. In (\\textbf{Figure \\ref{fig:fig2}}) the photon number distribution of WCP (Poissonian) and single photons are compared for different mean photon numbers. While for a typical average number of 0.1 photons per pulse both sources have a similar number of single photon events, the attenuated laser still has a considerable amount of multi-photon contributions. One might argue that a solution is to reduce the mean photon number in WCP setups strongly and, in turn, increase the repetition rate. In this case, however, the photon detectors receive many empty pulses significantly increasing the influence of dark counts at the detectors. \n\\\\\nUsing so-called decoy state protocols \\cite{Wang2005}, these attacks on WCP implementations can be mitigated, by estimating the amount of multi-photon pulses in-situ with the help of decoy states. But significant shrinking of the sifted key is required since the decoy pulses cannot be used to generate a key. Provided a single-photon source (in contrast attenuated laser pulses) with high efficiency, i.e. with an average number of photons per pulse $\\mu_\\text{SPS}$ comparable to average intensities typically used for signal states in decoy protocols (e.g. $\\mu_\\text{WCP} = 0.4$), the reduced protocol overhead gives a clear benefit for the SPS. For an overview of the state-of-the-art in attenuated laser QKD covering decoy and other types of protocols we refer the reader to \\cite{Xu2020}.\n\\\\\nEven more general, Poisson statistics predict a maximum probability to emit 1 photon in a WCP source of $37\\%$, which means that a QD SPS with an average photon number in the quantum channel above that value, outperforms the WCP source when driven at the same rate. The same argument holds true for entangled photon sources. By sending laser pulses to nonlinear crystals, spontaneous parametric down conversion (SPDC) can be used to generate entangled photon pairs \\cite{Kwiat1995,Couteau2018}. This process however is not only inefficient (conversion rates of $10^{-6}$ are typical) but also does not provide entangled photon pairs with single-photon statistics. The number of photon pairs follows a thermal distribution on timescales below the coherence time and a Poisson distribution for larger times \\cite{Tapster1998,Avenhaus2008}. As a consequence, the maximum number of created photon pairs in SPDC sources is limited, since the fidelity to the maximally entangled states reduces with increasing multi-pair contributions. As a consequence, the higher probability to emit more than one entangled photon pair in down-conversion processes ultimately limits the key rate, no matter how fast the clock rate of the system is, as was recently shown by Hosak et al. \\cite{Hosak2021}. QD SPSs on the other hand can provide entangled photon pairs with single photon pair statistics via the biexciton-exciton emission cascade (see section \\ref{section2.1}) which have already exceeded the fundamental limits of SPDC sources \\cite{Chen2018,Liu2019,Wang2019}. \n\\\\\nEven more important, when considering realistic finite key lengths, the number of secure bits reduces significantly due to finite-size corrections, which arise from statistical errors due to the reduced size of the parameter estimation set. These corrections, that are necessary to still claim a secure key exchange for finite-size keys, have a much greater effect on attenuated laser pulses than on SPSs \\cite{Scarani2009,cai2009}, which makes SPS superior even at lower average photon numbers. Such finite-size effects are especially severe in scenarios where the maximum key length is limited, for example in satellite links or mobile systems \\cite{Nauerth2013,Liao2017}.\n\\\\\nMoreover, in many advanced protocols such as measurement-device-independent (MDI), fully device independent (DI) QKD (see section \\ref{section3.4}) or in essential building blocks of quantum networks such as quantum repeaters (see section \\ref{section4.2}), successful Bell state measurements are essential. These however suffer strongly from multi-photon input states which occur more often in WCP systems due to the Poisson statistics. These measurements also require a high two-photon interference visibility which can in principle reach up to $100\\%$ for quantum light sources, while it is fundamentally limited to $50\\%$ in classical WCPs \\cite{Mandel1983}. Also in this case, SPSs would therefore provide a clear advantage.\n\\\\\nAnother aspect is that nowadays, even the state-of-the-art single-photon detectors can only operate at detection rates below 100 MHz \\cite{SingleQuantum}. The repetition rates of modern QKD systems however have already reached the GHz regime, hence many QKD system clock-rates are already limited by the photon detector \\cite{Gordon2005,Dixon2009}. In such a case and following the arguments presented above, using SPSs with relatively low brightness can already increase the secret key rate. Semiconductor QDs are a promising candidate for such a SPS and therefore at the core of this review.\n\\\\\nWhile this review article will focus mainly on the experimental advances in the field, also theoretical work has advanced significantly since the proposal of the BB84 protocol. First rigorous security proofs were soon extended to more realistic scenarios, also considering imperfections of Alice and Bob, unavoidable in physical implementations. A common way of calculating asymptotic secure key rates for imperfect photon sources was introduced in the so-called GLLP paper by D. Gottesmann, H.-K. Lo, N. L\u00fctkenhaus, and J. Preskill \\cite{Gottesman2004}. Typically, secure key rates are calculated in the asymptotic regime, i.e. assuming that an infinite amount of exchanged qubits is available so that protocol parameters can be estimated without errors from an infinite set. In that case the secure key rate $K_{\\text{sec}}$ is simply the clock rate of the QKD experiment $R_0$ multiplied with the mean photon number that is coupled into the channel $\\mu$, the channel transmissivity $t$, the detection setup transmission $\\eta_{\\text{Bob}}$, the detector efficiency $\\eta_\\text{det}$, the sifting factor $q$ and the secure bit fraction $r$ as\n\\begin{equation} \\label{eq:GLLP}\n K_\\text{sec} = R_0 \\cdot \\mu \\cdot q \\cdot t \\cdot \\eta_\\text{Bob} \\cdot \\eta_\\text{Det} \\cdot r\n\\end{equation}\nThe secure bit fraction $r$, following the GLLP security proof, is the amount of uncertainty an adversary has over the key, quantified by the binary Shannon entropy $h_2(e) = -e \\log_2(e) - (1-e) \\log_2(1-e)$ as a function of the QBER $e$, reduced by the information leakage due to the error correcting code with an efficiency of $f_\\text{EC}$, and corrected for the amount of multi-photon emission events that may enable photon number splitting attacks. This leads to a secure bit fraction of\n\\begin{equation} \\label{eq:GLLP_correction}\n r=A\\left[1-h_{2}\\left(\\frac{e}{A}\\right)\\right]-f_\\text{EC} \\cdot h_{2}(e)\n\\end{equation}\nHere, $A$ is the correction factor used to incorporate multi-photon emission events as $A = P_{1}\/P_\\text{click} $, which describes the ratio of detector clicks resulting from single-photon events with probability $P_1$, to all detector clicks $P_\\text{click}$. The quantum bit error ratio $e$ is the ratio of erroneous detection events normalized by the sum of all detection events, which can be estimated from a detection system intrinsic error $e_\\text{det}$ (probability that a photon encoded in one basis is detected in the other one) and the number of dark counts $P_\\text{dc}$ as\n\\begin{equation} \\label{eq:GLLP_QBER}\n e = e_\\text{false clicks} + e_\\text{dark counts} = \\frac{P_\\text{click } \\cdot e_\\text{det} + \\frac{1}{2} \\cdot P_\\text{dc}}{P_\\text{click}+P_\\text{dc}} .\n\\end{equation}\nNote that also more refined channel models exist which take into account detector imperfections such as dead-time and after-pulsing and allow channel multiplexing \\cite{eraerds2010quantum}. The GLLP equations (\\ref{eq:GLLP}-\\ref{eq:GLLP_QBER}) discussed above will be used at the end of section \\ref{section3.2} to put the QKD experiments reported to date into perspective. An important development in the field of QKD rates over the last decade was to consider even more realistic settings beyond the asymptotic limit, in which only a finite number of qubits can be exchanged. This is an important practical scenario, e.g. for communication links to and between moving platforms such as air-crafts or satellites. Several important adaptations have to be made to the estimation of the secure key rate, which are well-described in the works of Cai, Scarani and Renner \\cite{Scarani2008,Renner2008,Scarani2009,cai2009}. Importantly, incorporating finite-size effects is not just a theoretical consideration to certify security of the scheme more precisely. On the contrary, not incorporating these effects entails actual security risks, as shown by Chaiwongkhot et al. by hacking a commercial QKD system exploiting finite-size effects \\cite{Chaiwongkhot2017}. Noteworthy, secure key rates can also be calculated numerically, by maximizing Eve's information over all attacks that are allowed by the laws of physics \\cite{Coles2016}, which resulted in key rates that agreed with the analytically known ones \\cite{Winick2018,George2021}.\n\n\\section{Quantum Dot Based Quantum Light Sources}\nWhile the notion of \"single photons\" has been around for a 100 years from the early 20th century on \\cite{Einstein1905,LEWIS1926}, the concepts and practical realizations of light sources emitting single photons one by one took their fair time to be developed. Theoretically, a driven two-level system is an ideal single-photon emitter. While driving transitions in single atoms fulfills that goal \\cite{kimble1977,ripka2018}, this route is not always practical. This was one reason for researchers to consider low-dimensional solid-state systems, which mimic atoms but provide advantages for device integration. Important steps in this endeavor where made in the 1990s, where research groups succeeded in encapsulating small islands of semiconductor material with a lower bandgap by another semiconductor with a larger bandgap, effectively forming a quasi zero-dimensional structure known as QD \\cite{Leonard1993,Grundmann1995}. Technically this is possible by exploiting self-organized processes, e.g. in the Stranski\u2013Krastanov growth-mode \\cite{Stranski1939}, during hetero epitaxy of one material onto another \\cite{Lay1978}. After their discovery, QDs quickly gained interest with applications ranging from laser physics \\cite{Arakawa1982} to quantum information \\cite{Imamoglu1999}. Many excellent review articles and books on epitaxial semiconductor QDs and QD-based quantum light sources have been published over the years, e.g. \\cite{Michler2009a,Shields2007,Buckley2012,Senellart2017,Trivedi2020,Rodt2020}. This section therefore intends to briefly summarize the most important properties of QDs and engineered QD-based quantum light sources used for implementations of quantum communication to date.\n\n\\subsection{Semiconductor Quantum Dots} \\label{section2.1}\nIn QDs the three-dimensional confinement of charge carriers in a small volume of typically a few nanometer leads to quantized energy levels in the valence and conduction band, of which the lowest ones approximate a two-level system (cf. \\textbf{Figure \\ref{fig:fig3} a)-c)}). Filling the QD potential with one electron-hole pair forming a bound exciton (X) using optical or electrical pumping, the energy levels can be occupied. After a characteristic period of time, i.e. the spontaneous emission lifetime (typical $~1\\,$s), the exciton recombines radiatively under emission of a single photon, leaving the empty QD in its ground state. As long as the exciton has not recombined, the electronic state is occupied, thus providing the basic mechanism required for a SPS emitting photons subsequently, as first demonstrated by Michler et al. in 2000 \\cite{Michler2000}. Note, that QDs require typically cryogenic cooling down at temperatures arround $4-70\\,$K for optimal performance. There are however material combinations, such as CdSe and Nitride materials, as well as organic structures, which lead to higher exciton binding energies, resulting in higher possible operating temperatures up to room temperature \\cite{Michler2000a,Kako2006,Arians2008,Deshpande2013,Cui2019}. In addition, also cryotechnologies advanced significantly in recent years, nowadays enabling compact and benchtop cryogenic quantum light sources as recently demonstrated by Schlehahn et al. \\cite{Schlehahn2018} (see section \\ref{section4.1}).\\\\\nDue to the semiconductor environment, QDs can host multiple charge carrier in different combinations of excited states, resulting in various distinct emission lines (cf. Figure \\ref{fig:fig3}d and e). Spectrally selecting either one of these emission lines results in single-photon emission which can be experimentally verified via second-order photon autocorrelation experiments in a HBT setup (see Figure \\ref{fig:fig3} f and g). Advantages of QDs for quantum light generation are their excellent single photon properties, recently demonstrated to be superior to any other known type of SPS \\cite{Schweickert2018}, in combination with the possibility to realize engineered devices with designed emission wavelength (see also section \\ref{section2.2}). This is highly beneficial for applications in quantum information, as the generated quantum light states can be spectrally matched to the Telecom O- and C-band (at wavelengths around 1300 nm and 1500 nm) for long distance communication in optical fibers, or atomic transitions in Alkali vapor cells for quantum memory applications (see section \\ref{section4.3}). As the growth of high-quality QDs at Telecom wavelengths is still a technological challenge, an alternative approach is the wavelength conversion of single photons emitted from a QD at lower wavelengths to the Telecom range exploiting nonlinear optical effects \\cite{Rakher2010}. The state-of-the-art in this field enables conversion efficiencies of $35\\%$ \\cite{Morrison2021}. Another important development in the field of QD-device engineering refers to the availability of several deterministic fabrication technologies, where the QDs are either grown directly at a pre-determined location (site-controlled growth) or QDs are pre-selected post-growth (according to the optical properties) and subsequently integrated in photonic devices (see Refs. \\cite{Rodt2020,Liu2021} for recent review articles). These deterministic technologies turned out to become a game changer enabling high device yields for applications in photonic quantum technologies.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure3.png}\n \\caption{Two-level-scheme of a single photon emitter (a), Scanning Tunneling Microscope image of a single InAs\/GaAs QD (b), scanning electron microscope image of epitaxially grown InGaAs QD islands (c), overview of different excited states in a QD (d) and their respective emission lines (e), different emission lines when exciting a QD off resonantly (f left) and only one emission line in quasi-resonant excitation (f right), low correlation at zero temporal delay in a HBT experiment indicates single photon emission (g). (b) reprinted from \\href{https:\/\/aip.scitation.org\/doi\/full\/10.1063\/1.4770371}{\\textit{Keizer et al. 2012}} \\cite{keizer2012} with the permission of AIP publishing, (c) reprinted by permission from \\href{https:\/\/www.nature.com\/articles\/nature02969}{\\textit{\\textit{Reithmaier et al. 2004}}} \\cite{reithmaier2004} Copyright 2004 Springer Nature, (f,g) reprinted with permission from \\href{https:\/\/journals.aps.org\/prl\/abstract\/10.1103\/PhysRevLett.86.1502}{\\textit{Santori et al. 2001}} \\cite{santori2001} Copyright 2001 by the American Physical Society.}\n \\label{fig:fig3}\n\\end{figure}\nImportantly, again thanks to the semiconductor environment, different schemes are possible for the excitation of excitonic states in QDs. The highest purity of single-photons can be achieved in resonant excitation, where the excitation laser matches the QD emission wavelength \\cite{Muller2007}. This scheme, however, requires a suppression of the scattered laser light of typically 6 orders of magnitude using e.g. cross-polarized excitation and collection paths \\cite{Kuhlmann2013}, excitation from the side of the sample \\cite{Ates2009a}, via coupling to photonic waveguides \\cite{Makhonin2014} or by using dichroic excitation profiles \\cite{He2019}. Alternatively, one can excite quasi-resonantly (also known as p-shell excitation) where the closest energy level above the emission state is resonantly excited to limit the excitation of excess charge carriers and non-radiative relaxation induced dephasing \\cite{holewa2017}. The third possibility is non-resonant excitation with photon energies exceeding the band gap of the matrix material, which results in an excited excitonic reservoir, from which single excitons relax to the QD states and subsequently recombine radiatively emitting single photons. Non-resonant excitation is from a technical viewpoint the easiest excitation scheme, which however limits the single-photon quantum optical properties due to large dephasing, fluctuating charge traps and timing jitter \\cite{Vural2020}.\n\\\\\nThe physics of QDs, however, are by far not limited to single-photon emission. When exciting two (or more) excitons, cascaded emissions are possible, where the individual photons have slightly different energies (\\textbf{Figure \\ref{fig:fig4}}c) due to the Coulomb interaction of the confined excitons and can thus be separated \\cite{Hu1990,Kulakovskii1999,Moreau2001,Rodt2003,Seguin2006,Sarkar2006}. Under certain conditions, photon pairs emitted by the biexciton-exciton radiative cascade reveal polarization-entanglement, as proposed theoretically in Ref. \\cite{Benson2000} followed by several experimental demonstrations, e.g. \\cite{Benson2000,Akopian2006,Young2006} (Figure \\ref{fig:fig4} d-g). Noteworthy, also other peculiar configurations of the energy level scheme can be realized in this cascade, enabling the generation of polarization-entanglement via time-reordering \\cite{Avron2008} or so-called twin photon states \\cite{Heindel2017,Moroni2019}.\n\\\\\nNote that in order to obtain entangled photons from a QD, the so-called fine-structure-splitting (FSS), which quantifies the difference in energy of the photons emitted with different polarizations and which originates from intrinsic anisotropies in the QD, has to vanish (Figure \\ref{fig:fig4} a, b). As it was shown, this FSS can be made zero via careful high quality growth, external strain or by applying magnetic fields \\cite{Stevenson2006}. The possibility to generate polarization entanglement - being one crucial ingredient for many schemes of quantum communication - is a major advantage of using engineered QD devices. We refer the interested reader to Refs. \\cite{huber2018semiconductor} and \\cite{Schimpf2021} for a recent review and perspectives article on this topic, respectively.\n\\\\\n\\begin{figure}\n \\includegraphics[width=\\linewidth]{figure4.png}\n \\caption{Generation of polarization entangled photon pairs from single QDs: By reducing the polarization splitting between the different decay paths of the biexciton-exciton emission cascade (from a to b), the 'which-path' information is erased, resulting in entangled photons. The emitted photons have different energies (c) which allows separating them. Looking at the polarization correlations in different bases confirms the entanglement (d-g). Figures reproduced from \\href{https:\/\/iopscience.iop.org\/article\/10.1088\/1367-2630\/8\/2\/029}{\\textit{Young et al. 2006}} \\cite{Young2006} under Creative Commons BY license.}\n \\label{fig:fig4}\n\\end{figure}\nHow QDs compare to other SPSs such as defects, carbon nanotubes, atomic-vacancy centers in crystals, or two-dimensional materials was reviewed by Aharonovich et al. \\cite{Aharonovich2016}, with the result that QDs have the best overall performance due to the short lifetimes and the high purity and indistinguishability that are possible. There are also solid-state emitters such as crystal defects that emit directly in the Telecom range, even at room temperature \\cite{Zhou2018}, but the photon purity is worse than what is possible in QD sources. Overall, semiconductor QDs are by now the closest there is to ideal quantum light sources. \n\n\\subsection{Engineered Quantum Light Sources for Quantum Communication} \\label{section2.2}\nAs mentioned in the previous section, QDs provide all assets to achieve fast emission of single, indistinguishable and entangled photons at high rates. To further boost their performances in terms of out-coupling efficiency and emission rate, solid-state QDs are commonly incorporated into photonic structures \\cite{Barnes2002}. This section will provide an overview of the photonic structures used for QD-based SPSs employed in QKD experiments to be discussed in detail in section \\ref{section3}.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure5.png}\n \\caption{(a) SEM image of early QD micropillar cavities for optical excitation. (b,c) Cross-sectional SEM image and illustration of an single-photon light emitting diode (LED) based on electrically contacted p-i-n doped micropillar cavities with self-organized InAs\/GaAs-QDs. (d) Schematic of an single-photon LED with embedded InP-based QDs. (e) Schematic fabrication process and design layout of an entanlged light emitting diode. (f,g) Schematic representation and SEM image of a QD embedded in an optical horn structure, whose emission is excited and collected through the backside of the substrate-wafer using an AR-coating. (h) Schematic representation of a GaAs quantum dot grown by the droplet etching method in an AlGaAs layer. (i) 3D cross-sectional atomic force microscopy measurement of a nanohole inside a AlGaAs layer after droplet etching. (j) Top view of the atomic force microscopy measurement in (i). (a) reprinted by permission from Springer Nature: \\href{http:\/\/www.nature.com\/articles\/nature01086}{\\textit{ Santori et al.}} \\cite{Santori2002} Copyright 2002, (b,c) adapted from \\href{http:\/\/aip.scitation.org\/doi\/10.1063\/1.3284514}{\\textit{Heindel et al. 2010}} \\cite{Heindel2010} with the permission of AIP Publishing. (d) reprinted from \\href{http:\/\/aip.scitation.org\/doi\/10.1063\/1.3497016}{\\textit{Reischle et al. 2010}} \\cite{Reischle2010} with permission from AIP Publishing, (e) reprinted from \\href{http:\/\/dx.doi.org\/10.1038\/s41467-018-03251-7}{\\textit{M\u00fcller et al. 2018}} \\cite{Muller2018} under Creative Commons CC BY license. (f,g) reprinted from \\href{http:\/\/aip.scitation.org\/doi\/10.1063\/1.2723177}{\\textit{Takemoto et al. 2007}} \\cite{Takemoto2007} Copyright 2007 by American Institute of Physics. (h,i,j) reprinted from \\href{https:\/\/www.nature.com\/articles\/ncomms15506}{\\textit{Huber et al. 2017}} \\cite{huber2017highly} under Creative Commons CC BY license.}\n \\label{fig:fig5}\n\\end{figure}\nMicropillar (or micropost) cavities, since their first application for the enhancement of QD-emission at the turn of the century \\cite{Gerard1998,Solomon2001}, have been widely used and employed also for QKD experiments using optically-excited QD-based single-photon sources in the following chapter \\cite{Waks2002a,Intallura2009}. A scanning electron microscope (SEM) image of micropillar cavities is shown in \\textbf{Figure \\ref{fig:fig5}a}. The etched pillars consist of a QD layer sandwiched between two distributed Bragg reflector (DBR) mirror sections. The top DBR mirror is usually designed to have a lower reflectivity than the bottom DBR mirror, to promote emission into the upper hemisphere towards a collecting optics. Purcell enhancements of a factor 5-6 of the emission rate and extraction efficiencies above $60\\%$ can be typically achieved with micropillar structures \\cite{Santori2002,Gazzano2013,Somaschi2016,Ding2016}.\n\\\\\nMicropillar structures were also used to realize electrically triggered QD-based single-photon sources emitting in the near-infrared (900 nm) \\cite{Heindel2010} (cf. Figure \\ref{fig:fig5} b,c) or visible (650 nm) \\cite{Reischle2010} (cf. Figure \\ref{fig:fig5}d) spectral range. These highly engineered devices have in turn be employed for the first QKD experiments with electrically injected QD-devices \\cite{Heindel2012}. In both device approaches a layer of self-organized QDs is embedded in an undoped (intrinsic) section of a micropillar structure sandwiched between a top, p-doped and bottom, n-doped DBR mirror forming a p-i-n diode structure electrically contacted via gold bars \\cite{Boeckler2008}. The operation wavelength can thereby be determined by the choice of the QD-material, being InAs\/GaAs and InP\/GaAs in case of the device emitting in the near-infrared and visible spectral range, respectively, highlighting the flexibility QDs offer for application in quantum technologies. Electrically driven micropillar-based single-photon sources were reported to reach overall efficiencies (including electrical loses) exceeding $60\\%$ \\cite{Schlehahn2016a} and Purcell enhancement of close to 5 \\cite{Heindel2010}, values which are similar to non-electrical counterparts but, in contrast, excitation pulse-repetition rates in the GHz-range are straighforward to achieve \\cite{Hargart2013,Schlehahn2016a}.\n\\\\\nIn another approach, QDs were embedded in diode structures to electrically generate polarization entangled photon pairs via the biexciton-exciton radiative cascade (cf. section \\ref{section2.1}) \\cite{Salter2010,Muller2018}. This so-called entangled light emitting diode (ELED) has later been employed for the first entanglement-based QKD-experiments using QD-devices \\cite{Dzurnak2015}. The fabrication scheme to realize InP-based ELEDs for entangled photon emission in the telecom C-Band is shown in Figure \\ref{fig:fig5}e.\n\\\\\nA different type of photonic structure that was used for QKD experiments in the telecom C-Band \\cite{Takemoto2010} is an so-called optical horn (cf. Figure \\ref{fig:fig5}f). It consists of a QD embedded in a fabricated cone on a substrate with the horn acting as a reflector to direct photons upwards through the substrate with an antireflection coating, towards the collecting optics. A SEM image of a fabricated optical horn structure is shown in Figure \\ref{fig:fig5}g. The horn structure does not show Purcell enhancement, but photon collection efficiencies of close to $11\\%$ were achieved \\cite{Takemoto2007}.\n\\\\\nThe last type of QD-device that shall be mentioned here was used for a recent implementation of entanglement-QKD experiments \\cite{Basset2021,Schimpf2021a} and utilized optically-pumped symmetric GaAs QDs grown by the droplet-etching method, which show short radiative lifetimes and small fine-structure splittings enabling large entanglement fidelities \\cite{huber2017highly}. A schematic representation of such a symmetric GaAs QD situated in a hole in an AlGaAs-matrix is shown in Figure \\ref{fig:fig5}h. A three-dimensional atomic force microscopy cross-section image is shown in Figure \\ref{fig:fig5}i, with the top view of the measurement in Figure \\ref{fig:fig5}j. Here, the QDs were additionally combined with solid immersion lenses to increase their out-coupling efficiency to about $8\\%$.\n\\\\\nOther photonic structures to enhance the performance of solid-state QDs include nanowires \\cite{Claudon2010}, photonic crystal cavities \\cite{Madsen2014,Kim2016}, circular Bragg gratings \\cite{Davanco2011,Liu2019,Wang2019}, open cavity systems \\cite{Tomm2020}, on-chip waveguide based structures \\cite{Uppu2020}, and monolithic microlenses \\cite{Gschrey2015}. The latter proved to be useful for the development of practical plug\\&play single-photon sources \\cite{Schlehahn2018,Musial2020} as well as tools for the performance optimization of single-photon QKD \\cite{Kupko2020}, both evaluated very recently in a QKD-tesbed operating at O-band wavelengths \\cite{Kupko2021} (see section \\ref{section4} for details).\n\n\\section{Realizations of Quantum Key Distribution using Quantum Dots}\\label{section3}\nIn the previous section, we introduced QD-based quantum light sources as promising candidates for applications in quantum information. In this section, we review the implementations of QKD based on respective QD-devices reported to date. Noteworthy, also other types of quantum emitters have been used successfully for QKD experiments with sub-Poissonian light states. Among the two very first demonstrations of the BB84 protocol with single photons, one of them used Nitrogen vacancy (NV) centers in diamond to create the single photons \\cite{Beveratos2002}. Also later, NV and Silicon vacancy (SiV) -centers were used to implement QKD protocols \\cite{Alleaume2004,Leifgen2014}, but their secure key rates were smaller since excited states in NV centers have higher radiative lifetimes. In this review we restrict ourselves however to QD-based implementations. \n\\\\\nConcerning the QKD scheme, there are two major groups of protocols for which QD sources are used. As discussed in section \\ref{section1}, QDs can either be used for prepare-and-measure type QKD (like in the BB84 protocol) or the QD source can be placed in between Alice and Bob creating polarization entangled photon pairs distributed to Alice and Bob (like in the Ekert protocol). Let us begin by discussing BB84-like implementations of sub-Poissonian QKD.\n\n\\subsection{Quantum Key Distribution using Single Photons} \\label{section3.1}\nThe very first implementation of single-photon QKD by Waks et al. dates back to 2002 \\cite{Waks2002a}. The authors implemented the BB84 protocol with the bits being polarization-encoded in single-photon states from a triggered QD source \\cite{Santori2002}. Here, InAs QDs were encapsulated in micro-pillar cavities made from distributed Bragg reflectors (such as the one shown in Figure \\ref{fig:fig5}a). In their setup (\\textbf{Figure \\ref{fig:fig6}a}) the QD sample was kept in a liquid Helium cryostat and was optically excited with a pulsed Ti:Sapphire laser in a reflection configuration. The average single photon rate was measured by sending a part of the photon stream to a detector, while the polarization of the rest was modulated using an electro optical modulator (EOM), after selecting a fixed polarization in the polarizing beam splitter (PBS). The non-resonant optical excitation with a rate of 76 MHz led to an average rate of $\\mu = 0.007$ photons\/s injected into the quantum channel. The photons were then sent to Bob via a free-space link with variable attenuation, where the polarization state was measured. The beam splitter (BS) realized a random basis choice and a time interval analyzer (TIA) was used for synchronization.\n\\\\\nBy this, they measured bit rates and QBER for different attenuations, from which they could calculate the asymptotic key rate values shown as the red dots (Figure 6b), with the green line being the calculated values. In their work, they also introduced an upper bound on the probability for two-photon emission of SPSs of $P_{2, S P S} \\leq \\frac{1}{2} \\mu^{2} g^{(2)}(0)$, where $g^{(2)}(0)$ is the auto-correlation value at zero delay measured in a Hanbury-Brown andTwiss (HBT) experiment \\cite{Brown1956}, which is a measure for the probability of two photons being emitted into the same pulse. By calculating a simple, asymptotic secure key-rate \\cite{Waks2002} with a measured QBER of $2.5\\%$ they obtained a maximum communication rate without channel losses of 25 kbit\/s. By introducing an additional loss, they found a maximum tolerable channel loss up to which communication is possible, i.e. positive key rate, of 28 dB.\n\\\\\nRepeating the same experiment with attenuated laser pulses,without applying decoy states at that time, with an average photon number small enough to have the same multi-photon probability as the QD source, an experimental and calculated key rate was obtained. While for small losses the laser gave a higher communication rate, the QD single photons outperformed the laser at larger losses, since compensating potential photon number splitting attacks used up more bits for the attenuated laser pulses \\cite{Lutkenhaus2000}. Ultimately the QD could tolerate about 4 dB higher losses than the laser without decoy states. Using their secure bits, Waks et al. encoded an image of Stanford University Memorial's Church and decode it again using the transmitted secure key (Figure \\ref{fig:fig6}c). \\\\\nNote however, that nowadays decoy-state protocols allow for the in-situ estimation of the multi-photon contribution to mitigate photon-number-splitting attacks and hence much higher average photon numbers in the laser pulses \\cite{Wang2005}, which is why the asymptotic rate of Waks et al. would not beat a decoy-state implementation with WCPs. On the other hand, the upper-bound on the probability of multi-photon events used by Waks et al. for their QD-source is not tight, and that, following recent discussions, the measured value is a too pessimistic measure for the purity of the photon source \\cite{Grunwald2019}. Hence, the true probability for a multi-photon emission event of a QD-SPS is likely to be even lower. This further increases the advantage sub-Poissonian SPSs can have over attenuated laser pulses in implementations of QKD.\n\\\\\n\\begin{figure}[h]\n \\includegraphics[width=0.5 \\linewidth]{figure6.png}\n \\caption{Sketch of the setup of the first QD single photon QKD experiment by Waks et al. (a), the measured and calculated asymptotic secure key rates for the QD single photons (red crosses) and attenuated laser pulses (blue stars) (b) and the image that was securely transmitted (c). Reprinted from \\href{https:\/\/www.nature.com\/articles\/420762a}{\\textit{Waks et al. 2002}} \\cite{Waks2002a} with permission of Springer Nature: Copyright 2002 Springer Nature.}\n \\label{fig:fig6}\n\\end{figure}\nAn appealing scheme to improve secure key rates in BB84-QKD for a given QD-source was presented bei Aichele et al. in 2004 \\cite{Aichele2004}. Here, the cascaded emission of biexciton and exciton state was used to generate two single-photons at different energies from one excitation pulse, which was used to effectively double the achievable key rate. Using a Michelson-interferometer to introduce a temporal delay between both photons, each photon's polarization could be modulated individually (time-multiplexing) on Alice's side before coupling them to the same free-space quantum channel. At Bob, a second Michelson interferometer was used to separate the photons again and measure their polarization separately. Note that the separating and combining of the two photons is done in the time domain instead of separating them by energy to make the setup less vulnerable to emission energy fluctuations. Using this approach, Aichele et al. demonstrated a rate of secure bits per pulse of $5 \\cdot 10^{-4}$, which results in a communication rate of 38 kbit\/s at the given laser repetition rate (76 MHz).\n\\\\\nWhile these first implementations used free-space optical (FSO) links as quantum channel, which is ideal for achieving low losses at large distances in air-ground \\cite{Nauerth2013} or space-ground \\cite{Bedington2017,Yin2020,Sidhu2021} link scenarios, the use of optical fibers as quantum channels has many practical advantages for ground-based communication scenarios. Besides the fact that no direct line of sight is required in this case, which are susceptible to weather conditions and atmospheric turbulence, the technology can be made compatible with the world-wide fiber-based communication infrastructure. Several QD-based QKD experiments have been reported employing single photons coupled to an optical fiber acting as a quantum channel. Collins et al. were the first to report on a fiber-based QKD experiment using single photons generated by a QD emitting at a wavelength of 900 nm, sent through 2 km of optical fiber \\cite{Collins2010}.\n\\\\\nSince optical fibers provide lowest transmission losses at wavelengths in the second and third Telecom window, i.e. O- and C-band, it is beneficial to use QDs operating at these wavelengths, such as the ones first fabricated by Ward et al.\\cite{Ward2005}. Incorporating such QDs into micropillar cavities, Intallura et al. demonstrated single-photon QKD at 1300 nm in 2010, optically exciting the QD-device above bandgap \\cite{Intallura2009}. The quantum channel was represented by a standard SMF-28 optical fiber of 35 km length. As mentioned in section 1, it can be difficult to maintain a certain polarization state over a long fiber transmission. For this reason Intallura et al. used a phase encoding scheme, which also employed a multiplexed reference laser to match the path differences in Alice' and Bob's MZIs (\\textbf{Figure \\ref{fig:fig7}a}). For the QKD demonstration, the entire system ran at a clock rate of 1 MHz, limited by the single photon detectors response and dead time. Using the GLLP \\cite{Gottesman2004}, which is asymptotic, but incorporates multi-photon events (see also section 3.3), a measured QBER of $5.9\\%$ and an error correction efficiency of 1.17, the authors calculated a maximum secure key-rate of about 160 bit\/s and managed to achieve positive key rates at a distance of 35 km, overcoming the maximum distance achieved by WCPs (without decoy states) in their setup (Figure \\ref{fig:fig7}b). \\\\\n\\begin{figure}[h]\n \\includegraphics[width=0.5 \\linewidth]{figure7.png}\n \\caption{First QKD demonstration at Telecom wavelengths in 2009 by Intallura et al. Using a phase-encoding scheme (a), they achieved QKD over a 35 km distance (b) via optical fiber transmission. \u00a9IOP Publishing. Figure reproduced with permission from \\href{https:\/\/iopscience.iop.org\/article\/10.1088\/1464-4258\/11\/5\/054005}{\\textit{Intallura et al. 2009}} \\cite{Intallura2009}. All rights reserved.}\n \\label{fig:fig7}\n\\end{figure}\nOnly one year later, Takemoto et al. presented the first implementation of single-photon QKD at C-band wavelength (1560 nm), benefitting from even lower losses in optical fibers \\cite{Takemoto2010}. Using a QD incorporated into horn-like structure (depicted in Figure \\ref{fig:fig5}f) \\cite{Takemoto2007} and a QKD setup for phase encoding (see \\textbf{Figure \\ref{fig:fig8}}a for the setup), the authors achieved a maximum secure communication distance of 50 km, calculated with the asymptotic GLLP rate equation, setting a new record for single-photon QKD at that time.\n\\\\\nA few years later, the same group improved their QKD-implementation further, by using better detectors and QDs of higher quality. At close to maximum distance, e.i. strong channel losses, the number of detected signal photons is on the order of the dark counts of the detectors, ultimately limiting the achievable communication distance. Using single-photon detectors based on superconducting nanowire \\cite{Hadfield2005}, the dark count contribution could be significantly reduced and hence the maximum achievable distance increased. Moreover, the authors also improved the single-photon purity of their QD source, achieving an auto-correlation value at zero time delay of only $g^{(2)}(0) = 0.005$, so that the necessary corrections for multi-photon emission events, which would allow photon number splitting, became much smaller. With these improvements Takemoto et al. achieved with 120 km the so far longest distance in fiber-based BB84 QKD using a sub-Poissonian SPS in 2015 \\cite{Takemoto2015} (cf. Figure \\ref{fig:fig8}b).\n\\\\\n\\begin{figure}[h]\n \\includegraphics[width=0.5 \\linewidth]{figure8.png}\n \\caption{Implementation of BB84 QKD protocol using single photons at 1550 nm created by InAs QDs in horn-like structures. Using a phase-encoding scheme (a), 50 km QKD was achieved (grey line in b) \\cite{Takemoto2010} and later in an improved version of the experiment, that used Superconducting Nanowire Single Photon Detectors, more than 120 km were possible (red line in b), while improved structures promise even longer distances (other lines in b) \\cite{Takemoto2015}. Figures reproduced from \\href{http:\/\/www.nature.com\/articles\/srep14383}{\\textit{Takemoto et al. 2015}} \\cite{Takemoto2015} under Creative Commons CC BY license.}\n \\label{fig:fig8}\n\\end{figure}\nIn all QKD experiments presented so far, the QD-devices were excited optically using pulsed laser systems. A major advantage of semiconductor-based quantum light sources, however, is the possibility to realize complex engineered devices including diode structures for the injection of electrical charge carriers, which in turn allows for electrical triggering of QD emission. This is highly beneficial for applications, not only because higher degrees of device integration become possible (bulky laser systems become obsolete), but also the clock rate of implementations of quantum cryptographic protocols are easily adjustable (see also section 4.1). While the first electrically injected QD-based SPS was reported already in 2002 by Yuan et al. \\cite{Yuan2002}, it took one decade until the first QKD experiments could be realized. In the work by Heindel et al. in 2012 \\cite{Heindel2012}, three research groups joined forces to demonstrate lab-scale BB84-QKD experiments with two different types of single-photon light emitting diodes emitting in the near infrared (NIR) and visible (VIS) spectral range, at 897 nm and 653 nm, respectively (see \\textbf{Figure \\ref{fig:fig9}}). Using engineered QD-devices based on different material systems and growth techniques, their work highlighted the flexibility semiconductor-based quantum light sources offer for implementations of quantum information. While the NIR-SPS was based on an electrically contacted micropillar cavity exploiting the Purcell effect to enhance the photon extraction efficiency \\cite{Heindel2010}, the QDs were integrated in a quasi planar DBR cavity structure in case of the VIS-SPS \\cite{Reischle2010} (cf. Figure \\ref{fig:fig5}b). Using the NIR-SPS, the authors achieved sifted key rates of 27.2 kbit\/s (35.4 kbit\/s) at a QBER of $3.9\\%$ ($3.8\\%$) and a g(2)(0) value of 0.35 (0.49) at moderate (high) excitation under pulsed current injection at a clock-rate of 182.6 MHz. The VIS-SPS was triggered at 200 MHz, delivering sifted keys at a rate of 95.0 kbit\/s at a QBER of $4.1\\%$ and a g(2)(0) value of 0.49. While both the achieved suppression of multi-photon events as well as the key rates left room for future improvements, these first proof of principle QKD experiments using electrically operated semiconductor single-photon sources can be considered as a major step forward in photonic quantum technologies. Shortly after the lab-scale QKD experiments reported in 2012, the authors integrated the NIR-emitting SPS in a, at that time, compact quantum transmitter setup to be employed for QKD field experiments in downtown Munich (see Figure \\ref{fig:fig9}d). As reported by Rau et al. \\cite{Rau2014}, the QKD experiments comprised a 500 m FSO link between two buildings of the Ludwigs-Maximilians-Universit\u00e4t Munich, with the transmitter and receiver units synchronized via GPS-disciplined oscillators. Using their single-photon light emitting diode modulated at a clock-rate of 125 MHz, the authors achieved sifted key rates of 7.4 kbit\/s (11.6 kbit\/s) at a quantum bit error ratio of $7.2\\%$ ($6.3\\%$) and a g(2)(0) value of 0.39 (0.46) at low (moderate) excitation.\n\\\\\n\\begin{figure}\n\\centering\n \\includegraphics[width= 0.75 \\linewidth]{figure9.png}\n \\caption{First QKD experiments with two electrically triggered QD single photons emitting at 900 nm (InAs) and 650 nm (InP). The setup in (a) was used to measure sifted key rates as well as photon purity under different excitation conditions for both QD structures (b,c) \\cite{Heindel2012}. (d) In a second experiment, the single-photon emitting diode emitting at 900 nm was employed for field-experiments in down-town Munich using a 500 m free-space optical (FSO) link connecting two building of the Ludwigs-Maximilians-University Munich \\cite{Rau2014}, (a-c) reproduced with permission from \\href{https:\/\/iopscience.iop.org\/article\/10.1088\/1367-2630\/14\/8\/083001}{\\textit{Heindel et al. 2012}} \\cite{Heindel2012} \u00a9 IOP Publishing and Deutsche Physikalische Gesellschaft. Reproduced by permission of IOP Publishing.}\n \\label{fig:fig9}\n\\end{figure}\nIn order to become compatible with attenuated laser systems using decoy-state protocols, the efficiency and clock-rate of electrically contacted QD SPSs still has to be significantly increased. Promising steps in this direction were reported by Schlehahn et al. with achieved photon extraction efficiency of single-photon light emitting diodes of up to $61\\%$ (into the first lens) and trigger rates in the GHz range \\cite{Schlehahn2016a}. A promising route to improve also the $\\mu$ inside the quantum channel is a tighter integration of the SPSs, e.g. by the direct coupling to optical fibers allowing for practical plug-and-play quantum light sources (see section \\ref{section4.1}). Very recently, Kupko et al. evaluated for the first time the performance of a state-of-the-art plug-and-play SPS operating at O-band wavelengths for BB84-QKD \\cite{Kupko2021}.\n\n\\subsection{Quantum Key Distribution using Entangled Photon Pairs} \\label{section3.2}\nThe implementations discussed in the previous section were all based on the BB84 protocol in a prepare-and-measure configuration. In this section we will review QKD experiments using entangled photon states reported to date. By each measuring the two photons in a random basis and then keeping only the results in which they had used the same basis, they obtain perfectly correlated bit strings and by quantifying the remaining degree of entanglement for instance via violations of the Bell-type CHSH inequality \\cite{Clauser1969}, they can uncover eavesdropping attempts as described in the Ekert protocol \\cite{Ekert1991} explained in section 1. Entanglement monogamy guarantees that if Alice's and Bob's photons are maximally entangled, then the system cannot be entangled with any other system, hence an adversary's state is separable from the state of Alice and Bob, thus the adversary cannot have any information. From the degree of deviation from a maximum violation, the amount of necessary privacy amplification can be deduced.\n\\\\\nTwo important questions must be answered in entanglement-based implementations. How is the entanglement created and how is it distributed? QDs provide an excellent source of entangled photon pairs, via the biexciton-exciton emission cascade, as explained in section 2. Since the photons obey single-photon statistics, higher generation rates of entangled photons are possible than with SPDC sources \\cite{Chen2018,Wang2019,Liu2019}. In case of SPDC sources, the fidelity decreases significantly above pair emission efficiencies of 0.1, due to the emission of multiple pairs, which reduces the purity of the emitted states. The distribution of the entangled photons works like the distribution of single photons. They are either distributed via free-space links or via optical fibers which should maintain their polarization states.\n\\\\\nThe first proof-of-concept demonstration of QD-based entanglement QKD was reported by Dzurnak et al. \\cite{Dzurnak2015} in 2015. The authors performed an in-lab experiment using entangled photons generated via an electrically driven QD-device, referred to as an entangled-light emitting diode (ELED) as introduced first by Salter et al. \\cite{Salter2010} (similar to Figure \\ref{fig:fig5}c). The photon pairs were distributed in optical fibers to two detectors with random basis choices (\\textbf{Figure \\ref{fig:fig10}a}). Since the entangled photons emitted from a QD via the biexciton-exciton cascade have slightly different energies, they could be spectrally separated to send them to different receivers (Figure \\ref{fig:fig10}b). By this, they were able to transfer a total of 2000 secure bits. To prove that photons emitted during the same excitation pulse were entangled, the violation of the CHSH equation was tested, as indicated by the S-parameter exceeding 2 for vanishing time delays in Figure \\ref{fig:fig10}c. The authors obtained 1 MHz of photon counts on each detector, which, due to tight temporal filters, resulted in 10 sifted bits of key per minute. \\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure10.png}\n \\caption{First realization of entanglement based QKD with entangled photons from a single, electrically excited QD presented by Dzurnak et al. Since the photons have different wavelengths (b) they could be spectrally separated and distributed to the receivers (a) where the preserved entanglement was measured via the CHSH equation violation, as shown by the S-parameter $>$ 2 (c). Reprinted from \\href{http:\/\/aip.scitation.org\/doi\/10.1063\/1.4938502}{\\textit{Dzurnak et al. 2015}} \\cite{Dzurnak2015}, with the permission of AIP Publishing.}\n \\label{fig:fig10}\n\\end{figure}\nRecently, two other successful implementations of entanglement based QKD were reported back-to-back, that both used the same type of optically excited QD source emitting at 785 nm (embedded between a bottom DBR and a top solid immersion lense). Importantly, and in contrast to all previous QKD-implementations, both groups used a coherent excitation scheme, i.e. they optically excited the biexciton state of the quantum emitter via two-photon resonant laser pulses. While this is not required per se for the implementation of QKD summarized in the following, it is nevertheless an important step towards quantum repeaters and other advanced schemes of quantum information, relying on high photon indistinguishabilities. \n\\\\\nIn the implementation reported by Schimpf et al. the photons were transmitted via a 350 m optical fiber, resulting in an asymptotic secure bit rate of 86 bits\/s \\cite{Schimpf2021a}. Basset et al. realized both a fiber link and a free-space link, allowing for a direct comparison of both channel types operated with the same source \\cite{Basset2021} (\\textbf{Figure \\ref{fig:fig11}a}). The authors found that for their communication distance of 250 m, the fiber link enabled more stable conditions for entanglement distribution, resulting in the observation of a larger Bell parameter showing less fluctuations (Figure \\ref{fig:fig11}b). This led to a higher communication rate of about 500 secure bits\/s, compared to about 100 secure bits\/s in the free-space link (Figure \\ref{fig:fig11}c), the main reason being the difficulty of correcting instabilities and drift in the free-space optics, as manifested in the higher QBER in the free-space channel (Figure \\ref{fig:fig11}d). The authors counteracted distortions of the polarization state propagating in the fiber, by actively monitoring and compensating for the change in polarization during the experiment.\n\\\\\nInterestingly, the two groups used slightly different protocols for entanglement QKD. Basset et al. \\cite{Basset2021} implemented an asymmetric version of the original Ekert protocol. For this, the authors used a subset of the transmitted bits to evaluate the violation of the CHSH and quantified the amount of entanglement left after the transmission of the photons. Hereby, they determined the amount of eavesdropping that could have occurred and the amount of privacy amplification that was necessary. To do so, they measured the photons in the basis set, which is known to maximally violate the CHSH inequality, but only on Alice's side, while Bob measured them in the conventional BB84 bases. This asymmetric approach reduced the number of necessary detectors.\n\\\\\nSchimpf et al. \\cite{Schimpf2021a}, on the other hand, implemented an entanglement-based version of the BB84 protocol known as BBM92 \\cite{Bennett1992}. Here, Alice and Bob measure their respective halves of the entangled state in two conjugate bases and the amount of necessary privacy amplification is determined solely from evaluating the deviations of a subset of results measured and compared by Alice and Bob (as in the BB84). Thus, the amount of entanglement is not actively monitored and no Bell-like inequality violation is measured.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure11.png}\n \\caption{Entanglement-based QKD experiments: Schimpf et al. realized the BBM92 QKD protocol \\cite{Schimpf2021a}. Their setup (a) allowed them to achieve secure key transmission with the rate shown in (c) and a QBER (d) far below the maximum allowed value for secure transmission. Basset et al. used an asymmetric Ekert protocol \\cite{Basset2021} to perform QKD between two buildings (b) and the photons were transmitted both through an optical fiber (top panel in e) and a free-space (bottom panel in e) and the degree of entanglement (second column in e) and the key rate (third column in e) were compared. (a,c,d) reproduced from \\href{https:\/\/advances.sciencemag.org\/lookup\/doi\/10.1126\/sciadv.abe8905}{\\textit{Schimpf et al. 2021}} \\cite{Schimpf2021a} under Creative Commons Attribution License 4.0, (b,e) reprinted from \\href{https:\/\/advances.sciencemag.org\/lookup\/doi\/10.1126\/sciadv.abe6379}{\\textit{Basset et al. 2021}} \\cite{Basset2021} \u00a9 The Authors, some rights reserved; exclusive licensee AAAS. Distributed under a \\href{http:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/}{CC BY-NC 4.0 license.}}\n \\label{fig:fig11}\n\\end{figure}\nInterestingly, QKD has so far not been implemented with entangled photons generated by QDs at Telecom wavelengths. The generation of entangled photons at a wavelength of 1550 nm from a QD SPS has already been shown in experiments by Olbrich et al. \\cite{Olbrich2017}. While in their experiment the quantum emitter was optically excited with a continuous-wave laser, Shooter et al. recently realized a pulsed electrically excited QD-source generating entangled photon pairs at GHz clock rate in the Telecom C-band \\cite{Shooter2020}. The entangled photon pairs showed a fidelity to the maximally entangled state of $89\\%$ and were distributed over a fiber link of 4.6 km length at record rates, representing an important step towards high-performance QKD systems exploiting sub-Poissonian entanglement sources. Additionally, using electrically excited InAs-QDs, the same group reported already entanglement generation via the biexciton-exciton cascade up to a temperature of 93 K \\cite{Muller2018} - a temperature not requiring liquid Helium anymore and allowing for the integration into compact Stirling cryocoolers \\cite{Schlehahn2015} (see also section 4.1). \\\\\nIn another experiment Xiang et al. achieved $91\\%$ fidelity of polarization entangled photons from electrically excited QDs, that had been transmitted over an 18 km long metropolitan optical fiber \\cite{Xiang2019}. Sufficiently maintaining the photon polarization over the fiber transmission for over a week was made possible, by multiplexing a polarization reference signal through the fiber and actively stabilizing it. Note that the current record for the longest distance of entanglement distribution via fiber-links is almost 100 km and was achieved by sending polarization entangled photons through a submarine optical fiber between the islands Malta and Sicily \\cite{Wengerowsky2019}. Although the entangled photons were created via a nonlinear downconversion process here and are thus not ideal for QKD applications due to the Poisson statistics, it is remarkable how the entanglement was preserved over such a long distance within the optical fiber in a 'real-world-scenario'. The success of the entanglement preservation was indicated by the clear violation of the CHSH inequality, with a value for the S-parameter of 2.5 after the entanglement distribution. The experiment achieving the to-date longest distance of free-space entanglement distribution sent photons from a SPDC-based source on the quantum satellite 'Micius' to earth \\cite{Yin2017}. Here, the photons propagated over a distance of 500-1000 km and the polarization entanglement was preserved with a fidelity of $86\\%$.\n\\\\\nThe status quo of QD-based QKD experiments is summarized in \\textbf{Table \\ref{tab:table1}}, listing all implementations reported to date. For a comparison of different implementations, the reader should keep in mind the following comments. While some experiments were proof-of-concepts with a fixed communication distance and\/or lab-based experiments, others were performed at varying distance or attenuation to simulate different channel losses. In these cases, we give a range of parameters. Moreover, some references quote an average value for the QBER in their system, while this value in general depends on the channel loss. Furthermore, some of the quoted parameters rely either on assumptions made in the key rate calculation (which imperfections to include and which attacks to consider), while others depend highly on the equipment used (such as number of detector dark counts), making a direct comparison difficult. Finally, key rates that we calculated according to the asymptotic GLLP equation (cf. equation \\ref{eq:GLLP}, section \\ref{section1}) from parameters given in the respective publication are indicated by footnotes.\n\\\\\n\\newgeometry{left=1cm,right=1cm}\n\\begin{table}\n\\centering\n\\caption{Summary of QKD implementations employing QD-based quantum light sources (abbreviations: polarization (Pol), single-photon source (SPS), entangled photon-pair source (EPS), free space optical (FSO), fiber-coupled (FC))}\n\\label{tab:table1}\n\\begin{threeparttable}\n\\begin{tabular}{ccccccccccl}\n\\hline\nProtocol &\n Coding &\n \\begin{tabular}[c]{@{}c@{}}Source\/ \\\\ Pump\\end{tabular} &\n \\begin{tabular}[c]{@{}c@{}} Clock-rate \\\\ {[}MHz{]} \\end{tabular} &\n $\\lambda$ {[}nm{]} &\n \\begin{tabular}[c]{@{}c@{}}Max Sifted \\\\ Key Rate\\end{tabular} &\n \\begin{tabular}[c]{@{}c@{}}Max Secure \\\\ Key Rate\\end{tabular} &\n \\begin{tabular}[c]{@{}c@{}}QBER \\\\ {[}\\%{]}\\end{tabular} &\n \\begin{tabular}[c]{@{}c@{}}FSO\/ \\\\ FC \\end{tabular} &\n \\begin{tabular}[c]{@{}c@{}}Max\\\\ distance\\end{tabular} &\n Ref. \\\\ \\hline\nBB84 & Pol & SPS \/ optic. & 76 & 880 & - & 25 kbps & 2.5 & FSO & In-Lab & \\cite{Waks2002a} \\\\\nBB84 & Pol & SPS \/ optic. & 0.01 & 635 & 15 bps & 5 bps & 6.8 & FSO & In-Lab & \\cite{Aichele2004} \\\\\nBB84 & Phase & SPS \/ optic. & 1 & 1300 & 10 bps & 1 bps & 5.9 & FC & 35 km & \\cite{Intallura2009} \\\\\nBB84 & Pol & SPS \/ optic. & 40 & 895 & - & 8-600 bps & 1.2-21.9 & FC & 2 km & \\cite{Collins2010}\\\\\nBB84 & Phase & SPS \/ optic. & 20 & 1580 & 15-386 bps & 3-9 bps & 3.4-6 & FC & 50 km & \\cite{Takemoto2010} \\\\\nBB84 & Pol & SPS \/ elect. & 182.6 & 898 & 8-35 kbps & - & 3.8-6.7 & FSO & In-Lab & \\cite{Heindel2012} \\\\\nBB84\\tnote{ a)} & Pol & SPS \/ elect. & 200 & 653 & 9-117 kbps & - & 4.1-6.0 & FSO & In-Lab & \\cite{Heindel2012} \\\\\nBB84 & Pol & SPS \/ elect.& 125 & 910 & 5-17 kbps & - & 6-9 & FSO & 500 m & \\cite{Rau2014} \\\\\nBB84 & Phase & SPS \/ optic. & 62.5 & 1500 & 34 bps & 0.307 bps & 2-9 & FC & 120 km & \\cite{Takemoto2015} \\\\\nE91 & Pol & EPS \/ elect. & 50\\tnote{ b)} & 885 & 0.2 bps & 0.1 bps & - & FC & In-Lab & \\cite{Dzurnak2015} \\\\\nE91\\tnote{ c)} & Pol & EPS \/ optic. & 320 & 785 & 243 bps & 69\\tnote{ d)} & 3.4 & FC & 250 m & \\cite{Basset2021}\\\\\nE91 & Pol & EPS Optic. & 320 & 785 & 30 bps & 9 bps & 4.0 & FSO & 270 m & \\cite{Basset2021} \\\\\nBBM92 & Pol & EPS \/ optic. & 80 & 785 & 135 bps & 86 bps & 1.9 & FC & 350 m & \\cite{Schimpf2021a} \\\\ \\hline\n\\end{tabular}\na) Same publication as above but QKD experiment performed by a different group; b) Time-multiplexed detector effectively reduced clock rate to below 1 MHz; c) Modified asymmetric Ekert91 protocol; d) Calculated from stated parameters using the asymptotic GLLP equation;\n\\end{threeparttable}\n\\end{table}\n\\restoregeometry\nIn order to put the QKD implementations reviewed above into perspective, we now address the question which performance level, in terms of secure key rate and communication distance, can be expected with current state-of-the art QD-based quantum light sources. For this purpose, we use equations (\\ref{eq:GLLP}-\\ref{eq:GLLP_QBER}) to extrapolate the achievable asymptotic key rate from parameters reported in the literature as described in the following and assuming an operation wavelength of 1550 nm. Note, while the values states in the following were not yet realized at C-band wavelengths, the advances in the development of QD-based Telecom-wavelength quantum light sources make us optimistic that this can be achieved in the not too distant future.\n\\\\\nAs stated earlier, the amount of multi-photon events is upper-bounded by $P_\\text{M} \\leq \\frac{1}{2} \\mu^{2} g^{(2)}(0)$ \\cite{Waks2002}. Assuming a mean photon number of $\\mu=0.3$ and the record antibunching value of $g^{(2)}(0) = 7.5 \\cdot 10^{-5}$ \\cite{Schweickert2018}, an upper bound for the achievable multi-photon contribution can be calculated. Note that even larger values of $\\mu$ were recently demonstrated \\cite{Tomm2020}. In this regime, however, the increase of multi-photon contributions might effectively reduce the key rate at large loss on Bob's side. We further assume a setup transmission of $\\eta_\\text{Bob} = 0.3$ \\cite{gobby2004}, alignment errors of $e_{\\text{det}} = 1\\%$ \\cite{rusca2018finite}, and superconducting nanowire detectors with a few dark counts per second, resulting in $P_\\text{dc} = 10^{-8}$ dark counts per pulse with an detection efficiency of $\\eta_\\text{det} = 0.9$ \\cite{SingleQuantum}. Using ultralow-loss fibers, losses in the quantum channel of $\\alpha = 0.17\\, $dB\/km are possible at 1550 nm \\cite{rusca2018finite}. We further assume a value of $f_\\text{EC} = 1.1$ for the efficiency of the error correction protocol \\cite{elkouss2009} (with $f_\\text{EC} = 1$ being the ideal Shannon limit), $q=0.5$ for the sifting factor of the symmetric BB84 protocol, and a clock rate (for excitation and encoding) of $R_0=100\\,$MHz \\cite{Boaron2018a}.\n\\\\\nUsing these parameters, we deduce an asymptotic secure key rate exceeding 3$\\,$Mbit$\\,\\text{s}^{-1}$ at short distance, a key rate larger than 1$\\,$kbit$\\,\\text{s}^{-1}$ after a distance of 200 km in optical fiber, and a maximum achievable communication distance beyond 250$\\,$km. \nThese realistic extrapolations highlight the prospects for the substantial advances possible in the field of sub-Poissonian QKD, which are in turn also beneficial for schemes of quantum communication beyond direct point-to-point links. Also note, that this performance can be further improved significantly, e.g. by using higher clock-rates \\cite{Schlehahn2016}, asymmetric bases choices allowing for larger sifting factors, or temporal filtering \\cite{Kupko2020} as will be detailed in section \\ref{section4.6}. Keep in mind, however, that such high asymptotic key rates can only be achieved when sufficiently large block sizes of qubits are transmitted (about $10^{15}$), as otherwise finite-size effects drastically reduce the secure key rate \\cite{Scarani2009,cai2009}.\n\\\\\n\\subsection{Advanced QKD protocols \u2013 Towards Device Independence} \\label{section3.4}\nIn recent years, also advanced types of protocols have been proposed with a special emphasis on device independence. Knowing that the bulk of quantum hacking attacks target either the qubit source or the detector module, it would be a great advancement if the communication protocol did not have to rely on the integrity of any of these. While fully device-independent QKD (DI-QKD) is still only a theoretical proposal at this point \\cite{Acin2007,Masanes2011,Zapatero2019,Vazirani2019,Schwonnek2021}, intermediate steps such as source-independent \\cite{Koashi2003} or measurement-device-independent (MDI-QKD) might be feasible \\cite{Lo2012}. MDI-QKD guarantees independence of the detection setup which could in principle be controlled by an adversary. It is basically a time-reversed version of the Ekert protocol, requiring Alice and Bob each sending single photons to a central detector, which projects them into an entangled two-photon state via a Bell measurement. By learning the outcome of the Bell measurement and by communicating the preparation bases, Alice and Bob can establish a secret key. Knowing only the outcome of the Bell measurement does not reveal anything about the key which is why the detector does not need to be trusted. \n\\\\\nThis protocol has so far only been implemented using attenuated laser pulses \\cite{Rubenok2013,Liu2013,DaSilva2013,Cao2020,Semenenko2020,Wei2020} and also, as a proof-of-concept, with stored and released photons from down-conversion sources \\cite{Kaneda2017}. Implementing it with single photons is more difficult but will ultimately pay out. To allow for a successful and efficient Bell measurement, the photons must be indistinguishable. To obtain sufficiently indistinguishable single photons from remote sources, QDs are a promising candidate. Although high indistinguishability in practice is a challenge (due to local dephasing effects and spectral diffusion \\cite{Vural2020}) several demonstrations have already already surpassed the classical limit of $50\\%$ two photon interference visibility of laser light (see section \\ref{section4.2}) \\cite{Zhai2021}. The main advantage of QD single photons over the attenuated laser implementations is that, due to the limited visibility and the Poisson photon statistics, a Bell measurement using coherent light is less precise than using true single photons \\cite{Lee2021}. \n\\\\\nThe achievable secure key rate has already been analytically estimated for MDI-QKD based on attenuated laser pulses in the asymptotic \\cite{Lo2012}, as well as in the finite-length regime \\cite{Curty2014}, but not yet for true single photons, incorporating their better indistinguishability. MDI-QKD protocols are also a possible way of realizing many-parties metropolitan QKD networks with all members surrounding a central detection node in a star-like topology \\cite{Tang2016}. An experimental demonstration of this type of quantum network with sub-Poissonian quantum light source would be a major step towards the quantum internet.\n\n\\section{Recent Progress on Building Blocks for Quantum Networks}\\label{section4}\nHaving the ultimate aim of a world-wide quantum internet in mind, the establishment of a QKD-secured communication link, as discussed in the previous section, is only the first step. In this section, we discuss building blocks necessary for the extension toward networks (see \\textbf{Figure \\ref{fig:fig12}}). Noteworthy, many of these building blocks are equally important for other types of quantum technologies such as distributed quantum computing, optical quantum computing, quantum sensing \/ metrology and many more. This is why there are already extensive reviews on the building blocks for future quantum technologies \\cite{OBrien2009,Barnett2017,Uppu2021}. Therefore, in this section, we highlight recent advances in developing building blocks with a special focus on QD based communication networks. This includes practical QD SPSs (4.1), quantum memories compatible with QD single photons (4.3), teleportation of QD single photons (4.4) and quantum repeater schemes suitable for entangled photons from QDs (4.2). For completeness, we highlight recent advances in random number generation (4.5) and quantum network optimization tools (4.6).\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure12_TH.png}\n \\caption{Building blocks for future quantum networks. The numbers in brackets point at the section in which recent advances concerning that building block are discussed. In this review we focus on building blocks that are built on (or compatible with) QD light sources.}\n \\label{fig:fig12}\n\\end{figure}\n\\subsection{Towards practical quantum light sources} \\label{section4.1}\nA practical QD-based quantum light source is ideally \"plug-and-play\". This means that it is operable independent of special laboratory infrastructure (e.g. without the need for liquid coolants and large laser systems) and provides the generated quantum light \"ready-to-use\" via an optical fiber output. Furthermore, it needs to be robust and durable in use, as compact as possible, and ideally only requires standard mains voltage as power supply. Not least, a practical source needs to be benchmarked regarding long-term stability.\n\\\\\nA key requirement to integrate QD-SPSs into practical modules as described above is a technology for the precise alignment and permanent coupling of the QD-device to an optical fiber. Such a direct connection has been the interest of research for more than a decade, starting with the probabilistic coupling of QDs using bundles of hundreds of single mode fibers \\cite{Xu2007}, then exploring deterministic coupling possibilities using open cavity systems \\cite{Muller2009} and deterministic selection of nanowire SPSs \\cite{Cadeddu2016}. \n\\\\\nRecently, fiber-scanning techniques in combination with epoxy resists or optical (UV-) adhesives have shown to be suitable for permanent fiber-coupling of micropillar cavities \\cite{Haupt2010,Snijders2018,Rickert2021}, microlens and micromesa SPSs \\cite{Schlehahn2018,Zonacz2019,Musial2020}, as well as for nanowires \\cite{Northeast2021}. A schematic of an electrically controllable, fiber-coupled micropillar-cavity with a detection and excitation fiber and capable of resonant excitation schemes published by Snijders and coworkers in 2018 \\cite{Snijders2018} is shown in \\textbf{Figure \\ref{fig:fig13}a}. While permanently coupled devices reported to date reached overall efficiencies in the range of only few percent \\cite{Snijders2018}, microcavities based on hybrid circular Bragg gratings (hCBGs) have recently been evaluated as promising a strategy for achieving large fiber coupling efficiencies up to unity. In their study, Rickert et al. presented numerically optimized designs for devices operating at O-band wavelengths \\cite{Rickert2019}, indicating that overall efficiencies exceeding $80\\%$ are possible using off-the shelf single-mode fibers. A schematic depiction of a single-mode fiber-coupled hCBG-cavity is shown together with simulation data in Figure \\ref{fig:fig13}b. This device approach appears particularly promising, considering the potential for state-of-the art SPS performances \\cite{Wang2019}.\n\\\\\nThe QD-based SPSs used for QKD experiments so far, entirely relied on laboratory infrastructure including bulky cryogenics in particular. A way to realize these low temperatures in a more practical fashion is to use off-the-shelf Stirling-cryocoolers \\cite{sunpower}. Such cryocoolers, operable with 230 V standard net supply voltage, allow operation of a suitable quantum emitter at temperatures below 30 K, an approach first introduced by Schlehahn et al. in 2015 using free-space optics \\cite{Schlehahn2015}. Subsequently, the integration of fiber-coupled QD-based SPSs in state-of-the-art Stirling cryocoolers proved to be a promising route for realizing plug-and-play QD-based quantum light sources as demonstrated for a fiber-pigtailed QD-device emitting around 925 nm in 2018 \\cite{Schlehahn2018}. The cryocoolers were compact enough to integrate them into a standard 19\" rack module (Figure \\ref{fig:fig13}c) and the achievable base-temperature of 40 K could be reached easily within 30 min. In the work by Musia\u0142 et al. the source module additionally housed a fiber-based pulsed laser as well as a fiber-based spectral filter, providing single-photon pulses in the telecom O-Band at the SMF-28 fiber output \\cite{Musial2020}.\n\\\\\nAnother aspect for practical single photon sources, it is worth also considering alternative ways of source excitation to achieve practicability. While in principle an electrically-contacted SPS allows efficient, fast and practical excitation, optical excitation required for resonant excitation of the source can also be desirable. In a pioneering work in 2013, Stock et al. proposed to use electrically driven microlaser sources in close vicinity to excite QDs in micropillar cavities, and showed Purcell enhanced emission for a QD in a micropillar exited in such a way \\cite{stock2013}. In 2017 Munnelly et al. used this on-chip excitation concept to show single-photon emission with an emission rate above 100 MHz and the possibility of wavelength tuning via the quantum-confined Stark-effect \\cite{Munnelly2017}. In a work in 2017 following a similar concept, Lee and coworkers realised an on-chip excited quantum dot light emitting diode (LED) and used the quantum-confined Stark effect to also tune the fine-structure of the emitting QD \\cite{Lee2017}. Work of such an on-chip driven QD entangled LED deployed in an urban fiber network was published recently \\cite{Xiang2020}. Although so far not demonstrated for (quasi-) resonant excitation, the concept of using an on-chip pumped QD SPS shows the potential for a very compact optical excitation compatible with the discussed Stirling technology.\n\\\\\nIn summary, the integration of directly fiber-coupled QD-based SPSs into compact cryocoolers offers a promising approach for high-performance plug-and-play quantum light sources. While Stirling-type refrigerators are the most compact solution to date, the achievable base temperatures are presently limited to about 27 K. Applications which rely on the excellent coherence properties of QDs, e.g. for the generation of highly indistinguishable photons, small-footprint Gifford-McMahon (GM) cryocoolers in combination with compact compressors are an alternative. Beyond the promising proof-of-concept experiments with fiber-coupled QD-SPSs in Stirling cryocoolers discussed above, a next important step is to show that this concept can also exploit the full potential QDs offer in terms of the efficiency and single-photon purity.\n\\begin{figure}\n \\includegraphics[width=0.5 \\linewidth]{figure13.png}\n \\caption{(a) Schematic of a fiber-coupled micropillar cavity with electrical control, and two fiber connections for excitation and collection. (b) (left) Schematic representation of a hybrid circular Bragg grating (hCBG) cavity coupled to a optical single mode fiber. (right) Simulated fiber coupling efficiencies of a hCBG cavity with two different single mode fibers as function of the grating gap width W (see Ref. \\cite{Rickert2019} for details). (c) QD-based SPS source module based on a Stirling cryocooler with active vibration cancellation (AVC) employing a fiber-coupled QD-based microlens SPS (from Ref. [Schlehahn2018]\\cite{Schlehahn2018}). (a) Reprinted with permission from \\href{https:\/\/link.aps.org\/doi\/10.1103\/PhysRevApplied.9.031002}{\\textit{Snijders et al. 2018}} \\cite{Snijders2018} Copyright 2018 by the American Physical Society, (b) Copyright 2021 by the authors of this work. (c) reprinted from \\href{http:\/\/www.nature.com\/articles\/s41598-017-19049-4}{\\textit{Schlehahn et al. 2018}} \\cite{Schlehahn2018} under Creative Commons CC BY license.}\n \\label{fig:fig13}\n\\end{figure}\n\\subsection{Towards Quantum Repeaters} \\label{section4.2}\nThe maximum distance over which a QKD scheme can exchange a provably secure key is limited due to photon loss, both in free-space and in fiber links. To cover larger distances, one has to rely on trusted intermediate nodes, which reduces the overall security. However, the maximum distance, as well as the rate can be extended without trusted nodes, by using so-called quantum repeaters. These allow to transfer an encoded qubit, without travelling the entire distance, with the help of entangled photon pairs and entanglement swapping. In this subsection we will briefly introduce the quantum repeater protocol and entanglement swapping, before we highlight recent advances in the key ingredient, two-photon interference from remote QD-based SPSs.\n\\\\\nThe original repeater protocol was proposed by D\u00fcr, Briegel, Cirac and Zoller in 1998 (now known as BDCZ protocol), as a way of reducing the errors in quantum channels, which depend exponentially on the transmission loss \\cite{Briegel1998,Dur1999}. This protocol enables the distribution of a maximally entangled photon pair, such as the well-known EPR state, in reference to the Einstein-Podolski-Rosen paradox \\cite{Einstein1935}, over arbitrary distances. A version which uses atomic ensembles both as the memory and the photon source is known as the DLCZ protocol \\cite{Duan2001}. The entangled photon pair can then be used to realize QKD protocols based on entangled photon pairs or to teleport any quantum state from one end to the other. To distribute the entanglement, the authors proposed to use multiple EPR states. The entangled photons are each split up and sent to opposite directions, thus covering a small part of the quantum channel length. At intermediate nodes, the photons are stored and then, via a joint Bell state measurement (BSM) between two photons of different EPR pairs, the entanglement is swapped, entangling the two remaining photons. By repeating this many times in a nested fashion, arbitrary distances can in principle be covered (\\textbf{Figure \\ref{fig:fig14}a}).\n\\\\\nNote, that as all photons together travelled the total distance in case of a successful run, an improvement of the photon loss sensitivity is only achieved, if each intermediate node has access to a quantum memory. In this case, redundant EPR pairs can be sent, until the memory is filled, and the BSM can be made, thus preventing any loss between two of such nodes. In other words, the quantum channel is cut into shorter segments and over each segment entanglement purification can create maximally entangled, distributed photon pairs in a memory, before entanglement swapping connects all these segments.\n\\\\\nThis protocol can be implemented with different quantum emitter platforms \\cite{Loock2020}, but to be implemented with entangled photon pairs from QDs, a quantum memory compatible with QD single photons is required, which will be discussed in \\textbf{section 4.3}. It also requires the ability to successfully project two single photons into a joint two-photon Bell state to realize the entanglement swapping. This was demonstrated for the first time by Pan et al. using a SPDC source \\cite{Pan1998}. The authors created two pairs of entangled photon states, projected one photon of each pair in a joint two-photon Bell state via two-photon-interference (TPI) and finally proved entanglement of the remaining two photons that never interacted before. \n\\\\\nA quantum repeater node implementing the BDCZ protocol was first experimentally realized by Yuan et al. \\cite{Yuan2008} using two atomic ensembles as quantum memories. By projecting photons, entangled with the states of their respective memory, in a joint Bell state, the entanglement was swapped, entangling the two atomic ensembles, which was confirmed by measuring the entanglement between the photons emitted from the memories. \n\\\\\nIn addition to memory-based quantum repeaters, all-photonic, measurement-based repeater schemes have been proposed which do not need a quantum memory to operate \\cite{Zwerger2012,Azuma2015,Zwerger2016}. The necessary resource states for such a repeater protocol are photonic cluster states, which were recently used in a proof-of-principle quantum repeater experiment \\cite{Li2019}. Photonic cluster states are also relevant for photonic quantum computing \\cite{raussendorf2001} and have already been generated using QD SPSs \\cite{Schwartz2016,Istrati2020}.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure14.png}\n \\caption{The concept of a quantum repeater to distribute entanglement over long distances (a). The two types of BSMs using linear optics with (b) only 1 BS to identify 1\/4 Bell states and (c) with PBS to identify 2\/4 Bell states from coincidence detections.}\n \\label{fig:fig14}\n\\end{figure}\nThe crucial ingredient for all repeater protocols and many other schemes in quantum information is to perform a Bell State measurement, which is typically implemented via two-photon-interference experiments at a beam splitter. Before reviewing recent advances in QD-based TPI, we remark a few general things concerning joint BSMs. The Bell basis is the natural basis of the 4-dimensional Hilbert space in which a joint two-qubit state is described. It consists of four maximally entangled states, the Bell states, that are non-separable superpositions of the tensor products of the respective one-particle Hilbert space bases. For the case of polarization as the only relevant quantum number (the two photons are ideally indistinguishable in all other quantum numbers) and using the rectilinear {H,V}-basis, they can be written as $|\\Psi^{\\pm}> = \\frac{1}{\\sqrt{2}} \\left( \\ket{HV} \\pm \\ket{VH} \\right)$ and $|\\Phi^{\\pm}> = \\frac{1}{\\sqrt{2}} \\left(\\ket{HH} \\pm \\ket{VV} \\right)$.\n\\\\\nA fundamental limit to BSMs is that, using linear optics, only two states out of the four Bell states can be discriminated \\cite{Braunstein1995a}, thus without photon-photon interaction, only a partial BSM with a success rate of $50\\%$ is possible. Braunstein et al. were the first to point out that two-photon-interference at a BS can be seen as a BSM, since the Bell states are eigen-states of the unitary that describes the BS. If the photons go to opposite outputs of the BS, one can be sure that a projection into the $\\ket{\\Psi^{-}}$ Bell state took place (Figure \\ref{fig:fig14}b). The reason is that only the $\\ket{\\Psi^{-}}$ Bell state is antisymmetric under particle exchange and thus displays fermionic anti-bunching statistics, causing the particles to leave from opposite output ports of the BS. But this only leads to a successful BSM in $25\\%$ of the cases. Furthermore, the photons need to be indistinguishable in all other quantum numbers, so that only their projected polarization state determines the coincidences. Otherwise, if the photons are too distinguishable, also a projection into the other Bell states would show up as an erroneous $\\ket{\\Psi^{-}}$ coincidence event between the two outputs. But if the photons are indeed indistinguishable and not projected into the $\\ket{\\Psi^{-}}$ state, they will go to the same output, as observed in the Hong-Ou-Mandel (HOM) effect, where it was first shown that completely indistinguishable single photons always leave the BS together \\cite{Hong1987}.\n\\\\\nOne can increase the BSM efficiency to $50\\%$ for polarization encoded photons, by adding a PBS at each output of the interference BS (Figure \\ref{fig:fig14}c) to further distinguish the polarization of the states that leave the BS from the same output. Photons which arrive at the same output side, with the same polarization, will go to the same detector and thus do not lead to coincidences (the $\\ket{\\Phi}$ states), while the $\\ket{\\Psi^{+}}$ state photons leave from the same output with different polarizations and thus lead to coincidences. Hence, one can now identify both $\\ket{\\Psi}$ states, because they are anti-correlated in polarization. Thus, $\\frac{1}{2}$ of the possible Bell basis can be detected at maximum.\n\\\\\nNote that if the incoming photons are not sufficiently indistinguishable, erroneous coincidences in the PBS basis can be detected, while states prepared in any other basis (that are randomly projected at the PBS) lead to false coincidences, as was shown by Basset et al. by comparing the achieved teleportation fidelities under the $25\\%$ and $50\\%$ BSM (without and with PBSs), as well as with high and low indistinguishability \\cite{Basset2020a}. Since SPSs allow higher indistinguishability, they cause less erroneous coincidence events than photons from SPDC sources. Note furthermore that, also due to more multi-photon events, a Bell measurement is less precise with attenuated laser pulses, than with true single photons \\cite{Lee2020}. The reason is that false coincidences due to two photons in one BS input cannot always be distinguished from true coincidences from one photon in each BS input. Therefore, it is of critical importance for many applications to achieve TPI with indistinguishable single photons from remote quantum emitters.\n\\\\\nThe indistinguishability is quantified by the coalescence probability (for pure states the maximum wave packet overlap of the two photons $P_{Coal} = \\abs{\\bra{\\phi_1}\\ket{\\phi_2}}$ , which is estimated by measuring the TPI visibility V in a Hong-Ou-Mandel interference experiment \\cite{Hong1987}. Hereby, one typically measures the suppression of coincidences between two BS outputs due to indistinguishable paths at vanishing temporal delay, and normalizes it by comparison to the case of maximum distinguishability (selecting a cross-polarized configuration, detuned wavelengths or detuned arrival times). While phase-randomized Poissonian light is limited to a visibility of 0.5 \\cite{Mandel1983}, single photons can reach higher visibilities up to unity, for more efficient BSMs.\n\\\\\nIn order to measure a high TPI visibility between photons from remote emitters, they must be as indistinguishable as possible, i.e. they must agree in all quantum numbers. So far, TPI between photons from remote emitters has already been demonstrated with many different types of photon sources, such as parametric down conversion sources \\cite{DeRiedmatten2003,Llewellyn2020}, trapped atoms \\cite{Beugnon2006}, atoms in combination with QDs \\cite{Vural2018}, trapped ions \\cite{Maunz2007}, silicon and nitrogen vacancy centers in diamond \\cite{Sipahigil2014,Bernien2012,Humphreys2018}, and also molecules \\cite{Lettow2010}. In the following, we will discuss recent progress on TPI experiments with photons emitted by remote QD-based quantum light sources.\n\\\\\nIn the case of QDs, due to their self-organized nature and the semiconductor environment, the spectral properties of the quantum emitters are of particular importance. While photons that are emitted subsequently by the same QD have shown almost ideal TPI visibilities $>99\\%$ \\cite{Somaschi2016}, such high values have not yet been achieved for TPI between photons from remote QDs. When photons are emitted by QDs located at different positions and interacting with their unique environment, the wavelength of their emitted photons are likely to be different. Coarse spectral matching of quantum emitters can thus be achieved using pre-selection of suitable QDs, if deterministic fabrication technologies are used even in engineered devices \\cite{Rodt2020,Liu2021}. Subsequently, a spectral fine-tuning is typically required, e.g. via temperature control (\\textbf{Figure \\ref{fig:fig15}}f) \\cite{Giesz2015,Thoma2016}, strain tuning (Figure \\ref{fig:fig15} c-e) \\cite{Flagg2010,Beetz2013,Reindl2017,Moczaa-Dusanowska2020,zhai2020a}, or electrical tuning via the quantum-confined Stark effect in diode-like structures (Figure \\ref{fig:fig15} a, b) \\cite{Patel2010}. These methods are summarized in Figure \\ref{fig:fig15} and the obtained visibilities of the respective TPI experiments are collected in Table 2.\n\\\\\n\\begin{figure}[h]\n \\includegraphics[width= \\linewidth]{figure15.png}\n \\caption{Different ways to tune the emission energies of remote QDs in TPI experiments. Patel et al. used electrical tuning of QDs in a diode-like structure (a) which allowed them to match the energies (b) \\cite{Patel2010}. Zhai et al. employed piezo actuators to apply strain to the QD (c) which enabled tuning of the emission energies (d) \\cite{zhai2020}, as did Reindl et al. to match the QD energies (e) \\cite{Reindl2017}. Giesz et al. used temperature to tune the QD energy into the cavity resonance (f) \\cite{Giesz2015}. (a,b) reprinted by permission from Springer Nature: \\href{http:\/\/dx.doi.org\/10.1038\/nphoton.2010.161}{\\textit{Patel et al. 2010}} \\cite{Patel2010} Copyright 2010, (c,d) reprinted from \\href{https:\/\/aip.scitation.org\/doi\/full\/10.1063\/5.0017995}{\\textit{Zhai et al. 2020}} \\cite{zhai2020}, with the permission of AIP Publishing, (e) reprinted from \\href{https:\/\/pubs.acs.org\/doi\/10.1021\/acs.nanolett.7b00777}{\\textit{Reindl et al. 2017}} \\cite{Reindl2017} under Creative Commons license CC-BY, (f) reprinted Figure with permission from \\href{https:\/\/link.aps.org\/doi\/10.1103\/PhysRevB.92.161302}{\\textit{Giesz et al. 2015}} \\cite{Giesz2015} Copyright 2015 by the American Physical Society.}\n \\label{fig:fig15}\n\\end{figure}\nHowever, even if the nominal emission energies of two QDs are matched perfectly, the achievable TPI visibility can be limited by several effects. Phonon induced dephasing, fluctuation of electron spins and fluctuation of surrounding charges can lead to emission energy fluctuations (also known as spectral diffusion) as well as emission line broadening \\cite{Vural2020}. Recently, an analytical model including dephasing as well as spectral diffusion has been developed, which can be used to predict the maximum expected TPI visibilities from experimentally accessible parameters of each individual QD \\cite{Kambs2018} - previous models numerically investigated achievable visibilities for non-ideal SPSs \\cite{Fischer2016}. To reduce the inhomogeneous line broadening mechanisms of QDs, different countermeasures can be taken, such as working at ultra-low temperatures to freeze out the majority of phonon contributions to the dephasing, resonant excitation schemes combined with small amounts of off-resonant light, as well as external control via electric and magnetic fields to saturate charge traps and align the nuclear spins inside the QD to reduce fluctuations. All the necessary requirements can be summarized as follows: For maximum indistinguishability, one needs Fourier-limited SPSs, which have no inhomogeneous line broadening. Such QD-SPSs were reported by Wang et al. \\cite{Wang2016} and Kuhlmann et al. \\cite{Kuhlmann2013}, but they are far from being the norm.\n\\\\\nAdditionally, to reduce relative spectral drifts between the two QD emission energies, an active feedback can be used \\cite{Schmidt2020}. Such a stabilization was applied to remote TPI experiments by Zopf et al., who applied piezo strain to compensate for any spectral drift to stabilize the emission energies of the QDs \\cite{Zopf2018}. In their setup both QDs were tuned via piezos glued to the QD. A fraction of the emitted photons went through a Faraday filter made from a Rubidium vapor cell, to identify small shifts in emission wavelengths and then a feedback loop corrected them. By doing so, they achieved a remote QD TPI visibility of $41\\%$, as predicted by the Kambs et al. model \\cite{Kambs2018} for their QD parameters. The active stabilization resulted in higher average TPI visibility compared to the unstabilized case (\\textbf{Figure \\ref{fig:fig16}a}).\n\\\\\nAnother technique, which was employed by Weber et al., is to use frequency conversion of both QDs (Figure \\ref{fig:fig16}b) to do the TPI at 1550 nm, in the Telecom window \\cite{Weber2019}. Although the two QDs themselves were spectrally distinguishable, laser-tuning in the upconversion process allowed the authors to match the photon's wavelengths (Figure \\ref{fig:fig16}c), resulting in an observed TPI visibility of $29\\%$. By now, TPI visibilities exceeding the classical limit of $50\\%$ were achieved in several experiments using QDs. Reindl et al. in 2017 for instance used a phonon-assisted two-photon excitation scheme in combination with piezo strain tuning to match the emission energies \\cite{Reindl2017} resulting in a TPI visibility of $51\\%$.\n\\\\\nVery recently, a new record has been set by Zhai et al. \\cite{Zhai2021}, reaching visibilities of up to $93\\%$ between QDs located in different cryostates. The high visibility was achieved without Purcell enhancement, tight spectral filtering, post-selection or any active stabilization, simply by using high quality, low noise, electrically tunable QD samples, leaving even room for further improvement \\cite{zhai2020a,zhai2020}. In another recent experiment You et al. observed interference of remote QD single photons that were converted to 1583 nm via quantum frequency conversion and separated by a 300 km optical fiber \\cite{You2021}, setting a remarkable record for the distance achieved between interfering QD-sources.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure16.png}\n \\caption{Active stabilization of QDs in remote TPI (red curve in a) improves visibility compared to no stabilization (blue curve in a) \\cite{Zopf2018}. Matching of remote QD wavelengths (c) via Quantum Frequency Conversion (b) \\cite{Weber2019}. (a) reprinted with permission from \\href{https:\/\/doi.org\/10.1103\/PhysRevB.98.161302}{\\textit{Zopf et al. 2018}} \\cite{Zopf2018} Copyright 2018 by the American Physical Society, (b,c) reprinted with permission from Springer Nature: Nature Nanotechnology \\href{http:\/\/dx.doi.org\/10.1038\/s41565-018-0279-8}{\\textit{Weber et al. 2019}} \\cite{Weber2019} Copyright 2019.}\n \\label{fig:fig16}\n\\end{figure}\nNoteworthy, indistinguishable photons are not only important for entanglement swapping and quantum repeaters, but also to erase the which-path-information in schemes that generate entanglement between remote solid-state qubits \\cite{Cabrillo1999}. This entanglement scheme was realized experimentally with remote QDs using hole- \\cite{Delteil2015} as well as electron-spins \\cite{Stockill2017}. An overview of achieved TPI visibilities with remote QD single photons is given in \\textbf{Table \\ref{tab:table2}}.\n\\\\\n\\begin{table}\n\\centering\n\\caption{Chronological overview of achieved visibilities in remote QD TPI experiments}\n\\label{tab:table2}\n\\begin{threeparttable}\n\\begin{tabular}{cccc}\n\\hline\nWavelength in nm & Tuning mechanism & TPI visibility [$\\%$] & Reference \\\\ \\hline\n 940 & Electrical & 33 $\\pm$ 1\\tnote{(a)} & Patel et al. 2010 \\cite{Patel2010} \\\\\n920 & Piezo strain & 18 $\\pm$ 1 & Flagg et al. 2010 \\cite{Flagg2010} \\\\\n930 & Temperature & 39 $\\pm$ 2 & Gold et al. 2014 \\cite{gold2014} \\\\\n945 & Temperature & 40 $\\pm$ 4 & Giesz et al. 2015 \\cite{Giesz2015} \\\\\n 955 & Electrical & 91 $\\pm$ 6 & Delteil et al. 2015 \\cite{Delteil2015} \\\\\n933 & Temperature & 29 $\\pm$ 6 & Thoma et al. 2016 \\cite{Thoma2016} \\\\\n1250 & Laser-induced Evaporation & 33 $\\pm$ 1\\tnote{(a)} & Kim et al. 2016 \\cite{Kim2016a}\\\\\n750 & Piezo strain & 51 $\\pm$ 5 & Reindl et al. 2017 \\cite{Reindl2017} \\\\\n 968 & Electrical & 93 $\\pm$ 1 & Stockill et al. 2017 \\cite{Stockill2017} \\\\\n795 & Piezo strain & 41 $\\pm$ 5\\tnote{(b)} & Zopf et al. 2018 \\cite{Zopf2018} \\\\\n1550 & Frequency Conversion & 29 $\\pm$ 3 & Weber et al. 2019 \\cite{Weber2019} \\\\\n780 & Electrical & 93 $\\pm$ 1 & Zhai et al. 2021 \\cite{Zhai2021} \\\\\n1583 & Frequency Conversion & 67 $\\pm$ 2\\tnote{(c)} & You et al. 2021 \\cite{You2021} \\\\ \\hline\n\\end{tabular}\n a) used temporal post-selection (CW experiment); b) with active feedback; c) (93 $\\pm$ 4)$\\,\\%$ with temporal filtering\n\\end{threeparttable}\n\\end{table}\nA proof-of-concept entanglement swapping (\\textbf{Figure \\ref{fig:fig17}a}) experiment with polarization entangled photons from QDs was reported by Zopf et al. \\cite{Zopf2019} as well as by Basset et al. \\cite{Basset2019}. Here, the entangled photon pairs did not yet originate from two different QDs, since the remote TPI visibility was not sufficient. Instead, two entangled photon pairs, that are subsequently emitted from the same QD, were each split up spectrally, with one photon of each pair being sent to a receiver module, where a partial BSM is performed on the joined state of one photon from each entangled photon pair (Figure \\ref{fig:fig17}b). Note that it is important to pick photons with the same energy for them to be indistinguishable, here they use the XX-photon from both entangled photon pairs. \n\\\\\nIn at best $25\\%$ of the TPI events, a coincidence indicates a projection into the $\\ket{\\Psi^{+}}$ Bell state (note that despite the photons leaving from different output ports of the BS here, a phase shift of $\\pi$ rotates them into the $\\ket{\\Psi^{+}}$ state). For these cases, the two remaining photons violated the CHSH inequality, in other words were entangled, which means that entanglement swapping took place. State tomography revealed that after the swapping, the two X photons were in the entangled $\\ket{\\Psi^{+}}$ state (Figure \\ref{fig:fig17}d), but without the BSM, their density matrix was maximally mixed (Figure \\ref{fig:fig17}c). Using the determined density matrices, Zopf et al. obtained a fidelity of the joint state of the remaining photons, to the Bell state, of $81\\%$ \\cite{Zopf2019}. \n\\\\\nIn addition to being the first proof-of-principle experiment of entanglement swapping with entangled photons from QDs, the emission wavelength was 780 nm which is close to the D2 optical-transition line in Rubidium, making it compatible to Quantum memories (see \\textbf{section 4.3}). Note also, that entanglement swapping of QD entangled photon pairs creates two entangled photons at the same energy, which is different from the typical XX-X emission cascade in QDs.\n\\\\\nBasset et al. did a similar experiment but triggered their coincidences on projections into the $\\ket{\\Psi^{-}}$ Bell state, using coincidences from two different outputs of the BS \\cite{Basset2019}. As for Zopf et al., the obtained fidelity of the entangled state after the swapping is mainly limited by the indistinguishability of the used photon pairs and their initial degree of entanglement. To quantify that, the authors introduced a model which incorporates the initial entanglement fidelity, mainly determined by the amount of FSS, and the HOM visibility, which reproduces their measured results (Figure \\ref{fig:fig17}e). \n\\\\\nUsing the parameters of state-of-the-art QD entangled photon sources \\cite{Huber2018,Liu2019}, they predict a maximum achievable fidelity of the swapped entanglement of $83\\%$ with current technology. Even higher values can be expected with further improvements in the foreseeable future, opening up the route for entanglement swapping using remote QD-sources and ultimately quantum repeaters based on sub-Poissonian quantum light sources.\n\\\\\n\\begin{figure}[h]\n \\includegraphics[width= \\linewidth]{figure17.png}\n \\caption{Realization of entanglement swapping (a) with entangled photons emitted by the same QD (b). State tomography revealed that the two X photons were afterwards in the entangled psi-plus state (d), but without the BSM, their density matrix is maximally mixed (c) \\cite{Zopf2019}. Achievable fidelity of the state after entanglement swapping as a function of TPI visibility and FSS (f) \\cite{Basset2019}. (a-d) Reprinted with permission from \\href{https:\/\/doi.org\/10.1103\/PhysRevLett.123.160502}{\\textit{Zopf et al. 2019}} \\cite{Zopf2019} Copyright 2019 by the American Physical Society, (e) reprinted from \\href{https:\/\/doi.org\/10.1103\/PhysRevLett.123.160501}{\\textit{Basset et al. 2019}} \\cite{Basset2019} under Creative Commons License CC BY 4.0.}\n \\label{fig:fig17}\n\\end{figure}\nTo summarize, while making remote single photons from different QDs indistinguishable enough to project them reliably into a joint BSM is a challenge that requires high quality samples, resonant excitation schemes and very good experimental control, it has already been demonstrated several times with TPI visibilities surpassing the classical limit of $50\\%$ for WCPs. This promises further advances in QKD schemes and quantum repeaters relying on remote sources.\n\n\\subsection{Quantum Memory} \\label{section4.3}\nAnother crucial building block for many applications in quantum information is the quantum memory. An ideal quantum memory stores a quantum state with zero decoherence for an infinite amount of time and allows on-demand retrieval of the same quantum state for further use. It does so at a high bandwidth for fast operation and without introducing additional photon noise. In a quantum computation scenario, a quantum memory is necessary to delay computational steps, temporarily store quantum states, and hereby allow for more complex algorithms or new computation schemes such as linear optical quantum computing (LOQC) \\cite{Kok2005}. Other applications of quantum memories include quantum metrology \\cite{Giovannetti2011}, quantum machine learning \\cite{Biamonte2017}, single-photon detectors \\cite{Imamoglu2002} and more (see \\cite{Bussieres2013} for an in-depth review).\n\\\\\nIn communication scenarios we consider in this review, quantum memories are required for the implementation of quantum repeater protocols (cf. previous subsection), which allow to distribute entanglement and enable QKD over, in principle, arbitrary distances \\cite{Briegel1998}. Note, that although there exist all-photonic repeater schemes, which do not rely on quantum memories, they are complex in other ways, e.g., demanding multiple multiplexed quantum channels or cluster states \\cite{Li2019,Borregaard2020}. Quantum communication also profits indirectly from a quantum memory, e.g. from memory-assisted two-photon interference and facilitated teleportation, as discussed in \\cite{Ma2019}.\n\\\\\nDifferent types of memories have been proposed and demonstrated in the past, such as solid-state systems \\cite{DeRiedmatten2008}, trapped atoms \\cite{Bao2012} and alkali vapor cells \\cite{Eisaman2005}. For an extensive overview of memory protocols and platforms we refer to \\cite{Heshami2016}. Here, we want to focus on memories that are suitable for QD-SPSs, as well as practical enough for scalable, optical quantum networks.\n\\\\\nAs a natural way of creating nodes for an optical quantum network is to combine QD-SPSs with compatible quantum memories, one has to ensure that the memories can keep up with the quantum emitters in terms of efficiency and bandwidth. QDs allow high emission rates, thus the memory should be able to operate at a similar rate. Since not every pulse emitted by a real QD contains a photon, memories also require low noise backgrounds so that it is possible to distinguish a retrieved photon from the noise floor. In the following, we will review recent advances in quantum memories compatible with QDs (see also Neuwirth et al. \\cite{Neuwirth2021} for an in-depth review).\n\\\\\nAlkali vapor cells are promising candidates to realize QD-compatible memories (\\textbf{Figure \\ref{fig:fig18}a}). Here, the group velocity of light pulses propagating through the atomic ensemble can be reduced, i.e. light pulses are slowed down, which allows for photon storage \\cite{hau1999}. Using warm alkali vapor cells allows one to omit the complex cooling infrastructure necessary for many solid-state memories and the laser cooling necessary for memories based on cold atoms. They are also practical for larger networks, because they can offer sufficiently long coherence times \\cite{Borregaard2016} and profit from a large set of existing memory protocols \\cite{Lvovsky2009}. Moreover, solid-state memories and ultracold atoms have much less noise, smaller bandwidths, and longer storage times, making them more desirable for long-term memories, but are, due to the smaller bandwidth, not compatible with QD single photons in quantum networks.\n\\\\\nTo store photons in the atomic ensemble inside an alkali vapor, one uses transitions between three energy levels (a so-called $\\lambda$-system), with two spectrally-close lower states and one excited state at a higher energy, which enables an effect called electromagnetically induced transparency (EIT) \\cite{Fleischhauer2000,Ma2017} (Figure \\ref{fig:fig18}b). While the to-be-stored quantum state is resonant with one transition, a control pulse enables the excitation by driving the other transition. On the atomic level, all the atoms are prepared in a joint ground state, before the excitation by the signal photon, in combination with a control pulse, leads to the creation of an atom-spin-wave, in which the coherence is stored. With a second control pulse, the spin-wave is transformed back into an optical excitation and the photon can be retrieved again (Figure \\ref{fig:fig18}c).\n\\\\\nTypically, signal- and control- pulse are detuned from the resonant atomic transition, to reduce noise due to immediate fluorescence. One way of detuning them and still driving the transitions, is by using Raman scattering, where the anti-stokes-shift helps matching the transition energy, as shown by Reim et al. \\cite{Reim2011}. While detuning reduces the noise floor, higher detuning reduces the memory efficiency and requires higher control pulse intensities and consequently a better suppression of the control pulse in the memory output, thus a compromise between low noise and efficient excitation must be found.\n\\\\\nInitial theoretical comparisons of different schemes of using Rubidium vapor cells combined with QD single photons were performed by Rakher et al. \\cite{Rakher2013} and highlighted the necessary steps towards storing QD single photons in a high bandwidth memory. Such a memory was demonstrated with an end-to-end efficiency of $3.4\\%$ by Wolters et al., using a warm Rubidium vapor cell to store photons (emitted by a laser) for a time of up to 50 ns exploiting EIT and achieving a bandwidth of 0.66 GHz, compatible with typical QD-SPSs \\cite{Wolters2017}.\n\\\\\nThe quantum memory demonstrations presented up to here only proved that a photon could be stored and retrieved with finite efficiency, but not that the retrieved photon was actually the same, i.e. indistinguishable from the initial photon. This was shown first by Hosseini et al. who achieved $98\\%$ process fidelity by performing quantum state tomography on the retrieved photons \\cite{Hosseini2011}. In this context, another insightful experiment towards quantum memories was performed by Vural et al., in which the authors performed TPI measurements between two photons of which only one went through the alkali vapor cell, proving that the two photons were still indistinguishable after interacting with the atomic ensemble \\cite{Vural2018}. Moreover, the state-of-the-art for hot vapor cell quantum memories in terms of efficiency was recently demonstrated by Guo et al. who achieved an efficiency of >$82\\%$, using the Raman-detuned quantum memory scheme and attenuated laser pulses as the signal photons \\cite{Guo2019}.\n\\\\\nHowever, standard EIT in vapor cells does not allow storing qubits in which the information is encoded in the polarization, since the EIT memory only preserves the phase, but not the polarization. This was solved by England et al. achieving $98\\%$ fidelity of polarized photons using a dual-rail memory \\cite{England2012}, as well as by Namazi et al. demonstrating storage of single polarized photons and their retrieval with a fidelity to the original polarization state exceeding $90\\%$ \\cite{Namazi2017}, which they also employed in QKD experiments \\cite{namazi2017free}. For this purpose, both groups used polarization-dependent displacement optics (Glan-laser polarizer) to transform the polarization-encoding into a path-encoding, defining two spatially separate paths through the memory, and then converting the qubits back to polarization-states after leaving the memory (Figure \\ref{fig:fig18}d). Hereby, each polarization component is individually stored by taking a different path through the memory medium. Since the entangled photons generated from the XX-X radiative cascade in QDs are polarization entangled, the demonstration of a quantum memory for polarization qubits was a major step towards memory-based quantum networks using QD quantum light sources. Recently, also the storage and retrieval of a pair of polarization entangled photons inside a quantum memory was demonstrated \\cite{Ding2018}.\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure18.png}\n \\caption{Storing a QD single photon in a Rb vapor cell (a) works via Electromagnetically Induced Transparency in a $\\lambda$-system (b), so that a sequence of control pulses can define the light storage in the memory (c). To store polarization qubits, the polarization encoding can be translated into path encoding via beam displacer (BD) and Glan-laser polarizer (GLP in d) and transformed back after the memory \\cite{Namazi2017}. (d) reprinted Figure with permission from \\href{https:\/\/link.aps.org\/doi\/10.1103\/PhysRevApplied.8.034023}{\\textit{Namazi et al. 2017}} \\cite{Namazi2017} Copyright 2017 by the American Physical Society.}\n \\label{fig:fig18}\n\\end{figure}\nEven with existing quantum memories that are capable of being combined with QDs in terms of bandwidth, there are still a couple of issues to be addressed. The first one is the question of how one can, in practice, precisely match the QD emission energies to the transition energies in the atomic vapor ensemble. Additionally, the memory used in a future quantum network must also be able to deal with imperfect QDs, which are for example subject to spectral diffusion and dephasing, both broadening the emission and reducing the single-photon indistinguishability. These effects were theoretically treated by Rakher et al. finding that both fluctuations in phase and wavelength of the QD photons significantly reduce the memory efficiency \\cite{Rakher2013}.\n\\\\\nThe challenge of spectrally matching artificial atoms with their natural counterparts, i.e. matching photons emitted by QDs to transitions of alkali atoms, was first addressed by Akopian et al. in 2011, by slowing down single photons from QDs in an atomic ensemble \\cite{Akopian2011}. To do so, the authors shifted the QD emission energies to the memory transition energy via magnetic Zeeman tuning. In addition, they also showed that, after filtering the QD signal by a spectral window smaller than the linewidth of the atomic ensemble, the remaining photons, with fluctuating emission energies due to spectral diffusion, were all slowed down by the same amount (experienced the same storage times in the memory). Other ways of matching the QD emission energies with the atomic vapor transitions are piezo-strain tuning as done by Jahn et al. \\cite{Jahn2015}, temperature variation \\cite{Bremer2020} and over a large range covering all the relevant alkali vapor transition energies by Zhai et al. \\cite{zhai2020}. Additionally, tuning can be done by using a \"dressed state\" resonance fluorescence \\cite{Vamivakas2009}, which does not require any electric or magnetic field tuning as shown by Ulrich et al. \\cite{Ulrich2014}. Finally, we would like to stress that although single photons from QDs have been successfully stored and retrieved with high fidelity from quantum memories, these types of quantum memories are not yet sufficient, since they do not allow on-demand retrieval. They can only release the photon by a control pulse which is defined by the pulsed control laser, but the storage time cannot be adapted in a feedforward manner yet. Here, further progress will be necessary to obtain a true quantum memory.\n\\\\\nApart from storing a photon in an atomic ensemble, one can also store it in a solid-state system. Such a system could, for example, be a rare earth-ion system using an atomic frequency comb \\cite{Usmani2010}. However, such systems typically have a strong dependence on the polarization, which is why storing polarization qubits was difficult initially. But, by using two rare-earth crystals of Nd$^{3+}$:YVO$_4$, Zhou et al. also demonstrated the storage of polarization qubits \\cite{Zhou2012}. Later, the same group showed how a sequence of single photons emitted by a QD can be stored in their memory for 40 ns \\cite{Tang2016}. Additionally, they found that even for imperfect QD sources (with significant multi-photon contributions), only one photon is stored, thus increasing the purity of the qubit through the quantum memory.\n\\\\\nInterestingly, also the ensemble of nuclear spins inside a QD can be considered a solid-state quantum memory itself, as demonstrated by Kroutvar et al. using electron spins \\cite{Kroutvar2004} and also the so-called dark-exciton state in a QD can serve as a memory \\cite{McFarlane2009}. The advantage of nuclear spin memories is that they are shielded much better from the environment, due to the small magnetic moments of the nuclei. Thus, long-term storage of quantum bits (a quantum hard-drive) is more likely to be possible in such solid-state memories, limited only by dipole-dipole interactions among the nuclear spins \\cite{Taylor2003}, which can be suppressed as demonstrated by Kurucz et al. \\cite{Kurucz2009}. Other examples of nuclear spin memories also include nuclear spins of Carbon atoms coupled to NV centers in diamonds \\cite{Shim2013} or dopants in Silicon \\cite{Morton2008}. Although solid-state memories show excellent properties for photon storage, their reduced coupling to the environment can also be a disadvantage, making the read and write processes more difficult.\n\\\\\nAn alternative way of transferring the qubit state from a flying qubit, such as a QD single photon, onto a solid-state memory is by teleporting the state, using an entangled photon pair. In this scheme one photon of the entangled state would be stored in a local solid-state quantum memory, while the other is sent to the to-be-stored flying qubit. By projecting the two in a joint Bell state, the flying qubit gets teleported into the quantum memory, as was demonstrated by Bussi\u00e8res et al. using entangled photons at Telecom wavelengths, created via parametric down conversion, and using a rare-earth memory \\cite{Bussieres2014}. They achieved a fidelity above $80\\%$ over a distance of 12 km.\n\\\\\nIn summary, significant progress has been made during the last decade in optical quantum memories, especially increasing compatibility with QD-SPSs. Challenging tasks that remain are to further enhance the efficiency and reduce the noise (increase the signal to noise ratio to allow for non-ideal QDs) as well as the implementation of on-demand retrieval mechanisms. On the QD side research must focus on creating tunable, fourier-limited single photons which are subject to less line broadening and can thus be better integrated with quantum memories.\n\\subsection{Teleportation} \\label{section4.4}\nTeleportation consists of sending a previously unknown quantum state from Alice to Bob without physically sending the qubit itself, but by 'sacrificing' an entangled state shared between Alice and Bob, and using classical communication (\\textbf{Figure \\ref{fig:fig19}a}). Hereby, the state to be teleported is projected into the Bell basis in a joint measurement together with one half of the entangled state at Alice. The result of that Bell measurement then determines the unitary that must be applied to the other half of the entangled state by Bob to retrieve the teleported state at Bob's side \\cite{Bennett1993}.\n\\\\\nTeleportation is a vital building block in future quantum networks as it provides a way of realizing non-local quantum computations and can be used to transfer qubits into a solid-state quantum memory \\cite{Bussieres2014}. Teleportation can also be directly used for QKD (given a shared entangled state) by teleporting an encoded state from Alice to Bob, which is known as a quantum relay. Quantum relays using entangled photons from QDs have been demonstrated by Varnava et al. over a distance of 1 km \\cite{Varnava2016} and later by Huwer et al. using photons at Telecom wavelengths \\cite{Huwer2017}. In the following we discuss advances in quantum teleportation enabled by QD-based quantum light sources.\n\\\\\nAs discussed earlier, the efficiency of BSMs is reduced by multi-photon events unavoidable in implementations using WCP or SPDC sources. Therefore, also teleportation can benefit from the use of entangled photons created by deterministic QD-SPSs. The first QD-based proof-of-concept teleportation experiment was reported by Nilsson et al. using an QD entangled-light emitting diode \\cite{Nilsson2013}. The authors used the entangled photon pair emitted in one pulse to teleport a photon from the subsequent photon pair (Figure \\ref{fig:fig19}b) and obtained a maximum teleportation fidelity above the classical threshold of 2\/3. Although teleported photon and entangled photon were created by the same device, the authors emphasized that the teleported photon can in principle also stem from an external source. In fact, their QD emission energy was tunable, to match the wavelength of an incoming external photon, to facilitate TPI and enable teleportation. But the operation wavelength at 890 nm was not yet compatible with standard fiber-optical communication networks.\n\\\\\nTeleporting external photons with a QD entangled-photon source emitting in the Telecom C-band was recently demonstrated by the same group using an attenuated laser pulse \\cite{Anderson2020} (Figure \\ref{fig:fig19}c). In an initial characterization measurement, they found a HOM visibility of up to $70\\%$ for the TPI between the attenuated laser pulse and single photons emitted from their non-resonantly excited QD, a value significantly above the maximum value for TPI between two attenuated laser pulses of $50\\%$. The fidelity observed for teleporting a laser photon was exceeding $85\\%$ (Figure \\ref{fig:fig19}d).\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure19.png}\n \\caption{The quantum teleportation scheme (a) was implemented with target photon and entangled photons both emitted by the same QD by Nilsson et al. (b) \\cite{Nilsson2013} and with a laser photon at telecom wavelengths as the target photon by Anderson et al. (c) achieving teleportation fidelities above the classical limit (d) \\cite{Anderson2020}. (b) reprinted by permission from Springer Nature: Nature Photonics \\href{http:\/\/dx.doi.org\/10.1038\/nphoton.2013.10}{\\textit{Nilsson et al. 2013}} \\cite{Nilsson2013} Copyright 2013, (c,d) reprinted from \\href{https:\/\/doi.org\/10.1038\/s41534-020-0249-5}{\\textit{Anderson et al. 2020}} \\cite{Anderson2020} under Creative Commons license CC BY.}\n \\label{fig:fig19}\n\\end{figure}\nIn recent years, research efforts focused on improving QD-based quantum light sources, reducing the FSS, and making the emitted photons or photon pairs more indistinguishable. However, already with imperfect QDs relevant applications are already possible. Basset et al. recently demonstrated teleportation experiments with photons from QDs, for which they deliberately chose a QD of below-average quality \\cite{Basset2020a}. The authors used one photon from every second entangled photon pair as the to-be-teleported input state. They showed, that projecting into two Bell states, instead of only one (cf. \\cite{Reindl2018}), in the partial BSM does not only increase the efficiency, but also reduces the impact of an imperfect indistinguishability (cf. \\textbf{Figure \\ref{fig:fig20}} a and b for one-state and two-state BSM, respectively). A part of the photons that previously led to false coincidence counts since they were not indistinguishable enough, will now be identified from their polarization. The authors further enhanced the teleportation fidelities via spectral filtering, which improved the photon indistinguishability (Figure \\ref{fig:fig20}c) and also proposed a model from which the process fidelity of the teleportation protocol can be predicted for given QD characteristics (FSS and photon-indistinguishability) (Figure \\ref{fig:fig20}d).\n\\\\\n\\begin{figure}\n \\includegraphics[width= \\linewidth]{figure20.png}\n \\caption{Teleportation with entangled photons from QDs: Comparison of teleportation fidelities with a $25\\%$ BSM (a) and a $50\\%$ BSM (b), both with low visibility, and one with higher visibility due to spectral filtering (c). Dependence of teleportation fidelity on visibility, FSS S and BSM type (d). Figures reprinted from \\href{http:\/\/dx.doi.org\/10.1038\/s41534-020-00356-0}{\\textit{Basset et al. 2020}} \\cite{Basset2020a} under Creative Commons CC BY license.}\n \\label{fig:fig20}\n\\end{figure}\nNoteworthy, also other teleportation protocols exist, such as single mode teleportation which does not require entangled photon pairs and is related to the proposal of linear optics quantum computation \\cite{Knill2001}. This protocol was experimentally demonstrated with QD single photons by Fattal el al. \\cite{Fattal2004}.\n\\\\\nAs teleportation relies on the same ingredients as quantum repeaters for quantum networks, namely large TPI visibilities and entangled photon pairs, it will also profit by further advances in the development of QD-based quantum light sources. Due to the previous limits set to the TPI visibility, teleportation of a photon from a QD using an entangled photon pair from another QD has not been demonstrated so far. But the recent advances discussed in \\textbf{section 4.2} show prospects that this can be achieved in the near future.\n\\subsection{Quantum Random Number Generation} \\label{section4.5}\nAmong the building blocks required for quantum networks, quantum random number generators (QRNG) were the first to be realized using for instance a radioactive decay \\cite{Schmidt1970}, for a review of random number generation see \\cite{Herrero-Collantes2017}. As a result, the technology readiness level is the highest among all building blocks, as confirmed by its widespread commercial availability \u2013 recently even in consumer smartphones \\cite{idquantique} - and standardization efforts are also underway \\cite{Hart2017}.\n\\\\\nAll existing QKD protocols require reliable sources of randomness. In addition true random numbers are of course also vital in many other domains ranging from simulations and computing to online casinos. It is not enough to have a sequence of uniformly distributed random bits, but they must also fulfill the requirements for forward and backward security. The final key will only be as secure, as the initial random numbers are actually random. Be it in the basis choices in the BB84 scheme or in the choice of 2-universal-hash functions during the privacy amplification post processing step, an initial random seed is needed to make quantum communication work.\n\\\\\nIt has been shown that ideal QRNGs are the only perfect source of random numbers, as opposed to pseudo-random number generators \\cite{VonNeumann1963,Peres1992}. While computers typically rely on pseudo randomness, where a random seed and an algorithm is used to generate the numbers, or on classical physical randomness, based on the complexity of classical systems such as thermodynamic systems, only quantum processes can provide true sources of randomness \\cite{Ma2016}. This boils down to the proof of having no hidden variables, so that the outcome of a single projective measurement cannot be predicted by any means, which is why randomness can be certified via the violation of Bell-like inequalities \\cite{Gallego2013}. The simplest optical QRNG can be described as a photon impinging on a BS and its wave function collapsing on a single-photon detector. These were in fact the first optical QRNGs that were implemented \\cite{Jennewein2000,Stefanov2000}. In such a setup, it was also demonstrated that a true SPS can provide more randomness than a bright laser \\cite{Oberreiter2016}. \n\\\\\nBy now, several other QRNG schemes have emerged, which provide even faster random bit rates using for instance photon arrival times \\cite{Furst2010,Wayne2010,Wahl2011}. The quantum phase fluctuation and vacuum state schemes achieve Gbps bandwidths \\cite{Haylock2019,Lei2020,Bai2021} and do not rely on SPSs. Even faster QRNGs are available \\cite{Liu2017}, but these lack the electronics to handle this amount of data in real time \u2013 a similar problem to the classical key reconciliation in practical QKD applications. Parallel to the developments in QKD, also in QRNG researchers now shift the focus from trusted devices to the development of device independent (DI) approaches \\cite{Gomez2019}. Like in QKD, full DI was not achieved yet and the intermediate approaches like Semi-Device-Independent \\cite{Avesani2021} or self-certifying approaches suffer from lower bit generation rates. For an overview of different QRNG platforms and the state-of-the-art we refer to \\cite{Herrero-Collantes2017} and \\cite{Hart2017}.\n\\\\\nConcerning QRNG based on semiconducting QDs one must note that QKD protocols are agnostic towards where the random numbers come from, as long as their rate is sufficiently high to keep pace with QD emission rates. Nevertheless, it is interesting to note that specific ways of creating QRNG with QDs exist, which could in the future be combined with their property as a SPS to generate random numbers and true single photons on the same platform \\cite{McCabe2020,Purkayastha2016}. While QDs can improve many ingredients of future quantum networks, they appear to be not the optimal choice for the generation of random numbers in terms of practicality and possible advantages.\n\n\\subsection{Towards Quantum Networks - Practical Challenges} \\label{section4.6}\nFinally, there are a few hands-on issues to be addressed when attempting to build a stable and functional quantum network that is immune against environmental fluctuations. Here, we review progress in maintaining the stability of potential quantum networks via active stabilization, monitoring, and optimization of the building blocks making up the network.\n\\\\\nOne important issue is how one can guarantee the stability of a QKD channel for long times so that the security is not compromised by an increase in QBER \\cite{Zhu2002}. Therefore, active stabilisation schemes will be necessary, e.g. using bright beacon lasers that are multiplexed in the quantum FSO channel, as demonstrated in the seminal work by Ursin et al. in 2007 using a 144 km link between the Canary Island of La Palma and Tenereiffe and entangled photon-pairs generated via an SPDC source \\cite{Ursin2007}. Such stabilization approaches have been used to improve QKD experiments employing local free-space channels \\cite{carrasco2014} and also to transmit quantum states from satellite to ground \\cite{Yin2017}. Using QD-generated entangled photon pairs at telecom wavelengths, an advanced stabilization scheme has recently been demonstrated by Xiang et al. \\cite{Xiang2019} by continuously exchanging entangled photon pairs over 18 km of optical fiber for more than a week (\\textbf{Figure \\ref{fig:fig21}a}). The current state-of-the-art for mechanical stabilization of free-space links was recently achieved by Liu et al. exchanging SPDC-generated qubits between flying drones \\cite{Liu2021entanglement}. Moreover, it is important to define a joint reference frame for the measurement of the qubits (unless reference-frame independent schemes are employed \\cite{Laing2010,Wabnig2013} ), which can also be done via auxiliary, multiplexed lasers \\cite{Nauerth2013}. In addition to stabilizing the quantum channel, it should also be characterized well, to optimize the used QKD scheme for maximum performance. This can be done experimentally via optimization routines, numerically via key rate predictions or even using machine learning approach \\cite{Ismail2019}.\n\\\\\nAnother practical issue refers to the synchronisation between senders and receivers which can either be done by synchronisation pulse sequences or a multiplexed synchronisation signal, but also via GPS clocks \\cite{Bienfang2004,Pljonkin2017}. For fast stabilization and high key rates it will also be important to achieve fast modulation of the phase and polarization of photons \\cite{Grunenfelder2018,Li2019}, for which integrated photonics systems promise the best modulation rates \\cite{Sibson2017,Bunandar2018}, as well as high speed detectors with low dead times, especially at Telecom wavelengths, for an overview see \\cite{Zadeh2021}.\n\\\\\nNot only the stability, but also the security has to be continuously monitored. As mentioned before, multi-photon pulses enable the photon number splitting attack, which is why sources have to be well characterized in order to compensate for their non-ideal photon statistics. The amount of multi-photon contributions could however change (or be changed by an adversary) which is why it is necessary to monitor the multi-photon contributions during key exchange by using a subset of the photons for purity checks, as demonstrated by Kupko et al. in a real-time security monitoring approach (Figure \\ref{fig:fig21}b) \\cite{Kupko2020}. In their work, the authors also demonstrated how temporal filtering on the receiver side can enhance the signal to noise ratio to optimize the secure key rate for a given channel loss. Implementing such approaches, special care must be taken not to open the door for other side-channel attacks, as an adversary could otherwise unnoticedly steal photons outside the temporal acceptance window. Hence, an implementation which wants not only to benefit from the improved signal-to-noise ratio but also by estimating a lower $g^{(2)}(0)$, temporal filtering has to be applied on sender side alike (or $g^{(2)}(0)$ needs at least to be monitored also inside Alice). Another issue is that because of finite-key size effects, a minimum block size must be reached before the post processing step - as implemented nowadays in commercial systems \\cite{Chaiwongkhot2017}.\n\\\\\n\\begin{figure}[h]\n \\includegraphics[width= \\linewidth]{figure21.png}\n \\caption{Stable exchange of entangled photon pairs via optical fiber for an entire week (a) \\cite{Xiang2019}, continuous measurements of relevant QKD parameters such as QBER (c) and photon autocorrelation values (d) enable real-time security monitoring, as long as a minimum integration time for conclusive $g^{(2)}$ results is set (b) \\cite{Kupko2020}. (a) reprinted from \\href{http:\/\/www.nature.com\/articles\/s41598-019-40912-z}{\\textit{Xiang et al. 2019}} \\cite{Xiang2019} under Creative Commons Attribution 4.0 International License, (b) reprinted from \\href{http:\/\/dx.doi.org\/10.1038\/s41534-020-0262-8}{\\textit{Kupko et al. 2020}} \\cite{Kupko2020} under Creative Commons Attribution 4.0 International License.}\n \\label{fig:fig21}\n\\end{figure}\nThe abundance of a classical authenticated channel is always assumed implicitly in QKD protocols. Even if an initial secret is shared, authentication has to be repeated regularly which uses up a fraction of the key, which is why protocols for efficient authentication are necessary \\cite{Ljunggren2000,kiktenko2020}. Alternatively, QKD can be combined with other post-quantum cryptography schemes to support the authentication \\cite{Wang2021}.\n\\\\\nA challenge that increases in importance with the growing maturity of the developed QKD systems refers to the security certification. One could either rely on device-independent schemes or use special protocols to confirm that a QKD system is working properly \\cite{Tomita2019}. That includes the certification of the initial randomness, the integrity of the quantum channel, the purity of the source, as well as the correctness of the post-processing steps.\n\\\\\nFinally, in order to benchmark different QKD protocols and different technology platforms, a general framework beyond stating only the maximum secure key rate or the maximum achieved distance must be developed, since these parameters are highly dependent on the specific laboratory setup used with a specific source and under certain conditions. Therefore, testing standards are envisioned, to reliably compare different approaches \\cite{Alleaume2004,Langer2009,alleaume2014}. That could be done for instance by ensuring that they certify the same amount of overall $\\epsilon$-security (see the discussion of security definitions in \\cite{Renner2008}). Another useful figure-of-merit could be the \"security-per-dollar-spent\", considering the fact that different QKD architectures, that in principle promise different levels of security, also have different levels of implementation difficulty and hence costs. And last but not least, while there is of course the ultimate aim to achieve unconditional security, ruling out even the most unlikely attacks (that are practically impossible but allowed by the laws of quantum mechanics), in practice one might be content with a more relaxed, applied form of security. This could either be a deliberate trade-off between security-gain and implementation-costs, or an intermediate step towards ultimate security. \n\\\\\nThe approach of assuming realistic restrictions on an adversary are known and even required from the field of cryptographic primitives beyond QKD in untrusted settings, e.g. quantum oblivious transfer in the so-called noisy storage model \\cite{Wehner2008}, representing crucial building blocks for modern communication \\cite{Broadbent2016} networks.\n\n\\section{Conclusion}\nIn this review we summarized the progress made in recent years in the field of quantum communication using quantum light sources based on semiconductor quantum dots. After revisiting the foundations of QKD and introducing semiconductor QDs as one of the most promising candidates for photonic implementations of quantum information, we comparatively discussed implementations of QKD using single photons as well as entangled photon pairs generated via engineered QD-devices. Next, we discussed recent progress in the development of key building blocks of future quantum networks and how they can benefit from \/ or become compatible with such semiconductor QDs. Considering the tremendous progress achieved in the field, functional quantum networks and real-world application appear to be within reach in the not too distant future. However, some important ingredients are still missing or require additional research efforts. For example, it is necessary to combine the superior properties QD sources proved to be able to deliver, in terms of high efficiency, high brightness, high single-photon purity, large photon indistinguishability, and large entanglement fidelities, with practical and durable source modules operable outside shielded lab environments. Another important challenge concerns the development of efficient quantum memories with on-demand retrieval. Furthermore, protocols for multi-node architectures and schemes as well as standards for the security certification are to be developed. A major challenge, that has not yet been tackled at all using QD-devices and which was not discussed here, concerns the implementation of cryptographic primitives beyond QKD and in untrustful settings. Such primitives, however, are representing important building blocks for sensitive tasks in modern communication networks, such as the secure authentication at a bank's ATM. This highlights the rich field of quantum cryptography and new areas of research to discover.\n\\\\\nFinally, we want to emphasize that future quantum networks will certainly not be constituted of a single technology or a specific protocol. On the contrary, many different platforms and schemes will most probably be combined and coexist, including deterministic quantum light sources as well as WCP- and SPDC-based sources, two-party quantum cryptographic primitives like QKD and beyond, multi-party primitives, classical and post-quantum cryptography, different encoding schemes and various network architectures and topologies, each of which being used and optimized for its special purpose. Reviewing the achievements and success since the advent of the field of quantum cryptography, driven by ideas of S. Wiesner in the late 1960s, it seems reasonable to expect major steps towards the quantum internet within this decade.\n\\\\\n\\end{justify}\n\\medskip\n\n\\medskip\n\\textbf{Acknowledgements} \\par \nWe gratefully acknowledge financial support from the German Federal Ministry of Education and Research (BMBF) via the project 'QuSecure' (Grant No. 13N14876) within the funding program Photonic Research Germany.\n\n\\medskip\n\n\\bibliographystyle{MSP}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}